/* ============================================================
   iconOS Portal — Design System CSS
   Based on: Liêu Lãm Brand Design System v1.0
   Colors: Deep Carbon #0F1014 · Ignition Red #FF3403 · Surface #F3F3F3
   Fonts: Space Grotesk (headings) + Open Sans (body)
   ============================================================ */

:root {
    --red: #FF3403;
    --carbon: #0F1014;
    --surface: #F3F3F3;
    --white: #FFFFFF;
    --muted: #8A8F9A;
    --line: #E0E0E0;
    --font-head: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Open Sans', system-ui, sans-serif;

    /* Rule 11 — Extended Semantic Palette (use only when ≥3 categories) */
    --ext-green: #22C55E;   /* Growth · Positive · Đạt target */
    --ext-amber: #F59E0B;   /* Warning · Pending · In-progress */
    --ext-blue: #3B82F6;    /* Data · Information · Cold metric */
    --ext-purple: #8B5CF6;  /* Strategic · Premium · Executive */
    --ext-teal: #14B8A6;    /* Secondary positive · Health */
    --ext-pink: #EC4899;    /* Community · Social · Engagement */
    --ext-cyan: #06B6D4;    /* Digital · Platform · Tech */
    --ext-lime: #84CC16;    /* Progress · Active · Momentum */
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--carbon);
    color: var(--white);
    overflow-x: hidden;
    margin: 0;
}

/* ===== GRAIN OVERLAY ===== */
.grain::after {
    content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== CARDS (dark theme — 70% carbon ratio) ===== */
.glass {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--white);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6,
.font-bold, .font-semibold {
    font-family: var(--font-head);
}

/* ===== NAV ===== */
.nav-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(15, 16, 20, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* ===== BUTTONS ===== */
.btn-glow {
    position: relative; overflow: hidden;
    background: var(--red); color: var(--white);
    font-family: var(--font-head);
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-glow::before {
    content: ''; position: absolute; inset: -2px; border-radius: inherit;
    background: linear-gradient(135deg, #FF3403, #FF5C33, #FF3403);
    z-index: -1; filter: blur(16px); opacity: 0.5;
    transition: opacity 0.3s ease;
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255,52,3,0.4); }
.btn-glow:hover::before { opacity: 0.8; }
.btn-glow:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ===== FORM INPUTS (dark theme) ===== */
.input-field {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    outline: none;
}
.input-field::placeholder { color: rgba(255,255,255,0.3); }
.input-field:focus {
    border-color: rgba(255,52,3,0.5);
    box-shadow: 0 0 0 3px rgba(255,52,3,0.08);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
select.input-field option { background: #1A1A1D; color: var(--white); }

/* ===== RADIO CARDS ===== */
.radio-card.selected,
.radio-card:has(input:checked) {
    border-color: rgba(255,52,3,0.5);
    background: rgba(255,52,3,0.05);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--carbon); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.8s linear infinite; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease-out forwards; }
.fade-in { animation: fadeUp 0.4s ease-out; }

/* ===== ACCENT LINE ===== */
.accent-line { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,52,3,0.3), transparent); }

/* ===== DECORATIVE ORBS (subtle on dark bg) ===== */
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.06; pointer-events: none;
}

/* ===== MODULE COLORS ===== */
.text-accent { color: var(--red); }
.text-b1 { color: #FF3403; }
.text-b2 { color: #3B82F6; }
.text-b3 { color: #10B981; }
.text-b4 { color: #F59E0B; }
.text-b5 { color: #8B5CF6; }
.bg-accent { background: var(--red); }

/* Dark theme — no card color overrides needed */

/* ===== PILLS (from design system) ===== */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 100px;
    font-family: var(--font-head); font-size: 12px; font-weight: 600;
}
.pill-red { background: rgba(255,52,3,0.1); color: var(--red); }
.pill-carbon { background: rgba(15,16,20,0.1); color: var(--carbon); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 4px;
    font-family: var(--font-head); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.badge-red { background: var(--red); color: var(--white); }
.badge-carbon { background: var(--carbon); color: var(--white); }

/* ===== STAT BOXES ===== */
.stat-box {
    background: var(--surface); border-radius: 12px; padding: 20px 24px;
}
.stat-number {
    font-family: var(--font-head); font-size: 36px; font-weight: 700;
    color: var(--carbon); line-height: 1;
}
.stat-number span { color: var(--red); }
.stat-label {
    font-family: var(--font-body); font-size: 13px;
    color: var(--muted); margin-top: 4px;
}

/* ===== SECTION LABELS ===== */
.section-label {
    font-family: var(--font-head);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--red);
}
