/* ==========================================================================
   cleartap™ — Sovereign SoftPOS & Tap-to-Pay Design System
   WCAG 2.2 AA & European Accessibility Act (EAA) Compliant
   Zero-Third-Party CDNs · Self-Hosted Fonts · Dark/Light Modes
   ========================================================================== */

/* --- TYPOGRAPHY (Self-Hosted Local WOFF2) --- */
@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter-latin.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}

/* --- DESIGN TOKENS: ROOT & THEMES --- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 9999px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

    /* Brand Accents */
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.25);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.25);
    --accent-gold: #f59e0b;
    --accent-danger: #ef4444;
}

/* Dark Theme (Default) */
:root, [data-theme="dark"] {
    --bg-base: #06090e;
    --bg-surface: #0c121d;
    --bg-surface-elevated: #131c2d;
    --bg-glass: rgba(12, 18, 29, 0.75);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(6, 182, 212, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    --hero-glow: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
}

/* Light Theme */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(6, 182, 212, 0.5);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    --hero-glow: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
}

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

html {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Accessible Focus States (WCAG 2.2 AA) */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- LAYOUT UTILITIES --- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 96px 0;
    position: relative;
}

.section-alt {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 64px auto;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(6, 182, 212, 0.25);
    margin-bottom: 18px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 18px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- NAVIGATION HEADER --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.brand-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.brand-dot {
    color: var(--accent-cyan);
}

.nav-links,
.nav-list {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-height: 44px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #22d3ee, #0369a1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-cyan-glow);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border-hover);
    border-color: var(--accent-cyan);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--text-primary);
}

/* --- CONTROLS: THEME, COUNTRY & LANG SWITCHER --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2px;
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-btn.active {
    background: var(--accent-cyan);
    color: #0b0f19;
    font-weight: 700;
}

[data-theme="light"] .theme-btn.active {
    background: #0284c7;
    color: #ffffff;
}

.header-dropdown-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    min-height: 42px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
}

.header-dropdown-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.header-dropdown-btn:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

.dropdown-caret {
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform var(--transition);
}

.header-dropdown-btn[aria-expanded="true"] .dropdown-caret {
    transform: rotate(180deg);
}

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 1100;
}

[data-theme="light"] .header-dropdown-menu {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.header-dropdown-menu.show {
    display: flex;
    animation: ctDropdownFade 0.15s ease-out;
}

.header-dropdown-menu-grid {
    min-width: 260px;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.header-dropdown-menu-grid.show {
    display: grid;
}

@keyframes ctDropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.dropdown-option:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .dropdown-option:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

.dropdown-option.active {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.12);
    font-weight: 700;
}

[data-theme="light"] .dropdown-option.active {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
}

.dropdown-option .opt-domain {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Footer Country Navigation Bar */
.footer-country-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.footer-country-nav .country-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.footer-country-nav .country-link:hover,
.footer-country-nav .country-link.active {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

[data-theme="light"] .footer-country-nav .country-link:hover,
[data-theme="light"] .footer-country-nav .country-link.active {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
}

.footer-country-nav .sep {
    color: var(--text-muted);
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 100px 0 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-glow-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 500px;
    background: var(--hero-glow);
    pointer-events: none;
    z-index: 0;
}

.hero-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.hero-pill-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.hero-title-highlight {
    background: linear-gradient(135deg, var(--accent-cyan), #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 820px;
    margin: 0 auto 40px auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 56px;
    position: relative;
    z-index: 1;
}

.hero-kpis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1040px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 18px;
    text-align: center;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-cyan);
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* --- TRUST RIBBON --- */
.trust-ribbon-section {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
    overflow: hidden;
}

.trust-ribbon-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    flex-wrap: wrap;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.trust-badge-icon {
    font-size: 1.25rem;
}

/* --- COMPARISON MATRIX: TERMINAL VS CLEARTAP --- */
.comp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 1040px;
    margin: 0 auto;
}

.comp-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    position: relative;
    transition: var(--transition);
}

.comp-card.legacy {
    border-color: rgba(239, 68, 68, 0.25);
}

.comp-card.cleartap-card {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 8px 30px var(--accent-cyan-glow);
    background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
}

.comp-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.comp-badge.bad {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.comp-badge.good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.comp-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.comp-list {
    list-style: none;
    margin-bottom: 32px;
}

.comp-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
}

.comp-list li:last-child {
    border-bottom: none;
}

.comp-icon-bad {
    color: var(--accent-danger);
    font-weight: 900;
}

.comp-icon-good {
    color: var(--accent-emerald);
    font-weight: 900;
}

/* --- INTERACTIVE CALCULATOR --- */
.calc-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 980px;
    margin: 0 auto;
    box-shadow: var(--card-shadow);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
}

.calc-input-group {
    margin-bottom: 28px;
}

.calc-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.calc-range-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-surface-elevated);
    outline: none;
    cursor: pointer;
    accent-color: var(--accent-cyan);
}

.calc-results-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
}

.calc-savings-val {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-emerald);
    line-height: 1;
    margin: 12px 0;
}

