/* ============================================================
   HORIZON design system — canonical tokens + shared components
   Iraq Summit 2026 by Horizonscope
   Brand identity preserved from original palette, systematized.
   ============================================================ */

:root {
    /* ---- Brand ramp (blue -> cyan) ---- */
    --brand-50:  #eef7fb;
    --brand-100: #d7edf7;
    --brand-200: #aaddee;
    --brand-300: #6fc6e2;
    --brand-400: #18bfd0; /* cyan */
    --brand-500: #08a1c6;
    --brand-600: #0787bd;
    --brand-700: #0567a7; /* primary deep blue */
    --brand-800: #045184;
    --brand-900: #033f68;

    /* ---- Signature gradients ---- */
    --grad-brand: linear-gradient(135deg, #0567a7 0%, #0787bd 52%, #18bfd0 100%);
    --grad-brand-bright: linear-gradient(135deg, #0570ad 0%, #0b93c0 58%, #1ac2d3 100%);
    --grad-hero:
        radial-gradient(125% 125% at 82% 6%, rgba(64, 216, 230, 0.55) 0%, rgba(64, 216, 230, 0) 44%),
        linear-gradient(142deg, #023e72 0%, #0567a7 40%, #0e90c1 74%, #20c0d4 100%);

    /* ---- Cool neutrals (tinted toward brand) ---- */
    --bg:         #f3f6fb;
    --surface:    #ffffff;
    --surface-2:  #f6f9fc;
    --surface-3:  #eef2f8;
    --border:     #e4eaf2;
    --border-strong: #d2dbe8;

    /* ---- Ink (text) ---- */
    --ink:    #102a44; /* primary  ~13:1 on white */
    --ink-2:  #42566d; /* secondary ~7:1 */
    --ink-3:  #5c7088; /* muted/meta ~5:1 (AA body) */
    --on-brand:        #ffffff;
    --on-brand-soft:   rgba(255, 255, 255, 0.86);
    --on-brand-faint:  rgba(255, 255, 255, 0.68);

    /* ---- Functional accents (meaning only) ---- */
    --success:      #1aa86a;
    --success-ink:  #0f6b46;
    --success-bg:   #e6f5ee;
    --danger:       #d9534f;
    --danger-ink:   #b23b37;
    --danger-bg:    #fbeaea;
    --warning:      #d98a0b;
    --warning-bg:   #fdf3e2;
    --pdf:          #d9534f;
    --excel:        #1f9d6b;
    --gold:         #e0a23c;

    /* Stat-tile gradients (muted, refined) */
    --tile-blue: linear-gradient(135deg, #0567a7 0%, #18bfd0 100%);
    --tile-teal: linear-gradient(135deg, #0a93b0 0%, #2bcad6 100%);
    --tile-gold: linear-gradient(135deg, #e0a23c 0%, #f0c061 100%);

    /* ---- Typography ---- */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.375rem;
    --text-2xl:  1.75rem;
    --text-3xl:  2.25rem;

    /* ---- Spacing (4px base) ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ---- Radius ---- */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* ---- Elevation (cool-tinted) ---- */
    --shadow-xs: 0 1px 2px rgba(16, 42, 68, 0.06);
    --shadow-sm: 0 1px 3px rgba(16, 42, 68, 0.08), 0 1px 2px rgba(16, 42, 68, 0.05);
    --shadow-md: 0 6px 16px rgba(16, 42, 68, 0.10), 0 2px 6px rgba(16, 42, 68, 0.05);
    --shadow-lg: 0 18px 48px rgba(3, 72, 116, 0.20), 0 8px 20px rgba(3, 72, 116, 0.10);
    --shadow-brand: 0 10px 26px rgba(5, 103, 167, 0.34);

    /* ---- Focus ring ---- */
    --ring: 0 0 0 3px rgba(8, 161, 198, 0.30);
    --ring-on-brand: 0 0 0 3px rgba(255, 255, 255, 0.55);

    /* ---- Motion ---- */
    --ease:     cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.30, 1);
    --dur-1: 0.15s;
    --dur-2: 0.22s;
    --dur-3: 0.40s;

    /* ---- Z-index scale ---- */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal-backdrop: 1030;
    --z-modal: 1040;
    --z-toast: 1060;
    --z-tooltip: 1080;
}

/* ---- Global niceties (safe, additive) ---- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(8, 161, 198, 0.22);
    color: var(--ink);
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

/* ============================================================
   Brand mark (inline SVG starburst, themeable via currentColor)
   ============================================================ */
.hz-mark {
    display: inline-block;
    flex: none;
    line-height: 1;
}

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

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--on-brand);
    text-decoration: none;
}

.brand-lockup .brand-name {
    font-weight: 800;
    letter-spacing: 0.14em;
    font-size: var(--text-lg);
    line-height: 1;
}

.brand-lockup .brand-sub {
    display: block;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-size: var(--text-xs);
    opacity: 0.78;
    margin-top: 2px;
}

/* ============================================================
   Buttons (shared vocabulary)
   ============================================================ */
.hz-btn {
    --_bg: var(--brand-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.25rem;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--dur-2) var(--ease),
                box-shadow var(--dur-2) var(--ease),
                background-color var(--dur-2) var(--ease),
                border-color var(--dur-2) var(--ease);
}

.hz-btn:focus-visible {
    box-shadow: var(--ring);
}

.hz-btn-primary {
    color: var(--on-brand);
    background-image: var(--grad-brand-bright);
    box-shadow: var(--shadow-sm);
}

.hz-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand);
}

.hz-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.hz-btn-ghost {
    color: var(--brand-700);
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.hz-btn-ghost:hover {
    border-color: var(--brand-400);
    color: var(--brand-800);
    background: var(--brand-50);
}

.hz-btn:disabled,
.hz-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   Alerts (shared)
   ============================================================ */
.hz-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid transparent;
}

.hz-alert i {
    margin-top: 1px;
}

.hz-alert-success {
    color: var(--success-ink);
    background: var(--success-bg);
    border-color: rgba(26, 168, 106, 0.28);
}

.hz-alert-error {
    color: var(--danger-ink);
    background: var(--danger-bg);
    border-color: rgba(217, 83, 79, 0.28);
}

/* ============================================================
   Branded content pages (Privacy / Error / Logout)
   ============================================================ */
.content-page {
    max-width: 880px;
    margin: var(--space-10) auto;
    padding: 0 var(--space-4);
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.content-card__header {
    position: relative;
    padding: var(--space-8) var(--space-10);
    color: var(--on-brand);
    background: var(--grad-brand);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.content-card__header .hz-mark {
    font-size: 44px;
    color: var(--on-brand);
    opacity: 0.95;
}

.content-card--danger .content-card__header {
    background: linear-gradient(135deg, #b23b37 0%, #d9534f 60%, #e8736f 100%);
}

.content-card__eyebrow {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.82;
    margin: 0 0 4px;
}

.content-card__title {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.15;
    text-wrap: balance;
}

.content-card__body {
    padding: var(--space-8) var(--space-10);
    color: var(--ink-2);
    font-size: var(--text-base);
    line-height: 1.65;
}

.content-card__body > * + * {
    margin-top: var(--space-4);
}

.content-card__body h2,
.content-card__body h3 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: var(--space-6);
}

.content-card__body h3 {
    font-size: var(--text-lg);
}

.content-card__body ul {
    margin: var(--space-3) 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-2);
}

.content-card__body ul li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--ink-2);
}

.content-card__body ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-400);
    box-shadow: 0 0 0 3px rgba(24, 191, 208, 0.18);
}

.content-card__body code {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-size: 0.9em;
    color: var(--brand-800);
}

.content-card__actions {
    margin-top: var(--space-6);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

@media (max-width: 640px) {
    .content-card__header,
    .content-card__body {
        padding: var(--space-6);
    }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
