/**
 * FilingLayer — refined "compliance-grade editorial fintech" styles.
 * Token-driven (see tokens.css). Serif display voice, mono for data/labels,
 * deep-teal atmosphere with precise orange accents, orchestrated reveals.
 */

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

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

body {
    margin: 0;
    font-family: var(--fl-font-body);
    font-size: var(--fl-text-base);
    line-height: 1.65;
    color: var(--fl-color-text);
    background: var(--fl-color-bg);
    background-image:
        radial-gradient(60% 50% at 100% 0%, rgba(17,105,122,0.05), transparent 70%),
        radial-gradient(50% 40% at 0% 4%, rgba(196,92,38,0.04), transparent 70%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern", "liga", "cv05";
    text-rendering: optimizeLegibility;
}

::selection { background: var(--fl-color-primary); color: var(--fl-color-cream); }

h1, h2, h3 {
    font-family: var(--fl-font-display);
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -0.018em;
    margin: 0 0 var(--fl-space-4);
    color: var(--fl-color-text);
}
p { margin: 0 0 var(--fl-space-4); }

a { color: var(--fl-color-primary-light); text-decoration: none; transition: color var(--fl-dur-fast) var(--fl-ease); }
a:hover { color: var(--fl-color-primary); }

main { display: block; }

/* ---- Layout ---- */
.fl-container {
    width: 100%;
    max-width: var(--fl-container-max);
    margin: 0 auto;
    padding-inline: var(--fl-container-pad);
}
.fl-section { padding-block: var(--fl-space-12); position: relative; }
.fl-section--tight { padding-block: var(--fl-space-10); }

.fl-section-head { max-width: 46rem; margin-bottom: var(--fl-space-8); }
.fl-section-head h2 { font-size: var(--fl-text-3xl); }

/* ---- Mono label / eyebrow ---- */
.fl-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--fl-font-mono);
    font-weight: 500;
    font-size: var(--fl-label);
    letter-spacing: var(--fl-tracking-label);
    text-transform: uppercase;
    color: var(--fl-color-accent);
    margin-bottom: var(--fl-space-4);
}
.fl-eyebrow::before {
    content: "";
    width: 1.6rem; height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.fl-lead {
    font-size: var(--fl-text-lg);
    line-height: 1.6;
    color: var(--fl-color-text-muted);
    max-width: 44rem;
}

/* ---- Buttons ---- */
.fl-btn {
    --_y: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--fl-font-body);
    font-weight: 600;
    font-size: var(--fl-text-sm);
    letter-spacing: 0.005em;
    line-height: 1;
    padding: 0.85rem 1.4rem;
    border-radius: var(--fl-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transform: translateY(var(--_y));
    transition: transform var(--fl-dur-fast) var(--fl-ease), background var(--fl-dur-fast) var(--fl-ease),
                box-shadow var(--fl-dur-fast) var(--fl-ease), border-color var(--fl-dur-fast) var(--fl-ease), color var(--fl-dur-fast) var(--fl-ease);
}
.fl-btn:hover { text-decoration: none; --_y: -2px; }
.fl-btn:active { --_y: 0; }
.fl-btn:focus-visible { outline: none; box-shadow: var(--fl-ring); }

.fl-btn--primary { background: var(--fl-grad-accent); color: #fff; box-shadow: var(--fl-glow-accent); }
.fl-btn--primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 14px 30px -10px rgba(196,92,38,0.6); }

.fl-btn--dark { background: var(--fl-color-primary); color: var(--fl-color-cream); box-shadow: var(--fl-shadow); }
.fl-btn--dark:hover { background: var(--fl-color-primary-hover); }

.fl-btn--ghost { background: var(--fl-color-surface); color: var(--fl-color-primary); border-color: var(--fl-color-border); box-shadow: var(--fl-shadow-sm); }
.fl-btn--ghost:hover { border-color: var(--fl-color-primary); background: var(--fl-color-surface); }

.fl-btn--lg { padding: 1.05rem 1.8rem; font-size: var(--fl-text-base); border-radius: var(--fl-radius); }

/* ---- Badges / pills ---- */
.fl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--fl-font-mono);
    font-size: var(--fl-text-xs);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.7rem;
    border-radius: var(--fl-radius-pill);
    background: var(--fl-color-bg-warm);
    color: var(--fl-color-text-muted);
    border: 1px solid var(--fl-color-hairline);
    white-space: nowrap;
}
.fl-badge--accent  { background: var(--fl-color-accent-soft); color: var(--fl-color-accent);  border-color: rgba(196,92,38,0.22); }
.fl-badge--warning { background: #f7efdd; color: var(--fl-color-warning); border-color: rgba(163,95,12,0.22); }
.fl-badge--error   { background: #fbeae8; color: var(--fl-color-error);   border-color: rgba(180,35,24,0.20); }
.fl-badge--success { background: #e4f0e8; color: var(--fl-color-success); border-color: rgba(31,107,58,0.22); }

/* ---- Top nav ---- */
.fl-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(246, 247, 245, 0.85); /* fallback */
    background: color-mix(in srgb, var(--fl-color-bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--fl-dur) var(--fl-ease), background var(--fl-dur) var(--fl-ease);
}
.fl-nav::after { content: ""; position: absolute; inset: 0 0 -1px 0; border-bottom: 1px solid var(--fl-color-hairline); opacity: 0.7; pointer-events: none; }
.fl-nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.fl-nav__links { display: flex; align-items: center; gap: var(--fl-space-5); }
.fl-nav__links a:not(.fl-btn) {
    position: relative; color: var(--fl-color-text); font-weight: 500; font-size: var(--fl-text-sm);
}
.fl-nav__links a:not(.fl-btn)::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1.5px;
    background: var(--fl-color-accent); transition: right var(--fl-dur-fast) var(--fl-ease);
}
.fl-nav__links a:not(.fl-btn):hover { color: var(--fl-color-primary); }
.fl-nav__links a:not(.fl-btn):hover::after { right: 0; }

/* ---- Logo lockup ---- */
.fl-logo { display: inline-flex; align-items: center; gap: 0.6rem; }
.fl-logo svg { height: 32px; width: auto; display: block; }
.fl-logo__word { font-family: var(--fl-font-display); font-size: 1.4rem; color: var(--fl-color-text); letter-spacing: -0.02em; }

/* ---- Hero ---- */
.fl-hero { padding-block: var(--fl-space-12) var(--fl-space-10); position: relative; overflow: hidden; }
.fl-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(var(--fl-dot) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(70% 60% at 70% 10%, #000, transparent 75%);
    mask-image: radial-gradient(70% 60% at 70% 10%, #000, transparent 75%);
    opacity: 0.9;
}
.fl-hero h1 { font-size: clamp(2.6rem, 6vw, var(--fl-text-5xl)); max-width: 16ch; margin-top: var(--fl-space-5); }
.fl-hero__highlight {
    color: var(--fl-color-primary);
    font-style: italic;
    position: relative;
}
.fl-hero__cta { display: flex; flex-wrap: wrap; gap: var(--fl-space-3); margin-top: var(--fl-space-6); }
.fl-hero__note {
    margin-top: var(--fl-space-4); font-family: var(--fl-font-mono); font-size: var(--fl-text-xs);
    letter-spacing: 0.02em; color: var(--fl-color-text-faint);
}

/* ---- Dashboard preview card ---- */
.fl-preview {
    margin-top: var(--fl-space-8);
    background: var(--fl-color-surface);
    border: 1px solid var(--fl-color-border);
    border-radius: var(--fl-radius-lg);
    box-shadow: var(--fl-shadow-lg);
    overflow: hidden;
}
.fl-preview__bar {
    display: flex; align-items: center; gap: var(--fl-space-3);
    padding: var(--fl-space-3) var(--fl-space-4);
    background: var(--fl-grad-ink); color: var(--fl-color-cream);
    font-family: var(--fl-font-mono); font-size: var(--fl-text-xs); letter-spacing: 0.04em;
}
.fl-preview__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(244,241,234,0.35); }
.fl-preview__dot:first-child { background: var(--fl-color-accent); opacity: 0.85; }

.fl-table { width: 100%; border-collapse: collapse; font-size: var(--fl-text-sm); }
.fl-table th, .fl-table td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--fl-color-border-subtle); }
.fl-table thead th {
    font-family: var(--fl-font-mono); font-weight: 500; font-size: var(--fl-text-xs);
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--fl-color-text-faint);
    background: var(--fl-color-surface-2);
}
.fl-table tbody tr { transition: background var(--fl-dur-fast) var(--fl-ease); }
.fl-table tbody tr:hover { background: var(--fl-color-surface-2); }
.fl-table tbody tr:last-child td { border-bottom: 0; }
.fl-table td.fl-num, .fl-num { font-family: var(--fl-font-mono); font-variant-numeric: tabular-nums; color: var(--fl-color-text-muted); }
.fl-table a { color: var(--fl-color-text); font-weight: 600; }
.fl-table a:hover { color: var(--fl-color-primary); }

