/* ─────────────────────────────────────────────────────────────────────────────
   FiveBot design system
   Part of the FiveHub family (FiveHost · FiveManage · FiveBot · FiveMonitor).
   Light theme + DM Sans + Discord blurple — matching fivehub.co.uk.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    /* Surfaces */
    --fb-background:     #ffffff;
    --fb-surface:        #ffffff;
    --fb-surface-alt:    #f7f7f5;
    --fb-surface-hover:  #f1f1ee;

    /* Text */
    --fb-foreground:     #1a1a1a;
    --fb-muted:          #6b6b6b;
    --fb-muted-2:        #9b9b9b;
    --fb-disabled:       #bfbfbf;

    /* Borders (thin, airy) */
    --fb-border:         rgba(0, 0, 0, 0.07);
    --fb-border-strong:  rgba(0, 0, 0, 0.14);
    --fb-ring:           #5865F2;

    /* Primary — Discord blurple (FiveBot accent in the FiveHub family) */
    --fb-primary:        #5865F2;
    --fb-primary-hover:  #4752c4;
    --fb-primary-active: #3c45a5;
    --fb-primary-fg:     #ffffff;
    --fb-primary-soft:   rgba(88, 101, 242, 0.08);
    --fb-primary-soft-2: rgba(88, 101, 242, 0.16);
    --fb-primary-tint:   #eef0ff;

    /* Status */
    --fb-success:        #16a34a;
    --fb-success-soft:   #e7f6ec;
    --fb-danger:         #dc2626;
    --fb-danger-hover:   #b91c1c;
    --fb-danger-soft:    #fdeaea;
    --fb-warning:        #d97706;
    --fb-warning-soft:   #fcf1e1;
    --fb-info:           #2563eb;
    --fb-info-soft:      #e8efff;

    /* Sibling accents (for cross-family components) */
    --fb-fivehost:       #0F6E56;
    --fb-fivemanage:     #2E6AD1;
    --fb-fivemonitor:    #E63946;
    --fb-fivehub:        #FF9000;

    /* Radii — rounder to match the FiveHub family */
    --fb-radius-sm: 0.5rem;
    --fb-radius:    0.75rem;
    --fb-radius-lg: 1rem;
    --fb-radius-xl: 1.25rem;
    --fb-radius-pill: 999px;

    /* Shadows — soft and diffuse, not harsh */
    --fb-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --fb-shadow:    0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    --fb-shadow-md: 0 4px 12px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -1px rgba(16, 24, 40, 0.04);
    --fb-shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, 0.10), 0 4px 10px -2px rgba(16, 24, 40, 0.06);
    --fb-shadow-primary: 0 8px 24px -6px rgba(88, 101, 242, 0.35);

    /* Typography — DM Sans across the whole FiveHub family */
    --fb-font-sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fb-font-mono: ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

    /* Layout */
    --fb-container: 1180px;
    --fb-sidebar:   240px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--fb-font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--fb-foreground);
    background: var(--fb-background);
    font-feature-settings: 'ss01', 'ss02';
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--fb-font-mono); }
hr { border: 0; border-top: 1px solid var(--fb-border); margin: 1.5rem 0; }

::selection { background: var(--fb-primary-soft-2); color: var(--fb-foreground); }

:focus-visible {
    outline: 2px solid var(--fb-ring);
    outline-offset: 2px;
    border-radius: var(--fb-radius-sm);
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--fb-foreground);
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem);  line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
h3 { font-size: 1.375rem; line-height: 1.3; font-weight: 600; }
h4 { font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
h5 { font-size: 1rem;     line-height: 1.4;  font-weight: 600; }
h6 { font-size: 0.75rem;  line-height: 1.4;  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--fb-muted-2); }

p { margin: 0 0 1rem; color: var(--fb-muted); }
p:last-child { margin-bottom: 0; }

.fb-muted    { color: var(--fb-muted); }
.fb-muted-2  { color: var(--fb-muted-2); }
.fb-primary  { color: var(--fb-primary); }
.fb-danger   { color: var(--fb-danger); }
.fb-success  { color: var(--fb-success); }

.fb-mono     { font-family: var(--fb-font-mono); font-size: 0.875em; }
.fb-lead     { font-size: 1.125rem; color: var(--fb-muted); line-height: 1.55; }
.fb-small    { font-size: 0.8125rem; }

/* ── Layout primitives ──────────────────────────────────────────────────── */

