/* Email Customizer Frontend Styles */

/* Custom Password Reset Form */
.custom-password-reset {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-password-reset h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.custom-password-reset p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

/* Reset Form Styling */
.custom-reset-form {
    width: 100%;
}

.custom-reset-form p {
    margin-bottom: 15px;
    text-align: left;
}

.custom-reset-form label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.custom-reset-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.custom-reset-form input[type="password"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.custom-reset-form input[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.custom-reset-form input[type="submit"]:hover {
    background: #005a87;
}

.custom-reset-form input[type="submit"]:active {
    background: #004a73;
}

/* Error and Success Messages */
.reset-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.reset-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.reset-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 5px;
    font-size: 12px;
}

.password-strength.weak {
    color: #dc3545;
}

.password-strength.medium {
    color: #ffc107;
}

.password-strength.strong {
    color: #28a745;
}

/* Loading State */
.custom-reset-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.custom-reset-form.loading input[type="submit"] {
    background: #6c757d;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 480px) {
    .custom-password-reset {
        margin: 10px;
        padding: 20px;
        max-width: none;
    }
    
    .custom-password-reset h2 {
        font-size: 20px;
    }
    
    .custom-reset-form input[type="password"],
    .custom-reset-form input[type="submit"] {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* Accessibility Improvements */
.custom-reset-form input[type="password"]:focus,
.custom-reset-form input[type="submit"]:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .custom-password-reset {
        border: 2px solid #000;
    }
    
    .custom-reset-form input[type="password"] {
        border: 2px solid #000;
    }
    
    .custom-reset-form input[type="submit"] {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .custom-password-reset {
        background: #1a1a1a;
        border-color: #444;
        color: #fff;
    }
    
    .custom-password-reset h2 {
        color: #fff;
    }
    
    .custom-password-reset p {
        color: #ccc;
    }
    
    .custom-reset-form label {
        color: #fff;
    }
    
    .custom-reset-form input[type="password"] {
        background: #2a2a2a;
        border-color: #555;
        color: #fff;
    }
    
    .custom-reset-form input[type="password"]:focus {
        border-color: #007cba;
    }
}

/* Print Styles */
@media print {
    .custom-password-reset {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .custom-reset-form input[type="submit"] {
        display: none;
    }
}

/* Animation for form appearance */
.custom-password-reset {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form validation styles */
.custom-reset-form input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.custom-reset-form input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Password requirements list */
.password-requirements {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    padding-left: 0;
    list-style: none;
}

.password-requirements li {
    margin-bottom: 3px;
    position: relative;
    padding-left: 20px;
}

.password-requirements li:before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #dc3545;
}

.password-requirements li.valid:before {
    content: "✓";
    color: #28a745;
}

/* Password field wrapper for toggle button */
.password-field-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 2px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.password-toggle:focus {
    outline: 1px solid #007cba;
    color: #007cba;
}

/* Adjust password field padding to make room for toggle button */
.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] {
    padding-right: 50px;
}

/* Success page styling */
.password-reset-success {
    text-align: center;
    padding: 40px 20px;
}

.password-reset-success h2 {
    color: #28a745;
    margin-bottom: 15px;
}

.password-reset-success .success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 20px;
}

.password-reset-success a {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.password-reset-success a:hover {
    background: #005a87;
}