/* ---- Grids / cards ---- */
.fl-grid { display: grid; gap: var(--fl-space-5); }
.fl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.fl-grid--2 { grid-template-columns: repeat(2, 1fr); }

.fl-card {
    position: relative;
    background: var(--fl-color-surface);
    border: 1px solid var(--fl-color-border-subtle);
    border-radius: var(--fl-radius-lg);
    padding: var(--fl-space-6);
    box-shadow: var(--fl-shadow-sm);
    transition: transform var(--fl-dur) var(--fl-ease), box-shadow var(--fl-dur) var(--fl-ease), border-color var(--fl-dur) var(--fl-ease);
}
.fl-card:hover { transform: translateY(-4px); box-shadow: var(--fl-shadow-md); border-color: var(--fl-color-border); }
.fl-card h3 { font-family: var(--fl-font-body); font-weight: 700; font-size: var(--fl-text-lg); letter-spacing: -0.01em; }
.fl-card p { color: var(--fl-color-text-muted); margin-bottom: 0; }
.fl-card__step {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: var(--fl-radius);
    background: var(--fl-color-primary-soft); color: var(--fl-color-primary);
    font-family: var(--fl-font-mono); font-size: var(--fl-text-lg); font-weight: 500;
    margin-bottom: var(--fl-space-4); border: 1px solid rgba(13,79,92,0.12);
}

