/* Stonebridge Trust Bank Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --sb-navy: #0c1e3d;
    --sb-navy-light: #132a52;
    --sb-blue: #2563eb;
    --sb-blue-light: #3b82f6;
    --sb-emerald: #10b981;
    --sb-emerald-dark: #059669;
    --sb-gold: #f59e0b;
    --sb-surface: #f8fafc;
    --sb-card: #ffffff;
    --sb-border: #e2e8f0;
    --sb-text: #0f172a;
    --sb-muted: #64748b;
    --sb-radius: 1rem;
    --sb-radius-lg: 1.25rem;
    --sb-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --sb-shadow-lg: 0 20px 40px -12px rgb(15 23 42 / 0.15);
    --sb-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Backgrounds */
.mesh-bg {
    background-color: var(--sb-surface);
    background-image:
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.06) 0, transparent 50%),
        radial-gradient(at 50% 100%, rgba(37, 99, 235, 0.05) 0, transparent 50%);
}

.hero-gradient {
    background: linear-gradient(135deg, var(--sb-navy) 0%, #1e3a8a 45%, var(--sb-blue) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 40%);
    pointer-events: none;
}

.auth-bg {
    background: linear-gradient(160deg, var(--sb-navy) 0%, #1e40af 60%, #2563eb 100%);
    min-height: 100vh;
    position: relative;
}

.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Navbar */
.sb-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: box-shadow var(--sb-transition), background var(--sb-transition);
}

.sb-nav.scrolled {
    box-shadow: var(--sb-shadow);
    background: rgba(255, 255, 255, 0.98);
}

.sb-nav-link {
    color: var(--sb-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--sb-transition);
    position: relative;
}

.sb-nav-link:hover, .sb-nav-link.active {
    color: var(--sb-blue);
}

.sb-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--sb-blue);
    border-radius: 2px;
}

/* Buttons */
.sb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--sb-transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.sb-btn-primary {
    background: linear-gradient(135deg, var(--sb-blue) 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.sb-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.sb-btn-accent {
    background: linear-gradient(135deg, var(--sb-emerald) 0%, var(--sb-emerald-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.sb-btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.sb-btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.sb-btn-outline:hover {
    background: white;
    color: var(--sb-navy);
    border-color: white;
}

.sb-btn-ghost {
    background: white;
    color: var(--sb-blue);
    border: 1.5px solid var(--sb-blue);
}

.sb-btn-ghost:hover {
    background: #eff6ff;
}

.sb-btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.sb-btn-block { width: 100%; }

.sb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Cards */
.sb-card {
    background: var(--sb-card);
    border-radius: var(--sb-radius-lg);
    border: 1px solid var(--sb-border);
    box-shadow: var(--sb-shadow);
    transition: transform var(--sb-transition), box-shadow var(--sb-transition);
}

.sb-card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--sb-shadow-lg);
}

.sb-card-glass {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--sb-radius-lg);
}

.sb-stat-card {
    padding: 1.5rem;
    border-radius: var(--sb-radius-lg);
    position: relative;
    overflow: hidden;
}

.sb-stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

/* Forms */
.sb-input-group { margin-bottom: 1.25rem; }

.sb-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sb-text);
    margin-bottom: 0.4rem;
}

.sb-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--sb-border);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--sb-transition), box-shadow var(--sb-transition);
    background: var(--sb-card);
    color: var(--sb-text);
}

.sb-input:focus {
    outline: none;
    border-color: var(--sb-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sb-input-icon-wrap {
    position: relative;
}

.sb-input-icon-wrap .sb-input { padding-left: 2.75rem; }

.sb-input-icon-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sb-muted);
    font-size: 0.9rem;
}

.sb-input-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sb-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
}

