@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0e17;
    --surface: #111827;
    --card: #1a2234;
    --border: #2a3548;
    --accent: #38bdf8;
    --accent-dim: #0ea5e9;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --danger: #f87171;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar: 260px;
}

html { font-size: 16px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.guest-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56,189,248,.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(14,165,233,.08), transparent),
        var(--bg);
}

a { color: inherit; text-decoration: none; }

/* ── Login layout ── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    width: 100%;
    max-width: 960px;
    align-items: center;
}

.brand-panel { text-align: center; }

.brand-panel .logo-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.brand-panel .logo-glow {
    position: absolute;
    inset: 0;
    transform: scale(1.5);
    border-radius: 50%;
    background: rgba(56,189,248,.1);
    filter: blur(40px);
}

.brand-panel h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.brand-panel h1 span { color: var(--accent); }

.brand-panel p {
    margin-top: .75rem;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 320px;
    margin-inline: auto;
    line-height: 1.6;
}

.tags { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

.tag {
    padding: .35rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(26,34,52,.5);
    font-size: .75rem;
    color: var(--muted);
}

/* ── Card / glass ── */
.card {
    background: rgba(26,34,52,.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(42,53,72,.8);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,.4);
}

.card-header { margin-bottom: 1.5rem; }
.card-header h2 { font-size: 1.5rem; font-weight: 600; }
.card-header p { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    margin-bottom: .5rem;
    font-size: .875rem;
    font-weight: 500;
    color: #cbd5e1;
}

.form-input {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(17,24,39,.8);
    color: var(--text);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-input::placeholder { color: #64748b; }

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--muted);
    cursor: pointer;
}

.form-check input { accent-color: var(--accent); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1rem;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: var(--bg);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(56,189,248,.25);
    transition: filter .2s, transform .1s;
}

.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(.98); }

