/* Account Modal CSS - Redesigned Premium Split Layout */
.account-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.account-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.account-modal-container {
    background: var(--white, #fff);
    width: 100%;
    max-width: 800px;
    height: 475px;
    /* Fixed height for consistent look */
    border-radius: 16px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.account-modal-overlay.active .account-modal-container {
    transform: translateY(0);
}

.account-modal-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Image Section */
.account-modal-image {
    width: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background: #000;
}

.account-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 10s ease;
}

.account-modal-overlay.active .account-bg-img {
    transform: scale(1.05);
}


.account-image-overlay {
    display: none;
}

.account-image-content {
    display: none;
}


/* Form Section */
.account-modal-form-wrapper {
    width: 50%;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.account-modal-content {
    width: 100%;
    max-width: 360px;
    padding: 20px;
}

/* Close Button */
.account-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.account-modal-close:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg);
}

/* Mobile Tweaks (Responsive Popup) */
@media (max-width: 768px) {
    .account-modal-overlay {
        padding: 10px;
        /* Tighter padding */
        align-items: center;
        /* Center for classic popup feel */
    }

    .account-modal-container {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        max-height: 90vh;
        /* Cap at viewport */
        overflow-y: auto;
        /* Scroll ONLY if absolutely needed */
        border-radius: 12px;
        display: flex;
        flex-direction: column;
    }

    .account-modal-layout {
        flex-direction: column;
    }

    .account-modal-image {
        width: 100%;
        height: 180px;
        flex: 0 0 180px;
        flex-shrink: 0;
    }

    /* ... content styles ... */

    .account-modal-form-wrapper {
        width: 100%;
        height: auto;
        flex: 1 1 auto;
        overflow-y: visible;
        /* Allow form to scroll if needed */
        padding: 24px 20px;
        /* Reduced vertical padding */
        align-items: flex-start;
    }

    .account-modal-content {
        max-width: 100%;
        padding: 0;
    }

    /* Tighter form spacing on mobile */
    .form-row {
        margin-bottom: 16px;
    }

    h2 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .auth-subtitle {
        margin-bottom: 20px;
        font-size: 13px;
    }

    .auth-divider {
        margin: 16px 0 !important;
    }

    /* Close button always on top right of container */
    .account-modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        color: #fff;
        border: none;
    }
}

/* ---------------
   Auth Steps & Form Styling (Premium Minimalist Refinements)
   --------------- */