/* Alerts */
.sb-alert {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.sb-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.sb-alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.sb-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.sb-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* Badges */
.sb-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.sb-badge-pending { background: #fef3c7; color: #b45309; }
.sb-badge-completed { background: #d1fae5; color: #047857; }
.sb-badge-failed { background: #fee2e2; color: #b91c1c; }
.sb-badge-cancelled { background: #f1f5f9; color: #64748b; }
.sb-badge-active { background: #d1fae5; color: #047857; }

/* Section headers */
.sb-section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-blue);
    background: #eff6ff;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.sb-section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--sb-text);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes slideToast {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease forwards;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Toast */
.sb-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    max-width: 380px;
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    box-shadow: var(--sb-shadow-lg);
    animation: slideToast 0.35s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.sb-toast-success { background: white; border-left: 4px solid var(--sb-emerald); color: #047857; }
.sb-toast-error { background: white; border-left: 4px solid #ef4444; color: #b91c1c; }
.sb-toast-info { background: white; border-left: 4px solid var(--sb-blue); color: #1d4ed8; }

/* Stepper */
.sb-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.sb-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    position: relative;
}

.sb-step-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: #e2e8f0;
    color: var(--sb-muted);
    transition: all var(--sb-transition);
    z-index: 1;
}

.sb-step.active .sb-step-circle {
    background: var(--sb-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sb-step.done .sb-step-circle {
    background: var(--sb-emerald);
    color: white;
}

.sb-step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sb-muted);
    text-align: center;
}

.sb-step.active .sb-step-label { color: var(--sb-blue); }
.sb-step.done .sb-step-label { color: var(--sb-emerald-dark); }

.sb-step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin-top: -1.25rem;
    max-width: 60px;
}

.sb-step-line.done { background: var(--sb-emerald); }

/* Dashboard */
.dash-balance-card {
    background: linear-gradient(135deg, var(--sb-navy) 0%, #1e40af 50%, var(--sb-blue) 100%);
    color: white;
    padding: 1.75rem;
    border-radius: var(--sb-radius-lg);
    position: relative;
    overflow: hidden;
}

.dash-balance-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

/* Transaction table mobile */
@media (max-width: 768px) {
    .sb-table-mobile thead { display: none; }
    .sb-table-mobile tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 1px solid var(--sb-border);
        border-radius: var(--sb-radius);
        padding: 1rem;
    }
    .sb-table-mobile tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.35rem 0;
        border: none;
    }
    .sb-table-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--sb-muted);
        font-size: 0.8rem;
    }
}

/* Empty state */
.sb-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--sb-muted);
}

.sb-empty i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* Auth card */
.sb-auth-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.sb-auth-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--sb-blue);
}

/* Footer */
.sb-footer {
    background: var(--sb-navy);
    color: #94a3b8;
}

.sb-footer a:hover { color: white; }

/* Admin */
.admin-sidebar {
    background: linear-gradient(180deg, var(--sb-navy) 0%, #0f172a 100%);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--sb-transition);
    text-decoration: none;
}

.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: white; }

.admin-nav-link.active {
    background: linear-gradient(135deg, var(--sb-blue), #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.admin-stat {
    background: white;
    border-radius: var(--sb-radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--sb-border);
    transition: transform var(--sb-transition);
}

.admin-stat:hover { transform: translateY(-2px); }

/* Loading spinner */
.sb-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Code input special */
.sb-code-input {
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1rem;
    text-align: center;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Onboarding wizard */
.onboard-wrap { max-width: 820px; margin: 0 auto; }

.onboard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.onboard-progress::before {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.onboard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.onboard-step-dot {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.onboard-step-item.active .onboard-step-dot {
    border-color: var(--sb-blue);
    background: var(--sb-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.onboard-step-item.done .onboard-step-dot {
    border-color: var(--sb-emerald);
    background: var(--sb-emerald);
    color: white;
}

.onboard-step-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    max-width: 70px;
    line-height: 1.2;
}

.onboard-step-item.active .onboard-step-label { color: var(--sb-blue); }
.onboard-step-item.done .onboard-step-label { color: var(--sb-emerald-dark); }

@media (max-width: 640px) {
    .onboard-step-label { display: none; }
}

.account-type-card {
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.account-type-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.account-type-card.selected {
    border-color: var(--sb-blue);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.account-type-card input { display: none; }

.review-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.review-row:last-child { border-bottom: none; }
.review-label { color: #64748b; }
.review-value { font-weight: 600; text-align: right; max-width: 60%; }

.password-strength {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.onboard-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--sb-shadow-lg);
    border: 1px solid var(--sb-border);
}

.onboard-step-banner {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #dbeafe;
    border-radius: 0.85rem;
}

.onboard-step-count {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sb-blue);
    margin-bottom: 0.2rem;
}

.onboard-step-hint {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
}

.onboard-section { margin-bottom: 1rem; }
.onboard-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
}
.onboard-section-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.onboard-section-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1.5rem 0;
}

.country-picker-wrap .country-picker-search {
    margin-bottom: 0.5rem;
}
.country-picker-wrap select.country-select option[hidden],
.country-picker-wrap select.country-select optgroup[hidden] {
    display: none;
}

.app-status-track {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.app-status-step {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.app-status-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 1.1rem;
    top: 2.5rem;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.app-status-step.done:not(:last-child)::before { background: var(--sb-emerald); }
.app-status-step.active:not(:last-child)::before { background: linear-gradient(to bottom, var(--sb-emerald), #e2e8f0); }

.vc-status-active, .vc-status-frozen, .vc-status-pending, .vc-status-cancelled,
.irs-status-badge {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: capitalize;
}
.vc-status-active, .irs-status-success { background: #d1fae5; color: #047857; }
.vc-status-frozen { background: #dbeafe; color: #1d4ed8; }
.vc-status-pending, .irs-status-pending { background: #fef3c7; color: #b45309; }
.vc-status-cancelled, .irs-status-rejected { background: #fee2e2; color: #b91c1c; }

.admin-detail-field { padding: 0.75rem; background: #f8fafc; border-radius: 0.5rem; }
.admin-detail-label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.25rem; }
.admin-detail-value { font-weight: 600; color: #1e293b; word-break: break-word; }