.fb-container {
    width: 100%;
    max-width: var(--fb-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.fb-container-sm { max-width: 640px; }
.fb-container-md { max-width: 860px; }

.fb-stack      { display: flex; flex-direction: column; gap: 1rem; }
.fb-stack-sm   { display: flex; flex-direction: column; gap: 0.5rem; }
.fb-stack-lg   { display: flex; flex-direction: column; gap: 1.5rem; }

.fb-row        { display: flex; align-items: center; gap: 0.75rem; }
.fb-row-sm     { display: flex; align-items: center; gap: 0.5rem; }
.fb-row-lg     { display: flex; align-items: center; gap: 1.5rem; }
.fb-row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

.fb-grid       { display: grid; gap: 1rem; }
.fb-grid-2     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fb-grid-3     { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fb-grid-4     { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 768px) {
    .fb-grid-2, .fb-grid-3, .fb-grid-4 { grid-template-columns: 1fr; }
}

.fb-spacer-sm { height: 1rem; }
.fb-spacer    { height: 2rem; }
.fb-spacer-lg { height: 4rem; }

/* ── Brand mark ─────────────────────────────────────────────────────────── */

.fb-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--fb-foreground);
}

.fb-brand-accent { color: var(--fb-primary); }

.fb-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
}

.fb-brand-mark-lg {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.fb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--fb-radius);
    border: 1px solid transparent;
    background: var(--fb-primary);
    color: var(--fb-primary-fg);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    white-space: nowrap;
    user-select: none;
    box-shadow: var(--fb-shadow-sm);
}
.fb-btn:hover  { background: var(--fb-primary-hover); box-shadow: var(--fb-shadow-primary); transform: translateY(-1px); }
.fb-btn:active { background: var(--fb-primary-active); transform: translateY(0); box-shadow: var(--fb-shadow-sm); }
.fb-btn:disabled,
.fb-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.fb-btn-secondary {
    background: var(--fb-surface);
    color: var(--fb-foreground);
    border-color: var(--fb-border-strong);
    box-shadow: var(--fb-shadow-sm);
}
.fb-btn-secondary:hover  { background: var(--fb-surface-alt); border-color: rgba(0, 0, 0, 0.2); box-shadow: var(--fb-shadow-sm); transform: translateY(-1px); }
.fb-btn-secondary:active { background: var(--fb-surface-hover); transform: translateY(0); }

.fb-btn-ghost {
    background: transparent;
    color: var(--fb-muted);
    box-shadow: none;
}
.fb-btn-ghost:hover  { background: var(--fb-surface-alt); color: var(--fb-foreground); box-shadow: none; transform: none; }
.fb-btn-ghost:active { background: var(--fb-surface-hover); }

.fb-btn-danger  { background: var(--fb-danger); color: #fff; }
.fb-btn-danger:hover  { background: var(--fb-danger-hover); box-shadow: 0 8px 24px -6px rgba(220, 38, 38, 0.4); }

.fb-btn-lg { height: 3rem; padding: 0 1.5rem; font-size: 1rem; border-radius: var(--fb-radius-lg); }
.fb-btn-sm { height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: var(--fb-radius-sm); }

.fb-btn-block { width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────────────── */

.fb-card {
    background: var(--fb-surface);
    border: 1px solid var(--fb-border);
    border-radius: var(--fb-radius-lg);
    box-shadow: var(--fb-shadow-sm);
    padding: 1.75rem;
}

.fb-card-compact { padding: 1.25rem; }

.fb-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--fb-foreground);
    margin: 0 0 0.25rem;
}

.fb-card-description {
    font-size: 0.875rem;
    color: var(--fb-muted);
    margin: 0 0 1.25rem;
}

.fb-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--fb-border);
}

.fb-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--fb-border);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.fb-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fb-foreground);
    margin-bottom: 0.375rem;
}

.fb-input,
.fb-textarea,
.fb-select {
    width: 100%;
    height: 2.625rem;
    padding: 0 0.875rem;
    font-size: 0.9375rem;
    background: var(--fb-surface);
    border: 1px solid var(--fb-border-strong);
    border-radius: var(--fb-radius);
    color: var(--fb-foreground);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.fb-textarea { height: auto; min-height: 7rem; padding: 0.625rem 0.875rem; resize: vertical; line-height: 1.55; }
.fb-select   { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%236b6b6b'><path d='M5.5 7.5l4.5 5 4.5-5z'/></svg>"); background-repeat: no-repeat; background-position: right 0.75rem center; }

.fb-input::placeholder,
.fb-textarea::placeholder { color: var(--fb-muted-2); }

.fb-input:hover,
.fb-textarea:hover,
.fb-select:hover { border-color: rgba(0, 0, 0, 0.22); }

.fb-input:focus,
.fb-textarea:focus,
.fb-select:focus {
    outline: none;
    border-color: var(--fb-primary);
    box-shadow: 0 0 0 4px var(--fb-primary-soft);
}

.fb-input:disabled,
.fb-textarea:disabled,
.fb-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--fb-surface-alt);
}

.fb-input-error {
    border-color: var(--fb-danger);
}
.fb-input-error:focus {
    box-shadow: 0 0 0 4px var(--fb-danger-soft);
}

