/* =========================================
   1. TYPOGRAPHY & GLOBAL LINKS
   ========================================= */
.title-auth {
    color: var(--blue);
    font-family: var(--main-font-bold), sans-serif;
    font-size: 30px;
    letter-spacing: -0.5px;
}

.link-brand {
    color: var(--blue);
    font-family: var(--main-font-light), sans-serif;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-brand:hover {
    color: var(--bluesoft);
    text-decoration: underline;
}

/* =========================================
   2. FORM COMPONENTS (Labels, Inputs, Feedbacks)
   ========================================= */
.label-form {
    color: var(--black);
    font-size: 14px;
    font-family: var(--main-font-bold), sans-serif;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.form-control {
    color: var(--black);
    font-family: var(--main-font-light), sans-serif;
    font-size: 16px; /* Prevents auto-zoom on iOS devices */
    padding: 0.85rem 1.25rem;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background-color: #fbfbfb;
    transition: all 0.3s ease;
    height: auto; /* Allows padding to define the element's height */
}

.form-control::placeholder {
    color: #9F224166;
    font-size: 14px;
}

.form-control:focus {
    background-color: var(--white);
    border-color: var(--bluesoft);
    box-shadow: 0 0 0 4px rgba(101, 178, 232, 0.15); /* Brand soft blue glow */
    outline: none;
}

/* Error feedback styling */
.invalid-feedback {
    color: var(--red);
    font-family: var(--main-font-book), sans-serif;
    font-size: 13px;
    margin-top: 0.4rem;
    padding-left: 0.2rem;
}

/* Error state outline */
.form-control.is-invalid {
    border-color: var(--red);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(206, 44, 52, 0.15); /* Red glow for errors */
}

/* =========================================
   3. INPUT GROUPS (e.g., Password visibility toggle)
   ========================================= */
/* Merge input right side with the appended button */
.input-group .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Eye button styling to act as input extension */
.input-group .btn-eye {
    background-color: #fbfbfb;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-left: none;
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    color: rgba(0, 0, 0, 0.4);
    padding: 0 1.25rem;
    transition: all 0.3s ease;
}

.input-group .btn-eye:hover {
    color: var(--blue);
    background-color: #fbfbfb;
}

/* Premium trick: highlight the entire group wrapper when input is focused */
.input-group:focus-within .btn-eye {
    border-color: var(--bluesoft);
    background-color: var(--white);
}

.input-group:focus-within .form-control {
    box-shadow: none; /* Disable individual input shadow to prevent clipping */
}

.input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(101, 178, 232, 0.15);
    border-radius: 12px;
}

/* =========================================
   4. VALIDATION FIXES FOR INPUT GROUPS (Bootstrap Overrides)
   ========================================= */

/* Shared: Remove native validation icons (!) and (✓) and fix border joining */
.input-group .form-control.is-invalid,
.was-validated .input-group .form-control:invalid,
.input-group .form-control.is-valid,
.was-validated .input-group .form-control:valid {
    background-image: none !important;
    padding-right: 1.25rem !important; /* Restore normal padding */
    border-right: none !important; /* Keep input joined to the button */
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* --- INVALID STATE (Error) --- */
/* Pass red border to the eye button */
.input-group .form-control.is-invalid ~ .input-group-append .btn-eye,
.was-validated .input-group .form-control:invalid ~ .input-group-append .btn-eye {
    border-color: var(--red) !important;
    border-left: none !important;
}

/* Red glow for focus-within when invalid */
.input-group:has(.form-control.is-invalid):focus-within,
.was-validated .input-group:has(.form-control:invalid):focus-within {
    box-shadow: 0 0 0 4px rgba(206, 44, 52, 0.15);
}

.input-group:has(.form-control.is-invalid):focus-within .btn-eye,
.was-validated .input-group:has(.form-control:invalid):focus-within .btn-eye {
    border-color: var(--red) !important;
}

/* --- VALID STATE (Success) --- */
/* Pass green border to the eye button */
.input-group .form-control.is-valid ~ .input-group-append .btn-eye,
.was-validated .input-group .form-control:valid ~ .input-group-append .btn-eye {
    /* Uses custom var if exists, else Bootstrap's success green */
    border-color: var(--green, #28a745) !important;
    border-left: none !important;
}

/* Green glow for focus-within when valid */
.input-group:has(.form-control.is-valid):focus-within,
.was-validated .input-group:has(.form-control:valid):focus-within {
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

.input-group:has(.form-control.is-valid):focus-within .btn-eye,
.was-validated .input-group:has(.form-control:valid):focus-within .btn-eye {
    border-color: var(--green, #28a745) !important;
}
/* =========================================
   5. PREMIUM CHECKBOXES
   ========================================= */

/* Style the text accompanying the checkbox */
.checkbox-brand-wrapper label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-family: var(--main-font-light), sans-serif;
    color: var(--black);
    cursor: pointer;
    margin-bottom: 0;
}

/* 1. Remove OS default styling and apply custom styles directly to the input */
.checkbox-brand-wrapper input[type="checkbox"],
.checkbox-brand-wrapper input[type="radio"] {
    -webkit-appearance: none; /* Safari/Chrome */
    appearance: none; /* Modern Standard */
    background-color: var(--white);
    margin: 0;
    margin-right: 10px; /* Spacing from the text */
    color: currentColor;
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px; /* Premium soft borders */
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* 2. Accessibility glow (Focus) */
.checkbox-brand-wrapper input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(101, 178, 232, 0.25);
    border-color: var(--bluesoft);
    outline: none;
}

/* 3. "Checked" state (Painted blue) */
.checkbox-brand-wrapper input[type="checkbox"]:checked {
    background-color: var(--blue);
    border-color: var(--blue);
}

/* 4. Draw the white checkmark (✓) using borders inside a ::before pseudo-element */
.checkbox-brand-wrapper input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0); /* Hidden by default */
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--white); /* Paints the checkmark white */
    /* This is a coded SVG to generate a perfect checkmark */
    background-color: var(--white);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Animate the checkmark (✓) so it appears with a "pop" effect */
.checkbox-brand-wrapper input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* =========================================
   7. PASSWORD STRENGTH METER & REQUIREMENTS
   ========================================= */

/* A soft box to group the password requirements visually */
.password-strength-section {
    background-color: #fbfbfb;
    border: 1.5px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
}

/* Progress bar premium overrides */
.progress {
    height: 4px;
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    box-shadow: none;
}

.progress-bar {
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* Strength colors linked to brand variables */
.progress-bar-danger {
    background-color: var(--red);
}

.progress-bar-warning {
    background-color: var(--yellow); /* Reusing your brand yellow */
}

.progress-bar-success {
    background-color: var(--green, #28a745); /* Uses var if exists, else fallback */
}

/* Requirement labels typography */
.password-requirements {
    color: var(--black);
    font-size: 13px;
    font-family: var(--main-font-bold), sans-serif;
}

/* Checklist layout */
.req-list {
    margin-bottom: 0;
}

/* Creates a 2-column layout for the checklist on larger screens */
@media (min-width: 576px) {
    .req-list {
        column-count: 2;
        column-gap: 1rem;
    }
}

.req-list li {
    font-size: 12.5px;
    font-family: var(--main-font-book), sans-serif;
    color: rgba(0, 0, 0, 0.6); /* Muted gray text until valid */
    margin-bottom: 0.4rem;
    transition: color 0.3s ease;
}

/* Unchecked icons (small circles) */
.req-list .req-icon {
    font-size: 6px;
    vertical-align: middle;
    margin-right: 6px;
    color: rgba(0, 0, 0, 0.2);
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Checked icons (handled by your existing JS: switching class to .fa-check) */
.req-list span .fa-check {
    color: var(--green, #28a745);
    font-size: 10px; /* Slightly larger for the checkmark */
}