/**
 * RoburFitness Design System
 * ---------------------------------------------------------------
 * Light-only. Editorial / typographic. Deliberately un-decorated:
 *
 *   - ZERO border-radius anywhere. Square corners, full stop.
 *   - ZERO shadows. Separation comes from hairline rules and whitespace.
 *   - No gradients, no glass, no blurred colour orbs, no glow.
 *   - Hierarchy is carried by type scale, weight and space - not by boxes.
 *   - Colour is restrained: near-black on white, green used sparingly
 *     as an accent for actions and state, never as decoration.
 *
 * Legacy token names (--bg-card, --text-primary, --border-color, ...) are
 * retained as aliases because ~2,200 inline style="" rules across the
 * templates reference them directly.
 */

/* ============================================================
   1. Tokens
   ============================================================ */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* -- Accent: used for actions and state only -- */
    --brand: #15803d;
    --brand-hover: #166534;
    --brand-active: #14532d;
    --brand-soft: #f2f7f3;
    --brand-soft-strong: #e4efe7;
    --brand-border: #cadbcf;
    --brand-contrast: #ffffff;
    --brand-ring: rgba(21, 128, 61, 0.22);

    /* -- Surfaces -- */
    --bg-page: #ffffff;
    --bg-surface: #ffffff;
    --bg-subtle: #fafafa;
    --bg-muted: #f5f5f5;

    /* -- Hairlines -- */
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --rule: #171717;

    /* -- Ink -- */
    --text: #171717;
    --text-2: #525252;
    --text-3: #737373;
    --text-on-brand: #ffffff;

    /* -- Status -- */
    --success: #15803d;
    --success-soft: #f2f7f3;
    --warning: #a16207;
    --warning-soft: #fdfaf3;
    --danger: #b91c1c;
    --danger-soft: #fdf4f4;
    --info: #1d4ed8;
    --info-soft: #f4f6fd;

    /* -- Radius: none. Kept as tokens so legacy var() refs resolve to 0. -- */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --radius-2xl: 0;
    --radius-full: 0;

    /* -- Elevation: none. -- */
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-glow: none;

    --container-padding: 1.5rem;

    /* ---- Legacy aliases ---- */
    --bg-primary: var(--bg-page);
    --bg-secondary: var(--bg-subtle);
    --bg-card: var(--bg-surface);
    --bg-hover: var(--bg-muted);
    --bg-input: var(--bg-surface);
    --border-color: var(--border);
    --border-hover: var(--border-strong);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --color-brand-from: var(--brand);
    --color-brand-to: var(--brand);
    --gradient-primary: var(--brand);
    --gradient-hover: var(--brand-hover);
    --nav-bg: #ffffff;
    --glass-bg: #ffffff;
    --btn-primary-bg: var(--brand);
    --btn-primary-text: var(--brand-contrast);
}

/* ============================================================
   2. Global de-decoration
   ============================================================
   Enforced globally so no stray utility or inline rule can
   reintroduce rounding, shadow or blur.                        */

*,
*::before,
*::after {
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Kill decorative blur washes; keep functional blur off entirely. */
[class*="blur-"] { filter: none !important; }

/* ============================================================
   3. Base
   ============================================================ */

* { font-family: var(--font-sans); }

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.18;
    font-weight: 600;
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); }
h4 { font-size: 1.0625rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

hr { border: 0; border-top: 1px solid var(--border); }

::selection { background: #171717; color: #fff; }

/* ============================================================
   4. Layout
   ============================================================ */

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3.5rem); }

.band-tint  { background: var(--bg-subtle); }
.band-white { background: #fff; }

/* A hairline above a band reads as an editorial section break. */
.band-rule { border-top: 1px solid var(--border); }

.container-page {
    max-width: 68rem;
    margin-inline: auto;
    padding-inline: 1.5rem;
}
.container-narrow {
    max-width: 42rem;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.display-1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--text);
}
.display-2 {
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--text);
}
.lead {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.65;
    color: var(--text-2);
}

/* ============================================================
   5. Surfaces - hairline boxes, never floating panels
   ============================================================ */

.card,
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.card-flat {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}

.card-hover,
a.card:hover,
a.glass-card:hover {
    border-color: var(--rule);
    transition: border-color 0.12s ease;
}

.surface-subtle { background: var(--bg-subtle); }

.divider { height: 1px; background: var(--border); border: 0; }

/* ============================================================
   6. Buttons - square, flat, legible
   ============================================================ */

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background-color 0.12s ease, border-color 0.12s ease,
        color 0.12s ease;
}

.btn-primary {
    background: var(--brand);
    color: var(--brand-contrast);
    border-color: var(--brand);
}
.btn-primary:hover  { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); border-color: var(--brand-active); }

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--rule); background: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #991b1b; border-color: #991b1b; }

.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.8125rem 1.5rem; font-size: 0.9375rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled,
.btn-primary[disabled], .btn-secondary[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================================
   7. Forms
   ============================================================ */

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]),
textarea,
select {
    background: #fff;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.5rem;
    transition: border-color 0.12s ease;
}