.alert-error {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(248,113,113,.3);
    background: rgba(248,113,113,.1);
    color: #fca5a5;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}

.footer-text {
    margin-top: 2rem;
    text-align: center;
    font-size: .75rem;
    color: #64748b;
}

.mobile-brand { display: none; text-align: center; margin-bottom: 1.5rem; }
.mobile-brand h1 { font-size: 1.5rem; font-weight: 700; margin-top: .75rem; }
.mobile-brand h1 span { color: var(--accent); }

/* ── Dashboard layout ── */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: rgba(17,24,39,.92);
    backdrop-filter: blur(12px);
    z-index: 30;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-name { font-weight: 700; font-size: 1rem; }
.sidebar-brand .brand-name span { color: var(--accent); }
.sidebar-brand .brand-sub { font-size: .7rem; color: #64748b; }

.sidebar-nav { flex: 1; padding: 1rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    transition: background .15s, color .15s;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active { background: var(--card); color: var(--accent); }
.nav-link.danger { color: var(--danger); }
.nav-link.danger:hover { color: #fca5a5; }

.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border-radius: var(--radius);
    background: rgba(26,34,52,.6);
    margin-bottom: .75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(56,189,248,.2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-avatar.lg {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(56,189,248,.15);
}

.user-chip .user-name { font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .user-role { font-size: .7rem; color: #64748b; }

.main {
    margin-left: var(--sidebar);
    flex: 1;
    padding: 2rem;
}

.main-inner { max-width: 800px; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

/* ── Profile card ── */
.profile-card { overflow: hidden; }

.profile-banner {
    position: relative;
    padding: 2.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--card), var(--surface));
}

.profile-banner .banner-logo {
    position: absolute;
    right: 2rem;
    top: 2rem;
    opacity: .08;
}

.profile-info { display: flex; align-items: center; gap: 1.5rem; }

.profile-info h2 { font-size: 1.25rem; font-weight: 600; }
.profile-info .email { color: var(--muted); font-size: .9rem; margin-top: .15rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
    padding: .25rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(56,189,248,.3);
    background: rgba(56,189,248,.1);
    font-size: .75rem;
    font-weight: 500;
    color: var(--accent);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}

.detail-item {
    padding: 1.5rem 2rem;
    background: rgba(26,34,52,.4);
}

.detail-item .label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}

.detail-item .value {
    margin-top: .35rem;
    font-size: .875rem;
    font-weight: 500;
}

/* ── Admin placeholder ── */
.admin-placeholder { text-align: center; padding: 2rem; }
.admin-placeholder p { color: #cbd5e1; margin-top: 1rem; }
.admin-placeholder .sub { font-size: .875rem; color: var(--muted); margin-top: .5rem; }

/* ── Logo sizes ── */
.logo svg { display: block; }
.logo-sm svg { width: 40px; height: 40px; }
.logo-md svg { width: 64px; height: 64px; }
.logo-lg svg { width: 112px; height: 112px; }
.logo-xl svg { width: 144px; height: 144px; }

/* ── Wizard / Email setup ── */
.wizard-card { padding: 0; overflow: hidden; }

.wizard-progress {
    padding: 1.5rem 2rem 0;
    border-bottom: 1px solid var(--border);
    background: rgba(17,24,39,.4);
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 1rem;
}

.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    flex: 1;
    text-align: center;
    opacity: .45;
    transition: opacity .2s;
}

.wizard-step-indicator.active,
.wizard-step-indicator.completed { opacity: 1; }

.wizard-step-indicator .step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
    transition: border-color .2s, background .2s, color .2s;
}

.wizard-step-indicator.active .step-num {
    border-color: var(--accent);
    background: rgba(56,189,248,.15);
    color: var(--accent);
}

.wizard-step-indicator.completed .step-num {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.wizard-step-indicator .step-label {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 500;
}

.wizard-progress-bar {
    height: 3px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: -1px;
}

.wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dim));
    border-radius: 999px;
    transition: width .3s ease;
}

.wizard-step {
    display: none;
    padding: 2rem;
}

.wizard-step.active { display: block; }

.wizard-step-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.wizard-lead {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.wizard-hint {
    font-size: .8rem;
    color: #64748b;
    margin-top: 1rem;
}

.wizard-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(56,189,248,.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.wizard-icon svg { width: 28px; height: 28px; }
.wizard-icon.success { background: rgba(74,222,128,.12); color: #4ade80; }

.wizard-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.wizard-checklist li {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .875rem;
    color: #cbd5e1;
}

.wizard-checklist li::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
    font-size: .75rem;
}

.info-box {
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(56,189,248,.25);
    background: rgba(56,189,248,.06);
    margin-bottom: 1.5rem;
}

.info-box-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin-bottom: .5rem;
}

.info-box-hint {
    font-size: .8rem;
    color: var(--muted);
    margin-top: .5rem;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    background: rgba(17,24,39,.8);
    border: 1px solid var(--border);
}

.copy-field code {
    flex: 1;
    font-size: .85rem;
    color: var(--accent);
    word-break: break-all;
}

.btn-copy {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(56,189,248,.12);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.btn-copy svg { width: 16px; height: 16px; }
.btn-copy:hover { background: rgba(56,189,248,.22); }
.btn-copy.copied { background: rgba(74,222,128,.2); color: #4ade80; }

.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.bank-card { cursor: pointer; }

.bank-card input { position: absolute; opacity: 0; pointer-events: none; }

.bank-card-inner {
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: rgba(17,24,39,.5);
    transition: border-color .2s, background .2s;
    height: 100%;
}

.bank-card input:checked + .bank-card-inner {
    border-color: var(--accent);
    background: rgba(56,189,248,.08);
}

.bank-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .35rem;
}

.bank-name { font-size: 1.1rem; font-weight: 700; }

.bank-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}

.bank-check svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    color: var(--bg);
    transition: opacity .15s;
}

.bank-card input:checked + .bank-card-inner .bank-check {
    border-color: var(--accent);
    background: var(--accent);
}

.bank-card input:checked + .bank-card-inner .bank-check svg { opacity: 1; }

.bank-full-name {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .75rem;
}

.bank-sender {
    font-size: .75rem;
    font-family: monospace;
    color: #64748b;
    background: rgba(0,0,0,.2);
    padding: .2rem .5rem;
    border-radius: 4px;
}

.gmail-steps-global {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(17,24,39,.4);
}

.gmail-step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.gmail-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(56,189,248,.15);
    color: var(--accent);
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gmail-step-item strong {
    display: block;
    font-size: .875rem;
    margin-bottom: .25rem;
}

.gmail-step-item p {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.5;
}

.gmail-step-item a { color: var(--accent); text-decoration: underline; }
.gmail-step-item code { color: var(--accent); font-size: .8rem; }

.bank-instructions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bank-instruction-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(26,34,52,.5);
}

.bank-instruction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.bank-instruction-header h3 { font-size: 1rem; font-weight: 600; }

.filter-field { margin-bottom: 1rem; }

.filter-field-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin-bottom: .4rem;
}

