/* =========================================================
   INVESTIFY - NEO-FINTECH LUXURY THEME & PIN AUTH STYLES
   Dark Emerald & Obsidian Aesthetic (Inspired by Revolut & Thndr)
   ========================================================= */

:root {
    --fintech-bg: #070A12;
    --fintech-card: #0D1524;
    --fintech-card-glass: rgba(13, 21, 36, 0.85);
    --fintech-card-border: rgba(255, 255, 255, 0.08);
    --fintech-card-border-glow: rgba(16, 185, 129, 0.35);

    --fintech-emerald: #10B981;
    --fintech-emerald-glow: rgba(16, 185, 129, 0.5);
    --fintech-emerald-hover: #34D399;
    --fintech-emerald-subtle: rgba(16, 185, 129, 0.12);

    --fintech-gold: #F59E0B;
    --fintech-gold-glow: rgba(245, 158, 11, 0.4);

    --fintech-cyan: #06B6D4;
    --fintech-danger: #EF4444;

    --fintech-text-main: #F8FAFC;
    --fintech-text-muted: #94A3B8;
    --fintech-text-dim: #64748B;
}

/* =========================================================
   1. AUTH PAGE & LUXURY OBSIDIAN BACKGROUND
   ========================================================= */
body.fintech-auth-body {
    background-color: var(--fintech-bg);
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(245, 158, 11, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--fintech-text-main);
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.fintech-auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    z-index: 10;
}

.fintech-auth-card {
    background: var(--fintech-card-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--fintech-card-border);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.fintech-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fintech-emerald), transparent);
    box-shadow: 0 0 15px var(--fintech-emerald);
}

/* Brand header */
.fintech-brand-wrap {
    text-align: center;
    margin-bottom: 24px;
}

.fintech-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none;
    color: #FFF;
    margin-bottom: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.fintech-brand-badge:hover {
    transform: translateY(-2px);
    border-color: var(--fintech-emerald);
}

.fintech-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--fintech-emerald), #059669);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 14px;
    box-shadow: 0 0 12px var(--fintech-emerald-glow);
}

.fintech-brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFF 30%, #A7F3D0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fintech-auth-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #FFF;
    text-align: center;
}

.fintech-auth-subtitle {
    font-size: 14px;
    color: var(--fintech-text-muted);
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* =========================================================
   2. PIN KEYPAD & DOTS SCREEN
   ========================================================= */
.pin-screen-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: pinFadeIn 0.35s ease-out;
}

@keyframes pinFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pin-user-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 10px 18px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.pin-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--fintech-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.pin-user-meta {
    flex: 1;
    min-width: 0;
}

.pin-greeting {
    font-size: 15px;
    font-weight: 700;
    color: #FFF;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pin-user-email {
    font-size: 12px;
    color: var(--fintech-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}

.pin-instruction {
    font-size: 13px;
    color: var(--fintech-text-muted);
    margin: 0 0 16px 0;
    text-align: center;
}

/* Dots Display */
.pin-dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 8px 0;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.pin-dot.active {
    background: var(--fintech-emerald);
    border-color: var(--fintech-emerald);
    box-shadow: 0 0 16px var(--fintech-emerald-glow);
    transform: scale(1.15);
}

.pin-dot.verifying {
    animation: dotPulse 0.8s infinite ease-in-out;
}

.pin-dot.success {
    background: #10B981;
    border-color: #10B981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    transform: scale(1.2);
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 20px var(--fintech-emerald); }
}

/* Shake on error */
.pin-shake {
    animation: shakeError 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeError {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.pin-error-msg {
    min-height: 22px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fintech-danger);
    margin-bottom: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

/* Numeric Keypad Grid */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 310px;
    margin: 0 auto 20px auto;
}

.keypad-btn {
    aspect-ratio: 1;
    max-height: 64px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: #FFF;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Inter', 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.keypad-btn:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.4);
    color: #FFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.2);
}

.keypad-btn:active {
    transform: scale(0.92);
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--fintech-emerald);
}

.keypad-btn--aux {
    background: transparent;
    border-color: transparent;
    color: var(--fintech-text-muted);
    font-size: 17px;
    box-shadow: none;
}

.keypad-btn--aux:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #FFF;
    box-shadow: none;
}

.keypad-btn--backspace {
    background: transparent;
    border-color: transparent;
    color: var(--fintech-text-muted);
    font-size: 19px;
    box-shadow: none;
}

.keypad-btn--backspace:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--fintech-danger);
    box-shadow: none;
}

.pin-footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.btn-switch-auth {
    background: transparent;
    border: none;
    color: var(--fintech-emerald);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.btn-switch-auth:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--fintech-emerald-hover);
}

/* =========================================================
   3. FORM STYLES (MODERN FINTECH FORM)
   ========================================================= */
.fintech-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.fintech-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fintech-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fintech-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fintech-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fintech-input-icon {
    position: absolute;
    right: 14px;
    color: var(--fintech-text-dim);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.fintech-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 13px 44px 13px 16px;
    font-size: 14px;
    color: #FFF;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.fintech-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--fintech-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.fintech-input:focus + .fintech-input-icon,
.fintech-input-wrap:focus-within .fintech-input-icon {
    color: var(--fintech-emerald);
}

.fintech-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--fintech-emerald) 0%, #059669 100%);
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    color: #FFF;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px var(--fintech-emerald-glow);
    transition: all 0.2s ease;
    margin-top: 6px;
}

.fintech-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--fintech-emerald-hover) 0%, #10B981 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
    transform: translateY(-1px);
}

.fintech-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.fintech-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Demo account selector pills */
.demo-accounts-pillbox {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.demo-pills-title {
    font-size: 12px;
    color: var(--fintech-gold);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.demo-pills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.demo-pill-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #E2E8F0;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    padding: 6px 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.demo-pill-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--fintech-emerald);
    color: #FFF;
}

/* =========================================================
   4. PIN SETUP / CHANGE MODAL
   ========================================================= */
.pin-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalBackdropFade 0.25s ease-out;
}

@keyframes modalBackdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pin-modal-card {
    background: linear-gradient(145deg, #0D1524 0%, #080D18 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.8),
        0 0 35px rgba(16, 185, 129, 0.15);
    border-radius: 28px;
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    position: relative;
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.pin-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--fintech-emerald);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.pin-modal-card h3 {
    font-size: 20px;
    font-weight: 800;
    color: #FFF;
    margin: 0 0 8px 0;
}

.pin-modal-card p {
    font-size: 13px;
    color: var(--fintech-text-muted);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.pin-keypad--compact {
    max-width: 270px;
    gap: 10px;
    margin-bottom: 16px;
}

.pin-keypad--compact .keypad-btn {
    max-height: 54px;
    font-size: 20px;
    border-radius: 16px;
}

.setup-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.btn-skip-pin {
    background: transparent;
    border: none;
    color: var(--fintech-text-dim);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.btn-skip-pin:hover {
    color: var(--fintech-text-muted);
}

/* =========================================================
   5. TOPBAR PIN BUTTON IN DASHBOARDS
   ========================================================= */
.btn-topbar-pin {
    background: rgba(16, 185, 129, 0.12);
    color: var(--fintech-emerald);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-topbar-pin:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: var(--fintech-emerald);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}