.fb-field-hint  { font-size: 0.8125rem; color: var(--fb-muted-2); margin-top: 0.375rem; }
.fb-field-error { font-size: 0.8125rem; color: var(--fb-danger);   margin-top: 0.375rem; }

/* ── Badges ─────────────────────────────────────────────────────────────── */

.fb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    height: 1.5rem;
    padding: 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--fb-radius-pill);
    background: var(--fb-surface-alt);
    color: var(--fb-muted);
    border: 1px solid var(--fb-border);
}

.fb-badge-primary { background: var(--fb-primary-tint); color: var(--fb-primary); border-color: transparent; }
.fb-badge-success { background: var(--fb-success-soft); color: var(--fb-success); border-color: transparent; }
.fb-badge-danger  { background: var(--fb-danger-soft);  color: var(--fb-danger);  border-color: transparent; }
.fb-badge-warning { background: var(--fb-warning-soft); color: var(--fb-warning); border-color: transparent; }
.fb-badge-info    { background: var(--fb-info-soft);    color: var(--fb-info);    border-color: transparent; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */

.fb-alert {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    border-radius: var(--fb-radius);
    background: var(--fb-surface-alt);
    border: 1px solid var(--fb-border);
    color: var(--fb-foreground);
    font-size: 0.9375rem;
}
.fb-alert-success { background: var(--fb-success-soft); border-color: transparent; color: #065f46; }
.fb-alert-danger  { background: var(--fb-danger-soft);  border-color: transparent; color: #991b1b; }
.fb-alert-warning { background: var(--fb-warning-soft); border-color: transparent; color: #92400e; }
.fb-alert-info    { background: var(--fb-info-soft);    border-color: transparent; color: #1e40af; }

/* ── Links ──────────────────────────────────────────────────────────────── */

.fb-link {
    color: var(--fb-primary);
    text-decoration: none;
    transition: color 120ms ease;
}
.fb-link:hover { color: var(--fb-primary-hover); text-decoration: underline; }

/* ── Page shells ────────────────────────────────────────────────────────── */

.fb-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--fb-background);
}

.fb-page-header {
    border-bottom: 1px solid var(--fb-border);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 20;
}

.fb-page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 68px;
}

.fb-page-main {
    flex: 1;
    padding: 2.5rem 0 5rem;
}

.fb-page-footer {
    border-top: 1px solid var(--fb-border);
    padding: 2rem 0;
    font-size: 0.8125rem;
    color: var(--fb-muted-2);
}

.fb-page-footer a { color: var(--fb-muted); transition: color 120ms ease; }
.fb-page-footer a:hover { color: var(--fb-foreground); }

/* ── Prose (long-form text pages: privacy, terms) ───────────────────────── */

.fb-prose {
    max-width: 70ch;
    color: var(--fb-muted);
    font-size: 1rem;
    line-height: 1.7;
}
.fb-prose h1, .fb-prose h2, .fb-prose h3 { color: var(--fb-foreground); margin-top: 2rem; margin-bottom: 0.75rem; }
.fb-prose h1:first-child,
.fb-prose h2:first-child,
.fb-prose h3:first-child { margin-top: 0; }
.fb-prose h2 { font-size: 1.25rem; }
.fb-prose h3 { font-size: 1rem; }
.fb-prose p { margin: 0 0 1rem; }
.fb-prose a { color: var(--fb-primary); }
.fb-prose a:hover { color: var(--fb-primary-hover); text-decoration: underline; }
.fb-prose ul, .fb-prose ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.fb-prose li { margin-bottom: 0.375rem; }
.fb-prose strong { color: var(--fb-foreground); font-weight: 600; }
.fb-prose code { background: var(--fb-surface-alt); padding: 0.125rem 0.375rem; border-radius: var(--fb-radius-sm); font-size: 0.875em; color: var(--fb-foreground); border: 1px solid var(--fb-border); }

/* ── Utility classes ────────────────────────────────────────────────────── */

.fb-text-center { text-align: center; }
.fb-text-right  { text-align: right; }
.fb-flex-1      { flex: 1; }
.fb-hidden      { display: none !important; }

.fb-mt-0 { margin-top: 0; }
.fb-mt-1 { margin-top: 0.5rem; }
.fb-mt-2 { margin-top: 1rem; }
.fb-mt-3 { margin-top: 1.5rem; }
.fb-mt-4 { margin-top: 2rem; }

.fb-mb-0 { margin-bottom: 0; }
.fb-mb-1 { margin-bottom: 0.5rem; }
.fb-mb-2 { margin-bottom: 1rem; }
.fb-mb-3 { margin-bottom: 1.5rem; }
.fb-mb-4 { margin-bottom: 2rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