.subject-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.filter-action {
    font-size: .8rem;
    color: #cbd5e1;
    line-height: 1.6;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

.wizard-step-center { text-align: center; max-width: 480px; margin-inline: auto; }

.confirm-box {
    text-align: left;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(17,24,39,.4);
    margin-top: 1rem;
}

.confirm-check { color: #cbd5e1; }

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(17,24,39,.3);
}

.wizard-actions .btn-primary,
.wizard-actions .btn-secondary { width: auto; min-width: 140px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: .875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.btn-secondary:hover { background: var(--card); color: var(--text); }

.alert-success {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(74,222,128,.3);
    background: rgba(74,222,128,.1);
    color: #86efac;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}

/* ── Mobile header & sidebar drawer ── */
.mobile-header {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .brand-panel { display: none; }
    .mobile-brand { display: block; }
    .login-grid { grid-template-columns: 1fr; max-width: 420px; }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(10, 14, 23, .65);
        backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .35s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        width: min(300px, 85vw);
        transform: translateX(-100%);
        transition: transform .4s cubic-bezier(.32, .72, 0, 1);
        box-shadow: none;
        z-index: 50;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, .45);
    }

    .main {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        position: sticky;
        top: 0;
        z-index: 20;
        padding: .85rem 1.25rem;
        border-bottom: 1px solid var(--border);
        background: rgba(17, 24, 39, .88);
        backdrop-filter: blur(12px);
    }

    .mobile-menu-toggle {
        position: relative;
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: rgba(56, 189, 248, .08);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background .3s ease, box-shadow .3s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
    }

    .mobile-menu-toggle .toggle-logo {
        position: relative;
        z-index: 1;
        display: flex;
        transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
    }

    .mobile-menu-toggle .toggle-ring {
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        border: 2px solid transparent;
        transition: border-color .3s ease, transform .4s ease, opacity .3s ease;
        opacity: 0;
    }

    .mobile-menu-toggle::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(56, 189, 248, .2), transparent 70%);
        opacity: 0;
        transition: opacity .3s ease;
    }

    .mobile-menu-toggle:hover::before,
    .mobile-menu-toggle.is-open::before {
        opacity: 1;
    }

    .mobile-menu-toggle:active {
        transform: scale(.9);
    }

    .mobile-menu-toggle.is-open {
        background: rgba(56, 189, 248, .16);
        box-shadow: 0 0 24px rgba(56, 189, 248, .2);
    }

    .mobile-menu-toggle.is-open .toggle-logo {
        transform: rotate(-8deg) scale(1.05);
    }

    .mobile-menu-toggle.is-open .toggle-ring {
        opacity: 1;
        border-color: rgba(56, 189, 248, .4);
        transform: scale(1.08);
        animation: walrus-pulse 2s ease-in-out infinite;
    }

    @keyframes walrus-pulse {
        0%, 100% { transform: scale(1.08); opacity: 1; }
        50% { transform: scale(1.14); opacity: .7; }
    }

    .mobile-header-brand {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .mobile-header-brand .brand-name {
        font-weight: 700;
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .mobile-header-brand .brand-name span { color: var(--accent); }

    .mobile-header-brand .brand-sub {
        font-size: .7rem;
        color: #64748b;
    }

    .main-inner {
        padding: 1.25rem;
    }

    .dashboard.sidebar-open .mobile-header {
        background: rgba(17, 24, 39, .95);
    }

    .profile-details { grid-template-columns: 1fr; }
    .profile-info { flex-direction: column; text-align: center; }
    .wizard-step-indicator .step-label { display: none; }
    .wizard-actions { flex-direction: column-reverse; }
    .wizard-actions .btn-primary,
    .wizard-actions .btn-secondary { width: 100%; }
}
