/* ============================================================
   main.css — Variables, reset, typography, layout
   ============================================================ */

/* ---- Outfit Font (self-hosted variable font) ------------- */
/* Outfit is a variable font — one file covers weights 100–900 */
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-latin.woff2') format('woff2');
    font-weight: 100 900;
    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+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-latin-ext.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Design Tokens --------------------------------------- */
:root {
    --orange: #ff6800;
    --orange-dark: #e05a00;
    --orange-light: #fff0e6;
    --blue: #007dff;
    --blue-dark: #005fcc;
    --blue-light: #e6f0ff;
    --dark: #141313;
    --dark-80: rgba(20, 19, 19, 0.8);
    --mid: #444;
    --muted: #777;
    --border: #e0e0e0;
    --bg: #FAFAFA;
    --white: #ffffff;

    /* SBRS co-brand accent (only used in trailer sections) */
    --sbrs-red: #c8102e;
    --sbrs-red-light: #fdf0f2;

    /* Typography */
    --font: 'Outfit', system-ui, -apple-system, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --max-w: 1200px;
    --max-w-sm: 640px;
    --max-w-md: 768px;
    --radius: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);

    /* Transitions */
    --transition: 0.2s ease;
}

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--dark);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--blue-dark); }

ul, ol { list-style: none; }

button, input, select, textarea {
    font-family: var(--font);
    font-size: var(--text-base);
}

button { cursor: pointer; }

/* ---- Typography ------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }
em { font-style: italic; }

.text-orange { color: var(--orange); }
.text-blue   { color: var(--blue); }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.text-center { text-align: center; }

/* ---- Layout ---------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section-sm {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.section-header {
    max-width: 680px;
    margin: 0 auto var(--space-12);
    text-align: center;
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--muted);
    margin-top: var(--space-4);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex utilities */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col    { flex-direction: column; }
.gap-2       { gap: var(--space-2); }
.gap-4       { gap: var(--space-4); }
.gap-6       { gap: var(--space-6); }
.gap-8       { gap: var(--space-8); }

/* Spacing utilities */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-8  { margin-bottom: var(--space-8); }

/* ---- Form Base ------------------------------------------- */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--dark);
}

.form-group label .required {
    color: var(--orange);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-base);
    color: var(--dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 125, 255, 0.12);
}

.form-control::placeholder { color: var(--muted); }

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: var(--space-10);
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-sm);
    color: #c00;
    margin-top: var(--space-1);
    display: none;
}

.form-error.visible { display: block; }

/* Checkbox / Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--orange);
    cursor: pointer;
}

.form-check label {
    font-size: var(--text-sm);
    color: var(--mid);
    cursor: pointer;
    user-select: none;
}

/* Honeypot */
.hp-field { display: none !important; }

/* ---- Alert/Notice ---------------------------------------- */
.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
    display: none;
}
.alert.visible { display: block; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ---- Page hero (inner pages) ----------------------------- */
.page-hero {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-16) 0 var(--space-12);
    text-align: center;
}

.page-hero h1 { color: var(--white); }

.page-hero p {
    color: rgba(255,255,255,0.75);
    font-size: var(--text-lg);
    margin-top: var(--space-4);
}

/* ---- Visually hidden (accessibility) --------------------- */
.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;
}

/* Invert black logo to white for dark backgrounds */
img[src*="logo-paddock-white"] {
    filter: brightness(0) invert(1);
}
