﻿/* ==========================================================================
   D-NOTIFY: Executive Design System v2.0
   Design: Corporate, Interactive, Creative
   Updated with EXECUTIVE PREMIUM UPGRADE LAYER (Authority, Stability, Intelligence)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* --- Core Palette (Executive Blue & Slate - Preserved base, Overridden by Executive Greens below) --- */
    --brand-primary: #0f766e;
    /* Updated to Executive Green */
    --brand-primary-rgb: 15, 118, 110;
    --brand-dark: #0f172a;
    --brand-dark-rgb: 15, 23, 42;
    --brand-light: #f8fafc;

    /* --- Accents --- */
    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --accent-slate: #64748b;
    --status-success: #10b981;
    --status-warning: #f59e0b;

    /* --- Surfaces --- */
    --bg-main: #f8fafc;
    --glass-bg: rgba(15, 23, 42, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #ffffff;

    /* --- Typography --- */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* --- Effects --- */
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* --------------------------------------------------------------------------
       Next-Level Executive Color System (Additive - From Upgrade Layer)
       -------------------------------------------------------------------------- */
    /* Executive Greens & Teals (Calm, Official) */
    --exec-green: #0f766e;
    --exec-green-soft: rgba(15, 118, 110, 0.12);
    --exec-teal-glow: rgba(20, 184, 166, 0.35);

    /* Neutral Authority Scale */
    --surface-soft: #f9fbfa;
    --surface-elevated: #ffffff;
    --surface-inset: #f1f5f4;

    /* Borders & Separators */
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);

    /* Shadows â€“ Atmospheric, Layered */
    --shadow-level-1: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-level-2: 0 8px 24px rgba(15, 23, 42, 0.10);
    --shadow-level-3: 0 18px 48px rgba(15, 23, 42, 0.18);
    --shadow-premium: var(--shadow-level-2);
    /* Mapping original premium shadow to new level */

    /* Motion Timing */
    --ease-exec: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    --bg-main: #020617;
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(30, 41, 59, 0.5);
    --card-bg: #0f172a;
    --text-primary: #f8fafc;
    --brand-dark: #f8fafc;

    /* Dark Mode Overrides for Upgrade Layer */
    --surface-soft: #0f172a;
    --surface-elevated: #1e293b;
    --surface-inset: #020617;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --exec-green: #14b8a6;
    /* Brighter teal for dark mode */
}

/* ==========================================================================
   Global Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--brand-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subtle animated gradient layer */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 118, 110, 0.35));
    mix-blend-mode: soft-light;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

/* Optional: faint grid overlay for tech feel */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

#particles-js {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.radial-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(circle at 80% 100%, rgba(129, 140, 248, 0.18), transparent 55%),
        radial-gradient(circle at 50% 50%, rgba(var(--brand-primary-rgb), 0.08), transparent 70%);
    z-index: 2;
    pointer-events: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.viewport {
    position: relative;
    z-index: 10;
    width: 95vw;
    max-width: 1200px;
    height: 95vh;
    max-height: 850px;
    background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.12), transparent 55%),
        var(--glass-bg);
    backdrop-filter: blur(24px) saturate(130%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 28px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.4),
        0 24px 80px rgba(15, 23, 42, 0.65);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: viewport-in 0.9s var(--ease-exec);
}

/* Add a subtle inner border glow */
.viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(45, 212, 191, 0.25);
    mix-blend-mode: screen;
    pointer-events: none;
}

@keyframes viewport-in {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.top-bar {
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.85), rgba(16, 185, 129, 0.6));
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img,
.logo video {
    height: 72px;
    width: 72px;
    border-radius: 999px;
    /* fully rounded */
    object-fit: cover;
    border: 2px solid rgba(45, 212, 191, 0.9);
    /* teal border */
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 0 18px rgba(45, 212, 191, 0.8),
        0 0 32px rgba(37, 99, 235, 0.6);
    background: radial-gradient(circle at 30% 0%, rgba(45, 212, 191, 0.35), transparent 60%);
}


.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.18em;
    color: #e5f9f6;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(45, 212, 191, 0.6);
}

