/* =========================================================
   PayIndia / GuruPay — Premium Authentication Styles
   Theme: Luxury Fintech / Emerald & Brass Ledger
   ========================================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Brand Colors */
    --paper: #FAF7F0;
    --paper-line: #E8DFC8;
    --paper-card: #FFFFFF;
    --ink: #143026;
    --ink-light: #1E4638;
    --ink-soft: #3D5A4E;
    --ink-muted: #6B877B;
    --ink-grad: linear-gradient(135deg, #143026 0%, #224E3E 100%);
    
    /* Brass & Gold Accents */
    --brass: #B8862E;
    --brass-light: #F2D88C;
    --brass-dark: #8C651C;
    --brass-glow: rgba(184, 134, 46, 0.22);
    
    /* Functional Colors */
    --mint: #1E7E5A;
    --mint-light: #E8F5EF;
    --stamp-red: #A23B2E;
    --danger-light: #FDF2F2;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    
    /* Surfaces & Borders */
    --card: #FFFFFF;
    --card-surface: #FCFAF5;
    --border: #E8E0CD;
    --border-hover: #D1C5AA;
    --border-focus: #143026;
    --muted: #847C68;
    
    /* Typography */
    --font-serif: 'Fraunces', serif;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    /* Geometry & Elevations */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(20, 48, 38, 0.04);
    --shadow-md: 0 8px 24px rgba(20, 48, 38, 0.08);
    --shadow-lg: 0 20px 48px -10px rgba(20, 48, 38, 0.12), 0 0 1px 1px rgba(184, 134, 46, 0.12);
    --shadow-xl: 0 28px 64px -12px rgba(20, 48, 38, 0.18);
    --transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);

    /* Legacy Backward Compatibility */
    --pi-primary: var(--brass);
    --pi-primary-dark: var(--brass-dark);
    --pi-dark: var(--ink);
    --pi-dark-alt: var(--ink-light);
    --pi-light: var(--paper);
    --pi-success: var(--mint);
    --pi-warning: var(--warning);
    --pi-danger: var(--stamp-red);
}

/* ---------- Global Reset & Body ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body.auth-page {
    font-family: var(--font-sans);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: var(--paper);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(184, 134, 46, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(20, 48, 38, 0.07) 0%, transparent 45%),
        repeating-linear-gradient(180deg, transparent, transparent 37px, var(--paper-line) 38px);
    color: var(--ink);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ---------- Top Navigation Bar ---------- */
.auth-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    pointer-events: none;
}

.auth-back-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.auth-back-btn:hover {
    background: #FFFFFF;
    color: var(--ink);
    border-color: var(--brass);
    transform: translateX(-3px);
    box-shadow: var(--shadow-md);
}

.auth-top-badge {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

/* ---------- Ambient Glow Orbs ---------- */
.auth-wrapper::before {
    content: '';
    position: fixed;
    width: 480px;
    height: 480px;
    top: -140px;
    right: -100px;
    background: radial-gradient(circle, rgba(232, 200, 116, 0.18) 0%, rgba(184, 134, 46, 0.04) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper::after {
    content: '';
    position: fixed;
    width: 460px;
    height: 460px;
    bottom: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(30, 78, 62, 0.12) 0%, rgba(20, 48, 38, 0.03) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Auth Wrapper & Main Card ---------- */
.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 470px;
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 42px 38px 34px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: authCardEnter 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--border-hover);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -1.5px;
    left: 36px;
    right: 36px;
    height: 3.5px;
    background: linear-gradient(90deg, transparent, var(--brass), var(--brass-light), var(--brass), transparent);
    border-radius: 3px 3px 0 0;
}

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

/* ---------- Brand Section ---------- */
.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-emblem-wrap {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--brass-light) 0%, var(--brass) 100%);
    box-shadow: 0 6px 18px rgba(184, 134, 46, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.brand-emblem-wrap:hover {
    transform: scale(1.06) rotate(3deg);
    box-shadow: 0 10px 26px rgba(184, 134, 46, 0.38);
}

.brand-upi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    padding: 10px 24px;
    border-radius: 14px;
    border: 1.5px solid rgba(184, 134, 46, 0.4);
    box-shadow: 0 8px 24px rgba(184, 134, 46, 0.16);
    margin: 0 auto 16px;
    transition: var(--transition);
}

.brand-upi-badge:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 28px rgba(184, 134, 46, 0.28);
    border-color: var(--brass);
}

