/* =========================================================================
   Authentication Pages CSS
   These styles strictly match the login mockup.
   ========================================================================= */

body.auth-page {
    /* Uses the gradient variable defined in style.css */
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin: 0 auto;
}

/* --- Auth Header (Top Section) --- */
.auth-header {
    text-align: center;
    color: white;
    padding: 2.5rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

.auth-logo-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-logo-card .logo-box {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.auth-logo-card .logo-text {
    text-align: left;
}

.auth-logo-card h2 {
    color: white;
    font-size: 1.35rem;
    margin: 0;
    line-height: 1.2;
}

.auth-logo-card .version {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* --- Auth Card (Bottom Section) --- */
.auth-card {
    background: var(--card-bg);
    flex-grow: 1;
    border-top-left-radius: 1.75rem;
    border-top-right-radius: 1.75rem;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05); /* Soft shadow */
    display: flex;
    flex-direction: column;
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Form Fields --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-color);
    transition: var(--transition-fast);
    font-family: inherit;
    color: var(--text-primary);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 81, 178, 0.1);
}

/* Password field with eye icon */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem; /* Leave room for icon */
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--accent-blue);
}

/* --- Form Options (Remember me & Forgot password) --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    border-radius: 4px;
    margin: 0;
}

.forgot-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent-blue);
}

/* --- Main Login Button --- */
.auth-form .btn-primary {
    background: var(--accent-blue);
    color: white;
    padding: 1.125rem;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
}

.auth-form .btn-primary:hover {
    box-shadow: 0 8px 20px rgba(52, 81, 178, 0.25);
    transform: translateY(-2px);
}

/* --- Footer --- */
.auth-footer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.signup-link {
    font-weight: 500;
    color: var(--accent-blue);
}

/* --- Desktop Layout Enhancements --- */
@media (min-width: 501px) {
    body.auth-page {
        justify-content: center;
        align-items: center;
        padding: 2rem;
    }
    
    .auth-wrapper {
        min-height: auto;
        max-width: 480px;
        box-shadow: var(--box-shadow-lg);
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    
    .auth-card {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        padding: 3rem 2.5rem;
    }
    
    .auth-header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding-bottom: 2.5rem;
    }
}

/* --- Signup Specific Styles --- */
body.dark-auth {
    background: linear-gradient(180deg, #111827 0%, #1e293b 100%);
}

.dark-auth .header-top {
    width: 100%;
    text-align: left;
    margin-bottom: 1rem;
}

.dark-auth .auth-logo-text {
    margin-bottom: 1rem;
}

.dark-auth .auth-logo-text h2 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.dark-auth .auth-logo-text p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Select Dropdown */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-color);
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 81, 178, 0.1);
}

.select-wrapper i {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

/* Password Rules List */
.password-rules {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.password-rules li {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-rules li .dot {
    width: 4px;
    height: 4px;
    background-color: #94a3b8;
    border-radius: 50%;
}

.password-rules li.valid {
    color: var(--accent-green);
}

.password-rules li.valid .dot {
    background-color: var(--accent-green);
}

/* Terms Checkbox */
.terms-group {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    flex-shrink: 0;
    border-radius: 4px;
}

.terms-checkbox a {
    color: var(--accent-blue);
    font-weight: 500;
}

/* =========================================================================
   OTP Components & Step Animations
   ========================================================================= */

.otp-field-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
}

.otp-digit {
    width: 62px;
    height: 72px;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
}

.otp-digit:focus {
    border-color: #3451b2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(52, 81, 178, 0.08);
    transform: translateY(-2px);
}

.otp-digit.error {
    border-color: #ef4444;
    background: #fef2f2;
    animation: shakeDigit 0.4s ease-in-out;
}

@keyframes shakeDigit {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Floating Label Styles Override for E-commerce */
.floating-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.floating-input-group input {
    width: 100%;
    padding: 1.25rem 1rem 0.5rem;
    border: 1.75px solid #e2e8f0;
    border-radius: 0.85rem;
    font-size: 1rem;
    font-weight: 500;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s;
}

.floating-input-group label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #64748b;
    pointer-events: none;
    transition: all 0.2s;
}

.floating-input-group input:focus,
.floating-input-group input:not(:placeholder-shown) {
    padding-top: 1.75rem;
    padding-bottom: 0.5rem;
    border-color: #3451b2;
    background: #fff;
}

.floating-input-group input:focus + label,
.floating-input-group input:not(:placeholder-shown) + label {
    top: 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #3451b2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Step Transition Animations */
.step-fade-in {
    animation: stepIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stepIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Success Indicator */
.auth-success-icon {
    width: 64px;
    height: 64px;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    animation: scaleCheck 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleCheck {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Overrides */
@media (max-width: 600px) {
    .otp-digit { width: 52px; height: 60px; font-size: 1.5rem; }
    .banner-content h1 { font-size: 2.25rem; }
}

.forgot-link-dark:hover {
    color: var(--accent-blue);
}

/* Ecom Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
}
.custom-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--text-primary);
    cursor: pointer;
    margin: 0;
}


/* =========================================================================
   E-Commerce Modern Split Auth Layout (Fixed)
   ========================================================================= */
body.ecommerce-auth {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #f8fafc;
    font-family: 'Outfit', sans-serif;
}

.auth-split-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Left Banner (Visuals) */
.auth-banner {
    flex: 1;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: white;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(52, 81, 178, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
    z-index: 1;
}

.auth-banner .brand-logo,
.auth-banner .banner-content {
    position: relative;
    z-index: 2;
}

.auth-banner .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.auth-banner .brand-logo i {
    font-size: 1.75rem;
    color: #38bdf8;
}

.auth-banner .banner-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: white;
}

.auth-banner .banner-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 400px;
    line-height: 1.6;
}

/* Right Form Wrapper */
.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    max-width: 600px;
    padding: 2rem;
    height: 100vh;
    overflow-y: auto;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-header-text {
    margin-bottom: 2rem;
}

.auth-header-text h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.auth-header-text p {
    color: #64748b;
    font-size: 1rem;
}

.ecom-input-group {
    margin-bottom: 1.25rem;
}

.ecom-input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.ecom-input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ecom-input-group input:focus {
    outline: none;
    border-color: #3451b2;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(52, 81, 178, 0.1);
}

.ecom-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ecom-password-wrapper input {
    padding-right: 3rem;
}

.ecom-toggle-pwd {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s;
}

.ecom-toggle-pwd:hover {
    color: #3451b2;
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.auth-footer-text a {
    color: #3451b2;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer-text a:hover {
    color: #1e3a8a;
}

@media (max-width: 900px) {
    .auth-banner {
        display: none;
    }
    .auth-form-container {
        max-width: 100%;
        background-color: #f8fafc;
    }
}

/* Premium Auth Box Styling */
.premium-auth-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2.25rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    width: 100%;
    margin-bottom: 2rem;
}

.auth-form-container {
    background-color: #f1f5f9;
}

/* Specific styling required by user */
.ecommerce-auth .btn-primary {
    background-color: #3451b2 !important; /* Brand Identity */
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(52, 81, 178, 0.2) !important;
    border-radius: 12px;
}
.ecommerce-auth .btn-primary:hover {
    background-color: #2a418e !important;
    box-shadow: 0 8px 25px rgba(52, 81, 178, 0.3) !important;
    transform: translateY(-1px);
}
.otp-digit {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    opacity: 1 !important;
}