/* Status badge more â€œconsoleâ€ like */
.status-badge {
    padding: 0.45rem 1.4rem;
    background: radial-gradient(circle at 0 0, rgba(45, 212, 191, 0.35), transparent 60%),
        rgba(15, 23, 42, 0.95);
    color: #e5f9f6;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    display: center;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid rgba(45, 212, 191, 0.4);
}

.status-pulse {
    width: 10px;
    height: 10px;
    background: var(--status-success);
    border-radius: 50%;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================================================
   Scenes
   ========================================================================== */
.content-stack {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-primary) transparent;
}

.content-stack::-webkit-scrollbar {
    width: 6px;
}

.content-stack::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 10px;
}

.scene {
    position: absolute;
    inset: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    /* Enable scrolling on the scene itself */
    opacity: 0;
    visibility: hidden;
    transform-origin: center;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-primary) transparent;
}

.scene::-webkit-scrollbar {
    width: 6px;
}

.scene::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 10px;
}

/* Ensure content starts from top if it overflows flex center */
.scene::after,
.scene::before {
    content: '';
    margin: auto;
}

/* Optional subtle border around active scene */
.scene.active {
    opacity: 1;
    visibility: visible;
}

.scene-blur {
    filter: blur(12px) saturate(80%);
}

.display-heading {
    font-family: var(--font-heading);
    font-size: 3.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    line-height: 1.05;
    background: conic-gradient(from 180deg,
            #e5e7eb,
            #22c55e,
            #0ea5e9,
            #6366f1,
            #e5e7eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.35));
}

.scene-description {
    font-size: 1.1rem;
    color: #cbd5f5;
    max-width: 640px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Buttons â€“ Decisive & Authoritative (Updated from Upgrade Layer) */
.btn {
    padding: 1rem 2.5rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e, #0ea5e9, #6366f1);
    background-size: 200% 200%;
    color: white;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 14px 40px rgba(37, 99, 235, 0.55);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent 60%);
    opacity: 0;
    transform: translateX(-40%);
    transition: opacity 0.4s var(--ease-exec), transform 0.4s var(--ease-exec);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 0 0 1px rgba(45, 212, 191, 0.6),
        0 18px 50px rgba(37, 99, 235, 0.75);
    background-position: 100% 0;
}

.btn-primary:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.btn-secondary {
    background: radial-gradient(circle at 0 0, rgba(148, 163, 184, 0.25), transparent 60%),
        rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

/* ==========================================================================
   Premium Cards (Avatar / Type) - Card Refinement â€“ Executive Depth
   ========================================================================== */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.avatar-card,
.type-card {
    /* Executive Depth Upgrades */
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.85), rgba(74, 222, 128, 0.6));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 3rem 1.5rem;
    transition: all var(--transition-base);
    cursor: pointer;
    text-align: center;
    opacity: 1 !important;
    /* Override GSAP if it stalls */
    box-shadow: var(--shadow-level-1), var(--shadow-level-2);
}

.avatar-card:hover,
.type-card:hover {
    box-shadow: var(--shadow-level-2), var(--shadow-level-3);
    transform: translateY(-6px);
    border-color: var(--brand-primary);
}

.avatar-card.active,
.type-card.active {
    background: var(--brand-primary);
    color: white;
    /* Fallback */
    /* If card turns green, text inside needs contrast handling usually, 
       but user CSS provided active state overrides in previous version.
       We keep basic active distinctiveness. */
}

.avatar-image {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    border: 5px solid white;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    background: var(--brand-light);
}

.avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Narrative */
.narrative-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.guide-image-container {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1;
    border-radius: var(--radius-2xl);
    border: 5px solid white;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: var(--brand-light);
    margin: 0 auto;
}

.guide-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.speech-bubble {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.98));
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-level-1), var(--shadow-level-2);
    border: 1px solid var(--border-subtle);
    text-align: left;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Executive Forms (High Authority) - Mission-Critical Calm
   ========================================================================== */
.form-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    min-height: 520px;

    /* New Executive Styles */
    background: var(--surface-soft);
    border-radius: var(--radius-xl);
    padding: 3rem 3rem;
    /* Gradient overlay via pseudo-element handled below */
    box-shadow: var(--shadow-level-1), var(--shadow-level-2);
    border: 1px solid var(--border-subtle);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 550px;
    scrollbar-gutter: stable;
    /* Prevent content pushing against edges */
    padding: 3rem 2.5rem;
}