.brand-upi-img {
    height: 38px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.upi-settlement-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(30, 126, 90, 0.1);
    border: 1px solid rgba(30, 126, 90, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.2px;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #FFFFFF;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
}

.brand-icon,
.brand-icon-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brass-light);
}

.brand-icon i,
.brand-icon svg,
.brand-icon-fallback i,
.brand-icon-fallback svg {
    width: 28px;
    height: 28px;
    color: var(--brass-light);
}

.auth-brand h1 {
    font-family: var(--font-serif);
    font-size: 27px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.6px;
    margin-bottom: 6px;
    line-height: 1.25;
}

.auth-brand h1 span {
    color: var(--brass-dark);
    font-style: italic;
}

.auth-brand p {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin: 0;
    font-weight: 400;
}

/* ---------- Alerts ---------- */
.auth-alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlideIn 0.3s ease;
}

.auth-alert.alert-danger {
    background: var(--danger-light);
    border: 1px solid #F8B4B4;
    color: var(--stamp-red);
}

.auth-alert.alert-success {
    background: var(--mint-light);
    border: 1px solid #A3E0C8;
    color: var(--mint);
}

.auth-alert.alert-warning {
    background: var(--warning-light);
    border: 1px solid #FDE68A;
    color: var(--warning);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Form Controls & Labels ---------- */
.auth-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.auth-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-form .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.auth-form .input-icon i,
.auth-form .input-icon svg {
    width: 17px;
    height: 17px;
}

.auth-form .form-control {
    width: 100%;
    height: 48px;
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px 0 44px;
    font-size: 14px;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--ink);
    transition: var(--transition);
    outline: none;
    box-shadow: none;
}

.auth-form .form-control::placeholder {
    color: #A39E8C;
    font-weight: 400;
}

.auth-form .form-control:focus {
    border-color: var(--ink);
    background: #FFFFFF;
    box-shadow: 0 0 0 3.5px rgba(20, 48, 38, 0.08);
}

.auth-form .form-control:focus ~ .input-icon,
.auth-form .form-control:focus + .input-icon {
    color: var(--brass-dark);
}

/* Mobile Input with +91 Prefix */
.mobile-prefix {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    z-index: 3;
    pointer-events: none;
    padding-right: 8px;
    border-right: 1.5px solid var(--border);
    line-height: 1.2;
    font-family: var(--font-mono);
}

.form-control.with-prefix {
    padding-left: 88px !important;
    letter-spacing: 0.8px;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 3;
    color: var(--ink-soft);
    opacity: 0.6;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--ink);
    background: rgba(20, 48, 38, 0.05);
}

.password-toggle i,
.password-toggle svg {
    width: 17px;
    height: 17px;
}

/* Validation Errors */
.field-error {
    font-size: 12px;
    color: var(--stamp-red);
    margin-top: 5px;
    font-weight: 500;
    display: none;
    animation: alertSlideIn 0.2s ease;
}

.field-error.show {
    display: block;
}

.form-control.is-invalid {
    border-color: var(--stamp-red) !important;
    background-color: #FFF9F9 !important;
    box-shadow: 0 0 0 3px rgba(162, 59, 46, 0.1) !important;
}

.form-control.is-valid {
    border-color: var(--mint) !important;
    box-shadow: 0 0 0 3px rgba(30, 126, 90, 0.08) !important;
}

/* ---------- Checkbox & Forgot Password ---------- */
.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 0;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--border-hover);
    accent-color: var(--ink);
    cursor: pointer;
}