.calc-breakdown-list {
    list-style: none;
    margin: 20px 0;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.calc-breakdown-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

/* --- 4 ARCHITECTURAL PILLARS --- */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pillar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    position: relative;
    transition: var(--transition);
}

.pillar-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

.pillar-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-cyan);
    margin-bottom: 12px;
}

.pillar-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.pillar-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.3;
}

.pillar-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.native-marker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-top: 10px;
}

/* --- FOOTER --- */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px 0;
    margin-top: auto;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--accent-cyan);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .hero-kpis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .comp-grid, .calc-grid {
        grid-template-columns: 1fr;
    }
    .pillars-grid {
        grid-template-columns: 1fr;
    }
    .nav-links,
    .nav-list {
        display: none;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ==========================================================================
   DEMO PORTAL: SOFT-POS SIMULATOR & LEDGER STYLES
   ========================================================================== */
.demo-banner-box {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 16px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}
[data-theme="light"] .demo-banner-box {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

.cockpit-preview-banner {
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 10px 16px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}
[data-theme="light"] .cockpit-preview-banner {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.demo-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    margin-top: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .demo-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

/* Smartphone Mockup Frame */
.phone-mockup {
    width: 360px;
    height: 680px;
    background: #000;
    border-radius: 44px;
    border: 10px solid #1e293b;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    user-select: none;
}
.phone-notch {
    width: 140px;
    height: 22px;
    background: #1e293b;
    align-self: center;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    position: absolute;
    top: 0;
    z-index: 10;
}
.phone-screen {
    flex: 1;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    padding: 32px 18px 20px;
    color: var(--text-primary);
    overflow-y: auto;
}

.screen-header {
    text-align: center;
    margin-bottom: 16px;
}
.merchant-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.terminal-status {
    font-size: 0.7rem;
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.terminal-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
}

.amount-display {
    text-align: center;
    margin: 12px 0;
}
.amount-val {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.tip-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}
.tip-btn {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.tip-btn.active, .tip-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--accent-cyan-glow);
}

/* Numpad */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: auto;
}
.num-btn {
    height: 52px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 1.3rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.num-btn:hover, .num-btn:active {
    background: var(--accent-cyan-glow);
    border-color: var(--accent-cyan);
    transform: scale(0.97);
}
.btn-charge {
    grid-column: span 3;
    height: 48px;
    background: var(--accent-cyan);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 6px;
    transition: var(--transition);
}
.btn-charge:hover {
    background: #22d3ee;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
}

/* Simulated NFC Tap View */
.nfc-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    gap: 16px;
}
.nfc-pulse-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--accent-cyan-glow);
    border: 2px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    animation: nfcPulse 1.8s infinite;
}
@keyframes nfcPulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(6, 182, 212, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* Safe Simulated PIN-on-Glass */
.pin-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 14px;
    text-align: center;
}
.pin-dots-row {
    display: flex;
    gap: 14px;
    margin: 12px 0;
}
.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    background: transparent;
    transition: var(--transition);
}
.pin-dot.filled {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}
.pin-disclaimer-text {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Success Receipt View */
.receipt-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 10px;
}
.receipt-qr-code {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}
.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
    font-family: var(--font-mono);
}

/* Inspector & Ledger Container */
.demo-panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.ledger-panel, .inspector-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.data-table-wrapper {
    overflow-x: auto;
}
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}
.ledger-table th {
    padding: 10px 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.ledger-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
}
.status-pill {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.status-pill.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

/* Raw Signature Inspector Box */
.inspector-code {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-x: auto;
}

/* ==========================================================================
   PORTAL COCKPIT: TABS, KPI CARDS & TAX CENTER STYLES
   ========================================================================== */
.cockpit-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}
.cockpit-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.tab-btn {
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}
.tab-btn.active {
    background: var(--accent-cyan-glow);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.cockpit-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}
@media (max-width: 900px) {
    .cockpit-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .cockpit-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.terminal-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.terminal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.terminal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.terminal-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
}

/* Tax & Accounting Export Center Grid */
.tax-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.tax-export-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}
.tax-export-card:hover {
    border-color: var(--border-hover);
}

/* Modal View */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}
.modal-overlay[hidden] {
    display: none;
}
.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body {
    padding: 22px;
    overflow-y: auto;
}
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* --- ACCESSIBILITY: WCAG 2.2 AA REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .nfc-pulse-circle {
        animation: none !important;
    }
    .pin-dot {
        transition: none !important;
    }
}

/* --- HIGH-FIDELITY PRINT STYLES (Z-BON & WEBREADER) --- */
@media print {
    .site-header, .site-footer, .header-actions, .main-nav, .demo-banner-box, .cockpit-preview-banner, .reader-nav, .btn, .theme-switcher, .lang-switcher {
        display: none !important;
    }
    body, html {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt !important;
    }
    .reader-container, .cockpit-container, .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .receipt-card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
        max-width: 80mm !important;
        margin: 0 auto !important;
    }
    .paper-chapter {
        page-break-inside: avoid;
        border-bottom: 1px solid #ccc !important;
    }
}


