/* ==========================================================================
   SmartBuild design system: tokens, type, base elements, buttons, logo.
   Shared by the landing page, privacy page and the app.
   ========================================================================== */

/* Inter (SIL Open Font License, see assets/fonts/OFL.txt), self-hosted, Latin subset */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Brand: one strong colour, used sparingly (primary actions, logo, focus) */
    --brand: #c41e2a;
    --brand-hover: #a3161f;
    --brand-press: #8a121a;
    --brand-50: #fdf3f3;
    --brand-100: #fbe4e5;
    --brand-200: #f5c2c5;
    --brand-ink: #a3161f;          /* brand-coloured text on light surfaces (AA) */
    --on-brand: #ffffff;

    /* Neutrals (cool slate) */
    --ink-950: #0b1220;
    --ink-900: #111827;
    --ink-800: #1f2937;
    --ink-700: #374151;
    --ink-600: #4b5563;
    --ink-500: #6b7280;
    --ink-400: #9ca3af;
    --ink-300: #d1d5db;
    --ink-200: #e5e7eb;
    --ink-100: #f1f3f6;
    --ink-50:  #f7f8fa;

    /* Semantic (light theme) */
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #eef0f3;
    --line: #e4e7ec;
    --line-strong: #cfd4dc;
    --text: #111827;
    --text-2: #374151;
    --text-muted: #5b6472;         /* 5.9:1 on white */
    --text-subtle: #6b7280;        /* 4.8:1 on white */
    --placeholder: #8a929e;

    --success: #047857;            /* 5.5:1 on white */
    --success-bg: #ecfdf5;
    --success-line: #a7f3d0;
    --warning: #92400e;
    --warning-bg: #fffbeb;
    --warning-line: #fcd34d;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --info: #1d4ed8;
    --info-bg: #eff6ff;
    --info-line: #bfdbfe;

    /* Type */
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: clamp(2rem, 4.2vw, 2.75rem);
    --fs-4xl: clamp(2.35rem, 5.6vw, 3.75rem);

    /* Spacing (4px base) */
    --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.25rem;
    --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem; --sp-24: 6rem;

    /* Radii */
    --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.10), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
    --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, 0.18), 0 6px 12px -6px rgba(16, 24, 40, 0.06);
    --ring: 0 0 0 3px rgba(196, 30, 42, 0.28);
    --ring-color: #c41e2a;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --t-fast: 120ms;
    --t: 200ms;

    --tap: 44px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #151b23;
    --surface-2: #1b222c;
    --surface-3: #232b36;
    --line: #2a323e;
    --line-strong: #3a4452;
    --text: #f1f3f6;
    --text-2: #d1d5db;
    --text-muted: #a3abb8;
    --text-subtle: #8f98a6;
    --placeholder: #7d8694;
    --brand-50: rgba(240, 82, 92, 0.10);
    --brand-100: rgba(240, 82, 92, 0.16);
    --brand-200: rgba(240, 82, 92, 0.35);
    --brand-ink: #ff8a92;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.10);
    --success-line: rgba(52, 211, 153, 0.35);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.10);
    --warning-line: rgba(251, 191, 36, 0.35);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.10);
    --info: #93c5fd;
    --info-bg: rgba(147, 197, 253, 0.10);
    --info-line: rgba(147, 197, 253, 0.3);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
    --ring: 0 0 0 3px rgba(255, 138, 146, 0.35);
    --ring-color: #ff8a92;
    color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; color: var(--text); }
strong, b { font-weight: 600; }
.tnum, .price { font-variant-numeric: tabular-nums; }

/* ---------- Icons ---------- */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-fill { fill: currentColor; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.025em; line-height: 1; }
.logo-mark { width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 9px; }
.logo-word b { font-weight: 800; color: inherit; }
.logo-lg { font-size: 1.6rem; }
.logo-lg .logo-mark { width: 2.6rem; height: 2.6rem; border-radius: 12px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: var(--tap); padding: 0 1.15rem;
    border: 1px solid transparent; border-radius: var(--r-sm);
    font-weight: 600; font-size: 0.95rem; line-height: 1.2; letter-spacing: -0.005em;
    text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
    transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.btn .icon { width: 1.1rem; height: 1.1rem; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover { background: var(--ink-800); }
[data-theme="dark"] .btn-dark { background: #f1f3f6; color: #111827; }
.btn-secondary, .btn-outline { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover, .btn-outline:hover { background: var(--surface-2); border-color: var(--ink-400); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-success { background: var(--brand); color: var(--on-brand); }  /* legacy class: one action colour */
.btn-success:hover { background: var(--brand-hover); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 0.8rem; font-size: 0.85rem; border-radius: var(--r-xs); }
.btn-lg { min-height: 52px; padding: 0 1.5rem; font-size: 1.02rem; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: var(--tap); }

/* ---------- Accessibility ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 0.75rem; top: -4rem; z-index: 5000; background: var(--ink-900); color: #fff; padding: 0.65rem 1rem; border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0.75rem; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
@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; }
}