.form-container::before {
    display: none;
}

.form-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--brand-dark);
    transform: translateY(0);
}

.form-level {
    display: none !important;
    opacity: 0;
    pointer-events: none;
    animation: formLevelFadeIn 0.4s ease-out forwards;
    width: 100%;
    max-width: 100%;
}

.form-level.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto;
}

@keyframes formLevelFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Label System (Enterprise Style) */
.field {
    position: relative;
    margin-bottom: 2rem;
}

/* Unified Input Styles */
input,
select,
textarea {
    width: 100%;
    padding: 1.15rem 1rem 1.15rem 3.5rem;
    /* Copied from previous, preserving icon space */
    border-radius: 0.75rem;
    background: var(--surface-inset);
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
}

/* removed empty ruleset */

.field label {
    position: absolute;
    left: 3.5rem;
    /* Aligned with text start after icon */
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--accent-slate);
    pointer-events: none;
    transition: all 0.25s var(--ease-exec);
    background: linear-gradient(180deg, transparent 40%, var(--surface-soft) 40%);
    padding: 0 0.25rem;
}

/* Floating Label Activation */
.field input:focus+label,
.field input:not(:placeholder-shown)+label {
    top: -0.55rem;
    font-size: 0.7rem;
    color: var(--exec-green);
    transform: translateY(0);
    /* Reset transform as top is set */
}

/* Focus Intelligence */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: var(--surface-elevated);
    border-color: var(--exec-green);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15), var(--shadow-level-1);
    transform: translateY(-1px);
}

.input-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    /* Centered vertically */
    transform: translateY(-50%);
    color: var(--accent-slate);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 2;
}

/* Validation & AI Hint Language */
.ai-hint {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: var(--exec-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-hint::before {
    content: 'AI';
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(15, 118, 110, 0.15);
    color: var(--exec-green);
}

.validation-success {
    color: var(--status-success);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    animation: fade-in 0.4s ease-out;
}

.validation-warning {
    color: var(--status-warning);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.validation-error {
    color: #b91c1c;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* Verification Banner */
.verification-banner {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(15, 23, 42, 0.9);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.gauge-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.gauge-circle-fill {
    fill: none;
    /* Added a fallback color (e.g., #4ade80) after the variable */
    stroke: var(--exec-green, #4ade80);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease, stroke 0.5s ease;
}

.gauge-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.banner-info h4 {
    color: #fff;
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

.banner-info p {
    color: var(--accent-slate);
    font-size: 0.9rem;
    margin: 0;
}

/* Face Verification Success */
/* Steps Indicator */
.form-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.f-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-light);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all var(--transition-base);
}

.f-step.active {
    color: white;
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 0 10px rgba(var(--brand-primary-rgb), 0.2);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--glass-border);
}

/* Registration Classification */
.type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.type-card.active {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), 0.02);
}

.type-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--brand-primary);
}

.type-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.type-description {
    font-size: 0.85rem;
    color: var(--accent-slate);
}

/* Document Scan */
.upload-section {
    margin: 2rem 0;
    text-align: left;
}

.upload-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.upload-zone {
    margin: 1.5rem 0;
}

.upload-zone input[type="file"] {
    display: none;
}

.btn-upload {
    width: 100%;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--brand-light);
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-upload:hover {
    border-color: var(--brand-primary);
    background: white;
}

.btn-upload i {
    font-size: 2rem;
    color: var(--brand-primary);
}

.preview-box {
    width: 100%;
    max-width: 400px;
    height: 100%;
    min-height: 400px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin: 0;
    overflow: hidden;
    position: relative;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#id-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Biometric Integration */
.biometric-sync {
    background: var(--brand-dark);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 0;
    text-align: center;
}

.camera-container {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: var(--radius-lg);
    margin: 1.5rem auto;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--accent-cyan);
}

#webcam {
    width: 100%;
    max-width: 640px;
    height: auto;
    background: #000;
}

#output-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background: transparent;
}

.scan-line {
    position: absolute;
    top: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: scan 4s linear infinite;
}

@keyframes scan {
    from {
        top: 0;
    }

    to {
        top: 100%;
    }
}

.biometric-status {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Data Entry Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.form-row {
    display: contents;
}

.full-width {
    grid-column: span 2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    position: relative;
    min-width: 0;
    width: 100%;
}

/* Navigation & Global */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
}

