/* ═══════════════════════════════════════════════════════════════
   DeraRise — Design Tokens
   ═══════════════════════════════════════════════════════════════ */

:root {
    --clr-primary: #12756a;       /* Teal — from DeraRise logo */
    --clr-primary-light: #e6f2f0;
    --clr-primary-dark: #0d574f;
    --clr-accent: #f0bd2d;        /* Gold — from DeraRise logo */
    --clr-danger: #c0392b;
    --clr-warning: #e67e22;
    --clr-info: #2980b9;
    --clr-surface: #f8f9fa;
    --clr-border: #dee2e6;
    --clr-text: #212529;
    --clr-muted: #6c757d;
    --sidebar-width: 250px;
    --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-display);
    color: var(--clr-text);
    background: var(--clr-surface);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--clr-primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s;
}
.sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}
.sidebar-nav .nav-section {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.sidebar-nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--clr-accent);
}
.sidebar-nav a .icon {
    width: 18px;
    text-align: center;
    opacity: 0.8;
}
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}
.top-bar {
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}
.page-body {
    padding: 1.5rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--clr-border);
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--clr-primary);
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--clr-muted);
    margin-top: 0.15rem;
}
.card {
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    box-shadow: none;
}
.card-header {
    background: white;
    font-weight: 600;
    border-bottom: 1px solid var(--clr-border);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-muted);
    border-bottom-width: 1px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge-active { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-settled { background: #d1ecf1; color: #0c5460; }
.badge-disbursed { background: #e2e3ff; color: #383d6e; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
}
.btn-primary:hover {
    background: var(--clr-primary-dark);
    border-color: var(--clr-primary-dark);
}
.btn-outline-primary {
    color: var(--clr-primary);
    border-color: var(--clr-primary);
}
.btn-outline-primary:hover {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
}

/* ── Auth Pages (no sidebar) ─────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
}
.auth-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--clr-primary-dark);
    margin-bottom: 0.25rem;
}
.auth-card .subtitle {
    color: var(--clr-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ── Landing page ──────────────────────────────────────────────── */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 100%);
}
.landing-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.landing-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
    max-width: 980px;
}
.landing-hero {
    color: #fff;
    animation: landing-fade-up 0.8s ease both;
}
.landing-hero .welcome-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clr-accent);
    margin-bottom: 0.75rem;
}
.landing-hero h1 {
    font-size: 2.4rem;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.landing-hero h1 .brand-name {
    font-weight: 800;
    color: var(--clr-accent);
    position: relative;
}
.landing-hero h1 .brand-name::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 3px;
    width: 0;
    background: var(--clr-accent);
    border-radius: 2px;
    animation: landing-underline 1.2s ease 0.5s forwards;
}
.landing-hero p.lead-note {
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    max-width: 46ch;
}
.landing-hero .landing-points {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}
.landing-hero .landing-points li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.92);
}
.landing-hero .landing-points i {
    color: var(--clr-accent);
}
.landing-auth {
    animation: landing-fade-up 0.8s ease 0.15s both;
}
.landing-footer {
    flex: 0 0 auto;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    border-top: 1px solid rgba(255,255,255,0.15);
}
.landing-footer a {
    color: var(--clr-accent);
    text-decoration: none;
}
.landing-footer a:hover {
    text-decoration: underline;
}

@keyframes landing-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes landing-underline {
    to { width: 100%; }
}

@media (max-width: 768px) {
    .landing-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        max-width: 440px;
    }
    .landing-hero { text-align: center; }
    .landing-hero .landing-points li { justify-content: center; }
    .landing-hero h1 { font-size: 1.9rem; }
    .landing-hero p.lead-note { margin-left: auto; margin-right: auto; }
}

/* ── KYC Status Indicator ───────────────────────────────────── */
.kyc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
}
.kyc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.kyc-dot.verified { background: #28a745; }
.kyc-dot.pending { background: #ffc107; }
.kyc-dot.not-submitted { background: #dc3545; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block !important; }
}
.menu-toggle { display: none; }

/* Remove number input spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }


.icon-brand {
    color: var(--clr-primary);
}

/* ── Landing / login polish ─────────────────────────────────── */

.dr-fade-up {
    animation: drFadeUp .5s ease-out both;
}

.dr-delay-1 {
    animation-delay: .1s;
}

@keyframes drFadeUp {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dr-fade-up {
        animation: none;
    }
}

/* The card heading is an h2 now (the page keeps a single h1); match the old h1 look */

.auth-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--clr-primary-dark);
    margin-bottom: 0.25rem;
}

/* Tabs: equal width, brand colours */

.auth-card .nav-tabs .nav-item {
    flex: 1;
    text-align: center;
}

.auth-card .nav-tabs .nav-link {
    width: 100%;
    color: var(--clr-muted);
}

    .auth-card .nav-tabs .nav-link.active {
        color: var(--clr-primary-dark);
        font-weight: 600;
        border-bottom-color: white;
    }

/* Brand-coloured focus instead of Bootstrap blue (scoped to the auth card) */

.auth-card .form-control:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 .2rem rgba(18, 117, 106, .2);
}

.dr-field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.dr-password {
    position: relative;
}

    .dr-password .form-control {
        padding-right: 2.75rem;
    }

.dr-password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--clr-muted);
    padding: .4rem .6rem;
    line-height: 1;
}

    .dr-password-toggle:hover,
    .dr-password-toggle:focus-visible {
        color: var(--clr-primary);
    }

.dr-join {
    border: 1px dashed var(--clr-primary);
    background: var(--clr-primary-light);
    border-radius: 8px;
    padding: .85rem 1rem;
    text-align: center;
}

.dr-help {
    font-size: .8rem;
    color: var(--clr-muted);
    text-align: center;
}

/* On phones, keep the sign-in form near the top: drop the feature list */

@media (max-width: 767.98px) {
    .landing-points {
        display: none;
    }
}

.vr-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    animation: vr-pulse 1s infinite;
}

@keyframes vr-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }
}

.vr-meter {
    flex: 1;
    max-width: 160px;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bs-secondary-bg);
}

.vr-meter-fill {
    height: 100%;
    width: 0;
    background: #198754;
    transition: width .08s linear;
}

#selfieField,
#selfieCamera {
    min-width: 0;
    max-width: 100%;
}

.selfie-stage {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    isolation: isolate;
}

    .selfie-stage video,
    .selfie-stage canvas {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* Mirror preview */
        transform: scaleX(-1);
    }

.selfie-guide {
    position: absolute;
    inset: 10% 24%;
    pointer-events: none;
    border: 3px dashed rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}
 