.forgot-link {
    color: var(--brass-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* ---------- Action Buttons ---------- */
.btn-ink,
.btn-auth-primary {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #143026 0%, #224E3E 100%);
    color: var(--brass-light) !important;
    border: 1px solid rgba(242, 216, 140, 0.35) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(20, 48, 38, 0.18);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-ink::after,
.btn-auth-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-ink:hover,
.btn-auth-primary:hover {
    background: linear-gradient(135deg, #0d221b 0%, #193d30 100%);
    color: #FFFFFF !important;
    transform: translateY(-1.5px);
    box-shadow: 0 8px 24px rgba(20, 48, 38, 0.28);
    border-color: var(--brass-light) !important;
}

.btn-ink:hover::after,
.btn-auth-primary:hover::after {
    transform: translateX(100%);
}

.btn-ink:active,
.btn-auth-primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(20, 48, 38, 0.2);
}

.btn-ink.loading,
.btn-auth-primary.loading {
    opacity: 0.85;
    pointer-events: none;
}

/* Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(242, 216, 140, 0.3);
    border-top-color: var(--brass-light);
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    display: none;
}

.loading .btn-spinner {
    display: inline-block;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ---------- Divider ---------- */
.auth-divider {
    border-top: 1px dashed var(--border) !important;
    margin: 22px 0 18px;
    position: relative;
    text-align: center;
}

.auth-divider span {
    position: relative;
    top: -10px;
    background: #FFFFFF;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.3px;
}

/* ---------- Auth Footer ---------- */
.auth-footer {
    text-align: center;
}

.auth-footer p {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin: 0;
}

.auth-footer a {
    color: var(--brass-dark);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* ---------- Feature Tags ---------- */
.auth-features {
    border-top: 1px dotted var(--border) !important;
    margin-top: 22px;
    padding-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.feature-tag {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--card-surface);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.feature-tag:hover {
    background: #FFFFFF;
    border-color: var(--brass);
    color: var(--ink);
}

.feature-tag i,
.feature-tag svg {
    width: 13px;
    height: 13px;
}

/* ---------- Secure Badge ---------- */
.secure-badge {
    margin-top: 14px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.secure-badge i,
.secure-badge svg {
    width: 12px;
    height: 12px;
    color: var(--mint);
}

/* ---------- Step Indicator (Forgot Password / Multi-step) ---------- */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card-surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: var(--transition);
}

.step-dot.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--brass-light);
    box-shadow: 0 0 0 3px rgba(20, 48, 38, 0.12);
}

.step-dot.completed {
    background: var(--mint);
    border-color: var(--mint);
    color: #FFFFFF;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    transition: var(--transition);
}

.step-connector.filled {
    background: var(--mint);
}

.step-section {
    display: none;
}

.step-section.active {
    display: block;
    animation: alertSlideIn 0.3s ease;
}

/* ---------- Password Strength Indicator ---------- */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.35s ease, background 0.35s ease;
}

.strength-bar-fill.strength-weak {
    width: 25%;
    background: var(--stamp-red);
}

.strength-bar-fill.strength-fair {
    width: 50%;
    background: var(--brass);
}

.strength-bar-fill.strength-good {
    width: 75%;
    background: #3B82F6;
}

.strength-bar-fill.strength-strong {
    width: 100%;
    background: var(--mint);
}

.strength-text {
    font-size: 11.5px;
    font-weight: 500;
    transition: var(--transition);
}

.strength-text.text-weak { color: var(--stamp-red); }
.strength-text.text-fair { color: var(--brass-dark); }
.strength-text.text-good { color: #3B82F6; }
.strength-text.text-strong { color: var(--mint); }

/* ---------- OTP Input Boxes ---------- */
.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.otp-input-group input {
    width: 48px;
    height: 56px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 22px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--ink);
    background: #FFFFFF;
    transition: var(--transition);
    outline: none;
}

.otp-input-group input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3.5px rgba(20, 48, 38, 0.08);
}

.otp-timer {
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-top: 10px;
    font-family: var(--font-mono);
}

.resend-btn {
    color: var(--brass-dark);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 12.5px;
    padding: 0;
}

/* ---------- Particles (Subtle) ---------- */
.particles-container {
    display: none;
}

/* ---------- SweetAlert2 Theme Overrides ---------- */
.swal2-popup {
    font-family: var(--font-sans) !important;
    border-radius: 16px !important;
    background: #FFFFFF !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: var(--shadow-xl) !important;
    color: var(--ink) !important;
}

.swal2-title {
    font-family: var(--font-serif) !important;
    color: var(--ink) !important;
    font-weight: 700 !important;
}

.swal2-html-container {
    color: var(--ink-soft) !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #143026 0%, #224E3E 100%) !important;
    color: var(--brass-light) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    border: 1px solid rgba(242, 216, 140, 0.3) !important;
    box-shadow: 0 4px 12px rgba(20, 48, 38, 0.2) !important;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 576px) {
    .auth-topbar {
        padding: 12px 16px;
    }

    .auth-wrapper {
        padding: 60px 16px 30px;
    }

    .auth-card {
        padding: 32px 22px 26px;
        border-radius: 16px;
    }

    .auth-brand h1 {
        font-size: 23px;
    }

    .brand-emblem-wrap {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }

    .auth-form .form-control {
        height: 46px;
        font-size: 13.5px;
    }

    .btn-ink,
    .btn-auth-primary {
        height: 46px;
        font-size: 14px;
    }

    .auth-features {
        gap: 8px;
    }

    .feature-tag {
        font-size: 10.5px;
        padding: 4px 8px;
    }
}