/* ---- Dark band ---- */
.fl-band { background: var(--fl-grad-ink); color: var(--fl-color-cream); position: relative; overflow: hidden; }
.fl-band::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(244,241,234,0.05) 1px, transparent 1px); background-size: 30px 30px;
    opacity: 0.5;
}
.fl-band > * { position: relative; }
.fl-band h2, .fl-band h3 { color: #fff; }
.fl-band .fl-lead { color: rgba(244,241,234,0.78); }
.fl-band .fl-eyebrow { color: #e89a6b; }

/* ---- Pricing ---- */
.fl-plan {
    display: flex; flex-direction: column;
    background: var(--fl-color-surface);
    border: 1px solid var(--fl-color-border);
    border-radius: var(--fl-radius-lg);
    padding: var(--fl-space-8);
    box-shadow: var(--fl-shadow);
}
.fl-plan--featured { border-color: var(--fl-color-primary); box-shadow: var(--fl-shadow-md); position: relative; }
.fl-plan--featured::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 0 1px var(--fl-color-primary) inset;
}
.fl-plan h3 { font-family: var(--fl-font-display); font-weight: 400; font-size: var(--fl-text-xl); }
.fl-plan__price { font-family: var(--fl-font-display); font-size: var(--fl-text-4xl); color: var(--fl-color-primary); line-height: 1; margin: var(--fl-space-2) 0; }
.fl-plan__price small { font-family: var(--fl-font-mono); font-size: var(--fl-text-sm); color: var(--fl-color-text-muted); letter-spacing: 0; }
.fl-plan ul { list-style: none; padding: 0; margin: var(--fl-space-5) 0; flex: 1; }
.fl-plan li { padding: 0.5rem 0 0.5rem 1.8rem; position: relative; font-size: var(--fl-text-sm); border-bottom: 1px solid var(--fl-color-border-subtle); }
.fl-plan li:last-child { border-bottom: 0; }
.fl-plan li::before { content: "✓"; position: absolute; left: 0; top: 0.5rem; color: var(--fl-color-success); font-weight: 700; }

/* ---- Forms / auth ---- */
.fl-form { display: flex; gap: var(--fl-space-3); flex-wrap: wrap; max-width: 34rem; }
.fl-form input[type="email"], .fl-form input[type="text"] {
    flex: 1; min-width: 14rem; padding: 0.9rem 1rem; font-size: var(--fl-text-base); font-family: var(--fl-font-body);
    border: 1px solid var(--fl-color-border); border-radius: var(--fl-radius); background: var(--fl-color-surface); color: var(--fl-color-text);
    transition: border-color var(--fl-dur-fast) var(--fl-ease), box-shadow var(--fl-dur-fast) var(--fl-ease);
}
.fl-form input:focus { outline: none; border-color: var(--fl-color-primary-light); box-shadow: var(--fl-ring); }

.fl-auth { max-width: 30rem; margin-inline: auto; }
.fl-auth__card { padding: var(--fl-space-8); box-shadow: var(--fl-shadow-md); }
.fl-stack { display: flex; flex-direction: column; gap: var(--fl-space-4); }
.fl-field { display: flex; flex-direction: column; gap: var(--fl-space-2); }
.fl-field span { font-size: var(--fl-text-sm); font-weight: 600; color: var(--fl-color-text); }
.fl-field input, .fl-field textarea {
    padding: 0.85rem 1rem; font-size: var(--fl-text-base); font-family: var(--fl-font-body);
    border: 1px solid var(--fl-color-border); border-radius: var(--fl-radius); background: var(--fl-color-surface); color: var(--fl-color-text);
    transition: border-color var(--fl-dur-fast) var(--fl-ease), box-shadow var(--fl-dur-fast) var(--fl-ease);
}
.fl-field input:focus, .fl-field textarea:focus { outline: none; border-color: var(--fl-color-primary-light); box-shadow: var(--fl-ring); }
.fl-field input:disabled { background: var(--fl-color-bg-warm); color: var(--fl-color-text-muted); }

.fl-flash { padding: var(--fl-space-3) var(--fl-space-4); border-radius: var(--fl-radius); margin-bottom: var(--fl-space-4); font-size: var(--fl-text-sm); border: 1px solid transparent; }
.fl-flash--success { background: #e4f0e8; color: var(--fl-color-success); border-color: rgba(31,107,58,0.18); }
.fl-flash--error { background: #fbeae8; color: var(--fl-color-error); border-color: rgba(180,35,24,0.16); }

/* ---- Company search type-ahead ---- */
.fl-search { position: relative; max-width: 42rem; }
.fl-search__input {
    width: 100%; padding: 0.95rem 1.1rem 0.95rem 2.6rem; font-size: var(--fl-text-base); font-family: var(--fl-font-body);
    border: 1px solid var(--fl-color-border); border-radius: var(--fl-radius); background: var(--fl-color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235c6661' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 0.9rem center;
    color: var(--fl-color-text);
    transition: border-color var(--fl-dur-fast) var(--fl-ease), box-shadow var(--fl-dur-fast) var(--fl-ease);
}
.fl-search__input:focus { outline: none; border-color: var(--fl-color-primary-light); box-shadow: var(--fl-ring); }
.fl-search__results {
    position: absolute; z-index: 40; left: 0; right: 0; margin-top: 6px;
    background: var(--fl-color-surface); border: 1px solid var(--fl-color-border); border-radius: var(--fl-radius);
    box-shadow: var(--fl-shadow-md); overflow: hidden; max-height: 22rem; overflow-y: auto;
}
.fl-search__item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--fl-color-border-subtle); background: transparent; padding: 0.7rem 1rem; cursor: pointer; font-family: var(--fl-font-body); }
.fl-search__item:last-child { border-bottom: 0; }
.fl-search__item:hover, .fl-search__item:focus { background: var(--fl-color-primary-soft); outline: none; }
.fl-search__title { display: block; font-weight: 600; font-size: var(--fl-text-sm); color: var(--fl-color-text); }
.fl-search__meta { display: block; font-family: var(--fl-font-mono); font-size: var(--fl-text-xs); color: var(--fl-color-text-faint); }
.fl-search__empty { padding: 0.9rem 1rem; color: var(--fl-color-text-muted); font-size: var(--fl-text-sm); }

/* ---- Dashboard stat cards ---- */
.fl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--fl-space-4); }
.fl-stat {
    position: relative; background: var(--fl-color-surface);
    border: 1px solid var(--fl-color-border-subtle); border-left: 3px solid var(--fl-color-hairline);
    border-radius: var(--fl-radius); padding: var(--fl-space-5);
    box-shadow: var(--fl-shadow-sm);
    transition: transform var(--fl-dur) var(--fl-ease), box-shadow var(--fl-dur) var(--fl-ease);
}
.fl-stat:hover { transform: translateY(-3px); box-shadow: var(--fl-shadow); }
.fl-stat__num { display: block; font-family: var(--fl-font-display); font-size: var(--fl-text-3xl); color: var(--fl-color-primary); line-height: 1; }
.fl-stat__label { display: block; margin-top: var(--fl-space-3); font-family: var(--fl-font-mono); font-size: var(--fl-text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fl-color-text-faint); }
.fl-stat--alert { border-left-color: var(--fl-color-error); }
.fl-stat--alert .fl-stat__num { color: var(--fl-color-error); }
.fl-stat--warn { border-left-color: var(--fl-color-warning); }
.fl-stat--warn .fl-stat__num { color: var(--fl-color-warning); }

