/* ================================================================ */
/* 1. Shared Styles for All Forms
/* ================================================================ */

.novin-registration-form,
.novin-login-form,
.novin-change-password-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 0px;
    border-radius: 8px;
}

.novin-registration-form h2,
.novin-login-form h2,
.novin-change-password-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.novin-registration-form .form-row,
.novin-login-form .form-row,
.novin-change-password-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px; /* Added margin for better spacing between rows */
}

.novin-registration-form .form-group,
.novin-login-form .form-group,
.novin-change-password-form .form-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.novin-registration-form .form-group label,
.novin-login-form .form-group label,
.novin-change-password-form .form-group label {
    display: block;
    margin-bottom: 8px; /* Increased margin */
    font-weight: 500; /* Slightly bolder labels */
}

.novin-registration-form .form-group input,
.novin-login-form .form-group input,
.novin-change-password-form .form-group input {
    width: 100%;
    padding: 12px 15px; /* Increased padding */
    border: 1px solid #ccc;
    border-radius: 6px; /* Slightly more rounded */
    box-sizing: border-box;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    background-color: #f9f9f9;
}

.novin-registration-form .button-wrapper,
.novin-login-form .button-wrapper,
.novin-change-password-form .button-wrapper {
    margin-top: 25px;
}

.novin-registration-form button,
.novin-login-form button,
.novin-change-password-form button {
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: inline-block;
    transition: background-color 0.3s, transform 0.2s;
}

.novin-registration-form button:hover,
.novin-login-form button:hover,
.novin-change-password-form button:hover {
    transform: translateY(-2px);
}


/* ================================================================ */
/* 2. Login Form Specific Styles
/* ================================================================ */

.novin-login-form .forgot-password,
.novin-login-form .back-to-login {
    margin-top: 10px;
    text-align: center;
}

.novin-login-form .forgot-password a,
.novin-login-form .back-to-login a {
    text-decoration: none;
}

/* ================================================================ */
/* 3. Change Password Form Specific Styles
/* ================================================================ */

/* Input Validation States (Valid/Invalid) */
.novin-change-password-form .form-group input.input-valid {
    border-color: #28a745; /* Green */
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
    background-color: #f0fff4;
}

.novin-change-password-form .form-group input.input-invalid {
    border-color: #dc3545; /* Red */
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    background-color: #fff0f1;
}

/* Loading Spinner for AJAX check */
.novin-change-password-form .form-group .spinner {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px; /* Position for RTL */
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none; /* Hidden by default */
}

/* LTR support for spinner */
html[dir="ltr"] .novin-change-password-form .form-group .spinner {
    right: auto;
    left: 12px;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* --- START: Custom Styles for Password Strength Validator --- */

#password-strength-container {
    margin-top: 15px;
}

/* Progress Bar Styles */
.strength-bar-wrapper {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.strength-bar {
    height: 100%;
    width: 0; /* starts empty */
    border-radius: 5px;
    transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

/* Bar Color States */
.strength-bar.weak { background-color: #dc3545; } /* Red */
.strength-bar.medium { background-color: #ffc107; } /* Yellow */
.strength-bar.strong { background-color: #28a745; } /* Green */

/* Criteria Checklist Styles */
.criteria-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #555;
    overflow: hidden; /* Important for hiding animation */
}

.criteria-list li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    /* START: New animation properties */
    max-height: 100px; /* initial height */
    opacity: 1;
    transition: color 0.3s ease, max-height 0.5s ease, opacity 0.5s ease, margin 0.5s ease, transform 0.5s ease;
    transform: translateX(0);
    /* END: New animation properties */
}

.criteria-list li.valid {
    color: #28a745; /* Green text when valid */
}

/* START: New class for hiding animation */
.criteria-list li.hiding {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    transform: translateX(-20px);
}
html[dir="rtl"] .criteria-list li.hiding {
    transform: translateX(20px);
}
/* END: New class for hiding animation */


/* Icon Styles for Checklist */
.criterion-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #e0e0e0; /* Default gray */
    margin-left: 8px;
    position: relative;
    transition: background-color 0.3s ease;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

html[dir="rtl"] .criterion-icon {
    margin-left: 0;
    margin-right: 8px;
}

.criteria-list li.valid .criterion-icon {
    background-color: #28a745; /* Green background when valid */
}

/* Checkmark using pseudo-element */
.criteria-list li.valid .criterion-icon::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
/* --- END: Custom Styles --- */


/* ================================================================ */
/* 4. Responsive Design
/* ================================================================ */

@media (max-width: 768px) {
    .novin-registration-form .form-row,
    .novin-login-form .form-row,
    .novin-change-password-form .form-row {
        flex-direction: column;
        gap: 0; /* Remove gap in column view */
        margin-bottom: 0;
    }

    .novin-registration-form .form-group,
    .novin-login-form .form-group,
    .novin-change-password-form .form-group {
        margin-bottom: 15px; /* Add margin to groups instead of row */
    }
}