input:not([class*="p-"]):not([class*="px-"]):not([class*="pl-"]):not([class*="py-"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]),
textarea:not([class*="p-"]):not([class*="px-"]):not([class*="pl-"]):not([class*="py-"]),
select:not([class*="p-"]):not([class*="px-"]):not([class*="pl-"]):not([class*="py-"]) {
    padding: 0.5625rem 0.75rem;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--rule);
    outline: 2px solid var(--rule);
    outline-offset: -2px;
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input[type="checkbox"], input[type="radio"] {
    width: 0.9375rem;
    height: 0.9375rem;
    accent-color: var(--brand);
    cursor: pointer;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23737373'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.125rem;
    padding-right: 2rem;
}

label { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); }

.form-help  { font-size: 0.8125rem; color: var(--text-3); }
.form-error { font-size: 0.8125rem; color: var(--danger); }

ul.errorlist {
    list-style: none;
    margin: 0.375rem 0 0;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--danger);
}

/* ============================================================
   8. Badges - square tags, not pills
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.1875rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-strong);
}

.badge-brand   { color: var(--brand);   border-color: var(--brand-border); }
.badge-success { color: var(--success); border-color: var(--brand-border); }
.badge-warning { color: var(--warning); border-color: #e8dcc0; }
.badge-danger  { color: var(--danger);  border-color: #e8c9c9; }
.badge-info    { color: var(--info);    border-color: #c9d3ee; }

/* ============================================================
   9. Navigation
   ============================================================ */

.nav-link {
    color: var(--text-2);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.nav-link:hover  { color: var(--text); background: transparent; }
.nav-link.active { color: var(--text); border-bottom-color: var(--rule); background: transparent; }

.side-link {
    display: flex;
    align-items: center;
    gap: 0.6875rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    border-left: 2px solid transparent;
    transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.side-link i { width: 1.0625rem; text-align: center; color: var(--text-3); }
.side-link:hover  { background: var(--bg-muted); color: var(--text); }
.side-link.active { border-left-color: var(--rule); color: var(--text); background: var(--bg-muted); }
.side-link.active i { color: var(--text); }

/* ============================================================
   10. Tables
   ============================================================ */

.table-clean { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table-clean th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    padding: 0.625rem 0.875rem 0.625rem 0;
    border-bottom: 1px solid var(--rule);
}
.table-clean td {
    padding: 0.8125rem 0.875rem 0.8125rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}
.table-clean tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
   11. Utilities
   ============================================================ */

.text-muted { color: var(--text-3); }
.text-secondary-c { color: var(--text-2); }
.text-brand { color: var(--brand); }
.text-gradient { color: var(--text); -webkit-text-fill-color: currentColor; }

/* Icons sit inline as marks, not inside coloured bubbles. */
.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    color: var(--text);
    flex-shrink: 0;
}

.section-title { font-size: 1rem; font-weight: 600; color: var(--text); }

.eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
}

.scroll-hidden::-webkit-scrollbar { display: none; }
.scroll-hidden { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   12. Accordion
   ============================================================ */

.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    background: none;
    border: 0;
    cursor: pointer;
}
.faq-q i { color: var(--text-3); transition: transform 0.15s ease; flex-shrink: 0; font-size: 0.75rem; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a {
    display: none;
    padding-bottom: 1.25rem;
    color: var(--text-2);
    max-width: 60ch;
}
.faq-item.open .faq-a { display: block; }

/* ============================================================
   13. Rich text
   ============================================================ */

.prose-content { color: var(--text-2); line-height: 1.75; max-width: 68ch; }
.prose-content > * + * { margin-top: 1rem; }
.prose-content h1, .prose-content h2,
.prose-content h3, .prose-content h4 {
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.prose-content h2 { font-size: 1.375rem; }
.prose-content h3 { font-size: 1.125rem; }
.prose-content p { margin-bottom: 1rem; }
.prose-content a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.prose-content a:hover { color: var(--brand); }
.prose-content ul, .prose-content ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.prose-content ul { list-style: disc; }
.prose-content ol { list-style: decimal; }
.prose-content li { margin-bottom: 0.375rem; }
.prose-content img { max-width: 100%; height: auto; border: 1px solid var(--border); }
.prose-content blockquote {
    border-left: 2px solid var(--rule);
    padding: 0.25rem 0 0.25rem 1rem;
    color: var(--text);
    font-style: normal;
}
.prose-content code {
    background: var(--bg-muted);
    padding: 0.125rem 0.3125rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose-content pre {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
}
.prose-content pre code { background: none; padding: 0; }
.prose-content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.prose-content th, .prose-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
}
.prose-content th { background: var(--bg-subtle); font-weight: 600; color: var(--text); }

/* ============================================================
   14. Empty states
   ============================================================ */

.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.empty-state i { font-size: 1.25rem; color: var(--text-3); margin-bottom: 0.875rem; }
.empty-state h3 { font-size: 1rem; margin-bottom: 0.375rem; }
.empty-state p { font-size: 0.875rem; color: var(--text-3); margin-bottom: 1.25rem; }

/* ============================================================
   15. Print
   ============================================================ */

@media print {
    .no-print, header, footer { display: none !important; }
    body { background: #fff; }
}