/* ---- Suite cross-links ---- */
.fl-suite-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fl-space-4); }
.fl-suite-item {
    display: block; padding: var(--fl-space-5); border: 1px solid var(--fl-color-border-subtle);
    border-radius: var(--fl-radius); background: var(--fl-color-surface); color: var(--fl-color-text);
    box-shadow: var(--fl-shadow-sm); transition: transform var(--fl-dur) var(--fl-ease), box-shadow var(--fl-dur) var(--fl-ease), border-color var(--fl-dur) var(--fl-ease);
}
.fl-suite-item:hover { transform: translateY(-3px); border-color: var(--fl-color-primary); box-shadow: var(--fl-shadow); text-decoration: none; }
.fl-suite-item strong { font-family: var(--fl-font-display); font-weight: 400; font-size: var(--fl-text-lg); display: block; margin-bottom: 0.25rem; }
.fl-suite-item span { display: block; color: var(--fl-color-text-muted); font-size: var(--fl-text-sm); }
.fl-suite-item--self { border-color: var(--fl-color-primary); background: var(--fl-color-primary-soft); }

/* ---- Footer ---- */
.fl-footer { background: var(--fl-grad-ink); color: rgba(244,241,234,0.72); padding-block: var(--fl-space-10) var(--fl-space-6); font-size: var(--fl-text-sm); position: relative; }
.fl-footer a { color: rgba(244,241,234,0.86); }
.fl-footer a:hover { color: #fff; }
.fl-footer__cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--fl-space-8); margin-bottom: var(--fl-space-8); }
.fl-footer__legal { border-top: 1px solid rgba(244,241,234,0.14); padding-top: var(--fl-space-5); font-family: var(--fl-font-mono); font-size: var(--fl-text-xs); letter-spacing: 0.02em; color: rgba(244,241,234,0.5); }