.btn-full {
    width: 100%;
    margin-top: 2rem;
}

.progress-bar {
    height: 6px;
    background: var(--glass-border);
    margin-top: auto;
}

.progress-fill {
    height: 100%;
    background: var(--brand-primary);
    width: 0%;
}

.verification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin: 1.5rem 0;
}

.submit-section {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    grid-column: span 2;
    margin-top: 2.5rem;
    width: 100%;
}

.submit-section .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .viewport {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .avatar-grid,
    .form-grid,
    .type-selector,
    .verification-grid {
        grid-template-columns: 1fr;
    }

    .narrative-layout {
        grid-template-columns: 1fr;
    }

    .full-width,
    .form-row {
        grid-column: auto;
    }
}

/* AI Console / FAB â€“ Command Presence (Upgrade Layer) */
.secure-access-pill {
    /* position should not be 'flex' */
    position: relative;
    right: 0;
    /* let flex layout handle placement in .top-bar */
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 24px;
    /* Brighter teal/green gradient */
    background: linear-gradient(135deg,
            rgba(45, 212, 191, 0.95),
            rgba(34, 197, 94, 0.95));
    border: 1px solid rgba(240, 253, 250, 0.8);
    border-radius: 60px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: #022c22;
    /* dark teal text for contrast */
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 0 0 1px rgba(16, 185, 129, 0.4),
        0 8px 24px rgba(16, 185, 129, 0.45);
}

.secure-access-pill:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 0 0 1px rgba(240, 253, 250, 0.9),
        0 12px 32px rgba(16, 185, 129, 0.7);
}


.secure-access-pill:hover {
    transform: translateY(-3px) scale(1.04);
    color: white;
    border-color: #4f9cff;
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.35);
    background: rgba(30, 41, 68, 0.8);
}

.secure-access-pill:active {
    transform: scale(0.96);
}

.pill-glow {
    position: absolute;
    inset: -2px;
    border-radius: 60px;
    background: linear-gradient(45deg, transparent, #2563eb80, transparent);
    opacity: 0.6;
    filter: blur(8px);
    z-index: -1;
}

.pill-pulse {
    width: 8px;
    height: 8px;
    background: #4f9cff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(79, 156, 255, 0.7);
    animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 156, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(79, 156, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 156, 255, 0);
    }
}

/* Avatar Talking Animation */
@keyframes pulse-talk {
    0% {
        filter: drop-shadow(0 0 5px rgba(37, 99, 235, 0.5));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.9));
        transform: scale(1.02);
    }

    100% {
        filter: drop-shadow(0 0 5px rgba(37, 99, 235, 0.5));
        transform: scale(1);
    }
}

.avatar-talking {
    animation: pulse-talk 0.3s infinite ease-in-out;
}

/* Motion â€“ Purposeful Only (Upgrade Layer) */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes soft-glow {
    0% {
        box-shadow: 0 0 0 rgba(20, 184, 166, 0.0);
    }

    100% {
        box-shadow: 0 0 18px rgba(20, 184, 166, 0.35);
    }
}

/* Accessibility Focus */
:focus-visible {
    outline: 2px solid var(--exec-green);
    outline-offset: 3px;
}

/* ==========================================================================
   Authentication Internal (Gateway)
   ========================================================================== */
.auth-wrapper {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    animation: viewport-in 1s var(--transition-base);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-video {
    width: 40%;
    height: 40%;
    /* â† consider using aspect-ratio instead if possible */
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);

    /* Centering magic */
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.auth-video video {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    /* Transparent Light */
    padding: 4px;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-subtle);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-lg);
    font-weight: 600;
    color: var(--accent-slate);
    transition: var(--transition-base);
}

.auth-tab.active {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
    /* Executive Teal Shadow */
}

.pass-toggle-btn {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-slate);
    cursor: pointer;
    z-index: 10;
}

/* AI Chatbot & Neural Modal */
.chatbot-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 24px rgba(20, 184, 166, 0.4);
}

.launcher-glow {
    position: absolute;
    inset: -5px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.4), transparent 70%);
    animation: pulse-glow 2s infinite;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.launcher-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chat-slide-up 0.4s ease;
}

@keyframes chat-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-status-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.header-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #94a3b8;
}

