/* Formula X — Base Styles */
/* Reset + root variables */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    background: var(--fx-bg, #f7f8fa);
    color: var(--fx-text, #1e2329);
}

/* Root variables */
:root {
    --fx-primary: #E10600;
    --fx-primary-600: #b80500;
    --fx-bg: #ffffff;
    --fx-surface: #f7f8fa;
    --fx-elev: #ffffff;
    --fx-text: #1e2329;
    --fx-text-muted: #5b6573;
    --fx-border: #e5e7eb;
    --fx-ring: rgba(225,6,0,.25);
    --fx-radius: 14px;
    --fx-shadow: 0 6px 24px rgba(15,23,42,.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --fx-bg: #0b0f14;
        --fx-surface: #0f141b;
        --fx-elev: #121a23;
        --fx-text: #e7ecf4;
        --fx-text-muted: #a7b0be;
        --fx-border: #1f2a36;
        --fx-shadow: 0 8px 30px rgba(0,0,0,.45);
    }
}

/* Layout */
.fx-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.section {
    padding: 48px 0;
}

/* Header / Nav */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--fx-border);
}
@media (prefers-color-scheme: dark){
  .header{ background: rgba(11,15,20,.6); }
}
.header.scrolled {
    box-shadow: var(--fx-shadow);
}
.navlinks {
    display: flex;
    gap: 18px;
}
.navlinks a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--fx-text);
    text-decoration: none;
}
.navlinks a:hover, .navlinks a.active {
    background: var(--fx-surface);
}

/* Cards */
.card {
    background: var(--fx-elev);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    padding: 18px;
    margin-bottom: 20px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--fx-elev);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    overflow: hidden;
}
.table th, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--fx-border);
    text-align: left;
}
.table thead th {
    background: var(--fx-surface);
    font-weight: 600;
}
.table tr:last-child td {
    border-bottom: 0;
}

/* Forms */
.input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--fx-border);
    background: var(--fx-elev);
    color: var(--fx-text);
    outline: none;
}
.input:focus, select:focus, textarea:focus {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 4px var(--fx-ring);
}
label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--fx-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform .02s ease, box-shadow .2s ease, background .2s ease;
    box-shadow: 0 6px 16px rgba(225,6,0,.28);
}
.btn:hover {
    background: var(--fx-primary-600);
}
.btn.outline {
    background: transparent;
    color: var(--fx-primary);
    border-color: var(--fx-primary);
    box-shadow: none;
}

/* Utilities */
.m0 { margin: 0 !important; }
.mt8 { margin-top: 8px !important; }
.mt16 { margin-top: 16px !important; }
.mt24 { margin-top: 24px !important; }
.mb8 { margin-bottom: 8px !important; }
.mb16 { margin-bottom: 16px !important; }
.mb24 { margin-bottom: 24px !important; }
.center { text-align: center; }
.hidden { display: none !important; }