/* ---- Disclaimer ---- */
.fl-disclaimer {
    font-size: var(--fl-text-sm); color: var(--fl-color-text-muted);
    background: var(--fl-color-surface); border: 1px solid var(--fl-color-border-subtle);
    border-left: 3px solid var(--fl-color-accent); padding: var(--fl-space-4) var(--fl-space-5);
    border-radius: var(--fl-radius-sm); box-shadow: var(--fl-shadow-sm);
}

/* ---- Motion: scroll reveal (progressive enhancement) ---- */
.fl-js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity var(--fl-dur) var(--fl-ease-out), transform var(--fl-dur) var(--fl-ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.fl-js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    .fl-js [data-reveal] { opacity: 1; transform: none; }
}

/* ---- Responsive ---- */
@media (max-width: 920px) {
    .fl-grid--3, .fl-price-grid, .fl-suite-grid { grid-template-columns: 1fr; }
    .fl-grid--2 { grid-template-columns: 1fr; }
    .fl-stats { grid-template-columns: repeat(2, 1fr); }
    .fl-section-head h2 { font-size: var(--fl-text-2xl); }
    .fl-nav__links a:not(.fl-btn) { display: none; }
}
@media (max-width: 560px) {
    .fl-stats { grid-template-columns: 1fr; }
    .fl-container { padding-inline: 1.1rem; }
}