.chat-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg {
    max-width: 80%;
}

.bot-msg {
    align-self: flex-start;
}

.user-msg {
    align-self: flex-end;
}

.msg-content {
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.bot-msg .msg-content {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.user-msg .msg-content {
    background: var(--brand-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-options {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-options button {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #14b8a6;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.chat-options button:hover {
    background: rgba(20, 184, 166, 0.2);
}

.chat-input-area {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
}

.chat-input-area button {
    background: var(--brand-primary);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
}

/* Neural Modal */
.neural-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
}

.modal-glass {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 24px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(20, 184, 166, 0.2);
    overflow: hidden;
    animation: modal-pop 0.3s var(--ease-exec);
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 14px;
    letter-spacing: 2px;
    color: #14b8a6;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    font-size: 15px;
    color: #f1f5f9;
}

.detail-value.editable input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    width: 100%;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    from {
        opacity: 0.3;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Randomized Keypad Security Styles */
.keypad-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(15px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.keypad-content {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.keypad-title {
    color: #14b8a6;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.keypad-subtitle {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 25px;
}

.passcode-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.digit-box {
    width: 35px;
    height: 45px;
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    font-family: var(--font-mono);
}

.digit-box.filled::after {
    content: '*';
    color: #14b8a6;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.key-btn {
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.key-btn:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: #14b8a6;
    transform: translateY(-2px);
}

.key-btn:active {
    transform: translateY(0);
}

.keypad-actions {
    display: flex;
    gap: 15px;
}

.btn-keypad-util {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-keypad-util:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* TTS Accessibility Layer */
.tts-icon {
    margin-left: 0.75rem;
    cursor: pointer;
    color: var(--exec-green);
    font-size: 1.2rem;
    vertical-align: middle;
    transition: all var(--transition-base);
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tts-icon:hover {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px var(--exec-teal-glow));
}

body.tts-active .tts-icon {
    animation: tts-pulse 1.5s infinite;
    opacity: 1;
    color: var(--accent-cyan);
}

@keyframes tts-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--exec-teal-glow));
    }

    50% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 12px var(--exec-teal-glow));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--exec-teal-glow));
    }
}

.display-heading,
.section-heading,
.form-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-heading {
    justify-content: flex-start;
}

/* Welcome Scene Grid Styling */
.welcome-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.welcome-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.welcome-right {
    display: flex;
    justify-content: center;
}

.welcome-video-container {
    width: 70%;
    max-width: 380px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-level-2), 0 0 20px rgba(15, 118, 110, 0.3);
    border: 1px solid var(--border-subtle);
    background: #000;
}

.welcome-video {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   AI Chatbot: High-Tech Neural Core Upgrade
   ========================================================================== */
.ai-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbot-launcher {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle at 30% 30%, rgba(20, 184, 166, 0.4), transparent 70%),
        rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(45, 212, 191, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(45, 212, 191, 0.2);
    transition: all 0.4s var(--ease-exec);
    overflow: hidden;
}

.chatbot-launcher:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: rgba(45, 212, 191, 0.8);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(45, 212, 191, 0.4);
}

.launcher-glow {
    position: absolute;
    inset: -5px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.35), transparent 70%);
    animation: neural-pulse 3s infinite ease-in-out;
    pointer-events: none;
}

/* Neural Core SVG Animation Styling */
.neural-core-svg {
    width: 36px;
    height: 36px;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.8));
}

.core-layer {
    transform-origin: center;
    animation: core-rotate 8s infinite linear;
}

.core-layer:nth-child(2) {
    animation-direction: reverse;
    animation-duration: 12s;
}

.core-pulse-circle {
    animation: core-inner-pulse 2s infinite ease-in-out;
}

@keyframes neural-pulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

@keyframes core-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes core-inner-pulse {

    0%,
    100% {
        opacity: 0.5;
        r: 8;
    }

    50% {
        opacity: 1;
        r: 12;
    }
}

/* Header Avatar Refinement */
.header-info .mini-neural-core {
    width: 24px;
    height: 24px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(45, 212, 191, 0.4);
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-window {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(45, 212, 191, 0.2);
    box-shadow: var(--shadow-level-3), 0 0 50px rgba(0, 0, 0, 0.5);
}

.chat-header {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.2), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}