.auth-step {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography Refinements */
h2 {
    margin: 0 0 12px;
    font-size: 26px;
    /* Slightly smaller for elegance */
    font-weight: 600;
    /* Regular bold */
    text-align: left;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    font-family: var(--font-heading, "Inter", sans-serif);
}

.auth-subtitle {
    text-align: left;
    color: #555;
    margin: 0 0 36px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

/* Forms: Premium Minimal Inputs */
.form-row {
    margin-bottom: 24px;
    position: relative;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* Spaced out caps */
}

/* Sleek Input Style */
.input-text {
    width: 100%;
    padding: 14px 0;
    /* No side padding, bottom border focus */
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 16px;
    /* Larger font for easy typing */
    outline: none;
    color: #000;
    transition: all 0.3s ease;
    background: transparent;
    font-weight: 400;
}

.input-text::placeholder {
    color: #bbb;
    font-weight: 300;
}

.input-text:focus {
    border-bottom-color: #000;
    /* Expanding underline effect could be added here via pseudo-element if structural changes, 
       but sleek black line is premium enough */
}

/* Remove auto-fill background color in Chrome */
.input-text:-webkit-autofill,
.input-text:-webkit-autofill:hover,
.input-text:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    transition: background-color 5000s ease-in-out 0s;
}

.input-error {
    color: #d32f2f;
    /* Premium red */
    font-size: 11px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

/* Input Group for Mobile (Capsule Style) */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    /* rounded corners changed to 4px */
    padding: 6px 16px;
    background: #fff;
    transition: border-color 0.3s;
    margin-bottom: 24px;
}

.input-group:focus-within {
    border-color: #000;
}

.input-prefix {
    background: transparent;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    padding: 0;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid #e0e0e0;
    /* Vertical Divider */
    border-radius: 0;
    display: flex;
    align-items: center;
    height: 24px;
}

/* Adjust input text when inside group */
.input-group .input-text {
    border: none !important;
    padding: 10px 0;
    flex-grow: 1;
    font-weight: 500;
    /* Match +91 */
    font-size: 18px;
    /* Slightly larger */
    letter-spacing: 0.5px;
    color: #000;
    background: transparent;
    /* Ensure transparent */
}

.input-group .input-text:focus {
    border: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

.input-group .input-text::placeholder {
    font-weight: 400;
    color: #999;
}


/* Password Toggle Text */
.toggle-password-text {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-weight: 600;
    font-size: 13px;
    padding: 0 10px;
    text-transform: uppercase;
    transition: color 0.2s;
    outline: none;
}

.toggle-password-text:hover {
    color: #000;
}

/* Ensure password input takes full width minus button */
.password-wrapper input {
    /* Reset specific padding since we use flex gap now via input-group logic or manual */
    padding-right: 10px;
}

/* Buttons */
.auth-btn-primary {
    width: 100%;
    background: #000;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 4px;
    /* Slightly rounded */
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Premium spacing */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-btn-secondary {
    width: 100%;
    background: transparent;
    color: #000;
    border: 1px solid #e0e0e0;
    padding: 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.auth-btn-secondary:hover {
    border-color: #000;
    background: #fff;
}

/* Dividers & Social */
.auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    position: relative;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f0f0f0;
}

.auth-divider span {
    padding: 0 16px;
}

.auth-social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 14px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.auth-social-btn:hover {
    border-color: #000;
    background: #fafafa;
}

.auth-social-btn img {
    width: 18px;
    height: 18px;
}

.auth-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
    padding-left: 0;
}

.auth-back-btn:hover {
    color: #000;
}

/* Layout Utilities */
.form-row-group {
    display: flex;
    gap: 20px;
}

.form-row-group .form-row {
    flex: 1;
    margin-bottom: 24px;
}

.gender-options {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

/* OTP Specifics */
.center-text {
    text-align: center;
    letter-spacing: 12px;
    font-size: 24px;
    font-weight: 500;
    font-family: monospace;
    border-bottom: 2px solid #000 !important;
}

.otp-inputs {
    margin: 32px 0;
}

/* Resend Button - Black */
#btnResendOTP {
    color: #000 !important;
    text-decoration: underline;
}

/* ----------------------------------
   Premium Loading Animation (Button Loader)
   ---------------------------------- */
.auth-btn-primary.loading {
    color: transparent !important;
    /* Hide text */
    pointer-events: none;
    position: relative;
}

.auth-btn-primary.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    /* Sleek easing */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Inline Back/Change Buttons */
.auth-back-text {
    background: none;
    border: none;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 300 !important;
    /* Requested 300 */
    cursor: pointer;
    color: #000;
    text-decoration: underline;
    padding: 0;
}

/* OTP 6-Digit Layout */
.otp-digit-container {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.otp-digit {
    width: 48px;
    height: 48px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* Slightly rounded squares */
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    color: #000;
    outline: none;
    transition: all 0.2s;
    padding: 0;
}

.otp-digit:focus {
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .otp-digit-container {
        gap: 8px;
    }

    .otp-digit {
        width: 15%;
        /* Responsive width */
        height: 50px;
        font-size: 18px;
    }
}

/* Hiding reCAPTCHA Badge (Must include disclaimer text in UI) */
.grecaptcha-badge {
    visibility: hidden;
}

.auth-terms-disclaimer {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-top: 16px;
    line-height: 1.4;
}

.auth-terms-disclaimer a {
    color: #777;
    text-decoration: underline;
}

/* PIN Grid for Login (Password replacement) */
.pin-grid {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.pin-box {
    width: 48px;
    height: 48px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    /* Dots will be bold */
    text-align: center;
    background: #fff;
    color: #000;
    outline: none;
    transition: all 0.2s;
    -webkit-text-security: disc;
    /* Force dots even if type=tel? No, typical browser support varies. type=password works best */
    padding: 0;
}

.pin-box:focus {
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.pin-box.filled {
    border-color: #333;
}

@media (max-width: 480px) {
    .pin-grid {
        gap: 8px;
    }

    .pin-box {
        width: 15%;
        height: 50px;
    }
}