/*
 * Home and upload pages: hero, pricing tiers, dropzone, and the
 * per-column chip controls.
 *
 * Extracted from upload.html so the page carries no inline <style>,
 * which is what lets the Content-Security-Policy drop 'unsafe-inline'
 * from style-src (see CONTENT_SECURITY_POLICY in web/app.py).
 *
 * Deliberately NOT extracted from report_download.html: that template
 * is rendered to a file and bundled into the download zip, then
 * opened from disk. A <link> to /static would resolve to nothing
 * there, so its styles must stay inline to keep the report
 * self-contained - and no CSP applies to it, since it is never served
 * as a response.
 */
html { scroll-behavior: smooth; }

/* ---------- hero ---------- */
.hero {
    position: relative;
    text-align: center;
    padding: 1rem 0 2.5rem;
    overflow: hidden;
}
/* Faint dot-grid, faded out toward the edges - matches the hero on
   site/index.html (the marketing site sharing this app's design
   tokens exactly, see the note at the top of app.css) so the app
   isn't a visibly plainer version of its own brand. --grid-line is the
   same colour as that page's --grid-line. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 85%);
    opacity: 0.7;
    pointer-events: none;
}
/* Positioned (not just in normal flow) so it paints above ::before -
   an absolutely-positioned pseudo-element with the default z-index:
   auto otherwise paints over in-flow content regardless of source
   order. */
.hero-inner {
    position: relative;
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0;
}
.hero-h1 {
    font-family: var(--font-mono);
    font-size: clamp(1.7rem, 4.5vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0.6rem 0 0.8rem;
}
.hero-h1 .clean-word { color: var(--clean); }
.hero-lede {
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 34rem;
    margin: 0 auto;
}
.hero-ctas {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}
.hero-microcopy {
    margin-top: 0.9rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* ---------- formula bar + before/after mockup ---------- */
.fx-mock {
    max-width: 42rem;
    margin: 2.2rem auto 0;
    text-align: left;
}
.fx-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #171e2b;
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.fx-icon { font-style: italic; font-weight: 700; color: rgba(255,255,255,0.35); font-size: 0.8rem; }
.fx-formula { color: rgba(255,255,255,0.85); }
.fx-formula .fn { color: #6fe3b5; font-weight: 600; }
.fx-dots { margin-left: auto; display: flex; gap: 0.3rem; }
.fx-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.15); display: block; }
.compare-shell { background: #10151e; border-radius: 0 0 var(--radius) var(--radius); padding: 1.2rem; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.compare-panel { background: #171e2b; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); overflow: hidden; }
.compare-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 0.7rem 0.8rem 0;
    margin: 0;
}
.compare-panel table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.72rem; table-layout: fixed; }
.compare-panel th { text-align: left; font-weight: 600; color: rgba(255,255,255,0.45); padding: 0.55rem 0.7rem 0.45rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.compare-panel td { padding: 0.5rem 0.7rem; color: rgba(255,255,255,0.85); border-bottom: 1px solid rgba(255,255,255,0.06); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-panel tr:last-child td { border-bottom: none; }
.compare-panel td.bad { color: #f0857c; }
.compare-panel td.fixed { color: #6fe3b5; }
.compare-panel tr.removed td { color: rgba(255,255,255,0.28); text-decoration: line-through; font-style: italic; }
.compare-arrows { display: flex; flex-direction: column; gap: 0.55rem; color: rgba(255,255,255,0.3); font-size: 0.85rem; }
@media (max-width: 640px) {
    .compare-grid { grid-template-columns: 1fr; }
    .compare-arrows { display: none; }
}

/* ---------- clean pills ---------- */
.clean-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1.2rem; }
.clean-pill {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--grid-line);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}
.clean-pill-more { font-style: italic; color: var(--ink-faint); background: transparent; border-style: dashed; }
.paid-tag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--soon);
    background: var(--soon-soft);
    border: 1px solid var(--soon-line);
    padding: 0.05rem 0.35rem;
    border-radius: 10px;
    margin-left: 0.4rem;
    vertical-align: 1px;
}

/* ---------- section shell ---------- */
.section-band { padding: 2.5rem 0; }
/* Full-bleed alternating band - the marketing site breaks its "how
   it works"/pricing-equivalent sections out to a white band edge to
   edge (see .alt in site/index.html) rather than leaving every
   section on the same flat page background the whole way down, which
   is a big part of why a plain 1:1 port of that page's content here
   read flatter than the page it's supposed to match. main is
   centered with its own side padding, so breaking a child out to the
   full viewport width needs the standard 100vw/50% trick rather than
   a plain width:100%, which would only fill main's already-inset
   content column. Shared by both .section-band (how it works) and
   .pricing-section, so this targets the .alt class directly rather
   than either one specifically.
   Everything the band contains then needs its own max-width back
   (see the rule below) - .steps/.chip-grid/.pricing-grid otherwise
   have none of their own, since they never used to need it inside
   main's already-constrained column. .section-head is deliberately
   excluded: its own narrower max-width (prose-width, not
   content-column-width) is what it should keep. */
.alt {
    background: var(--surface);
    border-top: 1px solid var(--grid-line);
    border-bottom: 1px solid var(--grid-line);
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.alt > .steps,
.alt > .chip-grid,
.alt > .pricing-grid,
.alt > .pricing-currency-note {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.section-head { max-width: 34rem; margin: 0 auto 1.75rem; text-align: center; }
.section-head h2 {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    margin: 0.4rem 0 0;
    letter-spacing: -0.01em;
}
.section-head p { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.5rem; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.step { background: var(--surface); border: 1px solid var(--grid-line); border-radius: var(--radius); padding: 1.2rem 1.1rem; }
.step-num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--clean); margin-bottom: 0.6rem; }
.step h3 { font-size: 0.95rem; margin: 0 0 0.35rem; }
.step p { color: var(--ink-soft); font-size: 0.83rem; margin: 0; }

/* ---------- what we clean ---------- */
.chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.chip { background: var(--bg); border: 1px solid var(--grid-line); border-radius: var(--radius); padding: 0.9rem; display: flex; align-items: flex-start; gap: 0.6rem; }
.chip-mark { font-family: var(--font-mono); color: var(--messy); font-weight: 700; font-size: 0.78rem; line-height: 1.4; }
.chip-body h4 { margin: 0 0 0.2rem; font-size: 0.82rem; font-weight: 600; }
.chip-body p { margin: 0; font-size: 0.75rem; color: var(--ink-soft); }

@media (max-width: 720px) {
    .steps, .chip-grid { grid-template-columns: 1fr; }
}

.pricing-section { padding: 2.5rem 0 1rem; }
.pricing-currency-note { text-align: center; margin-top: 0.75rem; }
.pricing-gate-prompt {
    margin: -0.75rem 0 1.5rem;
    font-size: 0.85rem;
}
/* Shown under a disabled tier once the dropped file's row count or
   size rules it out - not shown for a tier that's simply not chosen
   yet (see updatePricingAvailability in upload.js). */
.tier-availability {
    margin: 0.4rem 0 0;
    font-size: 0.76rem;
    color: var(--ink-faint);
}
.tier-availability.tier-unavailable {
    color: var(--messy);
}

.dropzone {
    border: 2px dashed var(--grid-line);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dropzone-active {
    border-color: var(--clean);
    background: var(--clean-soft);
}
.dropzone p { margin: 0.2rem 0; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--grid-line);
    border-radius: var(--radius);
    padding: 1.4rem 1.4rem 1.5rem;
}
.pricing-card-featured {
    border-color: var(--clean-line);
    box-shadow: 0 0 0 1px var(--clean-line);
}
.pricing-badge {
    position: absolute;
    top: 1.1rem;
    right: 1.4rem;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--clean);
    background: var(--clean-soft);
    border: 1px solid var(--clean-line);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}
.pricing-tier-name {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.pricing-amount {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0.3rem 0 0;
}
.pricing-amount-unit {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-soft);
}
.pricing-period {
    margin: 0.1rem 0 1rem;
    font-size: 0.78rem;
    color: var(--ink-faint);
}
.pricing-features {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    flex-grow: 1;
}
.pricing-features li {
    font-size: 0.85rem;
    padding: 0.3rem 0 0.3rem 1.3rem;
    position: relative;
}
.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--clean);
    font-weight: 700;
}
.pricing-cta {
    text-align: center;
    width: 100%;
}
.pricing-tier-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.pricing-tier-options[hidden] { display: none; }
.pricing-tier-options form { margin: 0; }
.pricing-tier-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    font-weight: 500;
}
.column-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    margin: 1.1rem 0;
}
.column-chip {
    border: 1px solid var(--grid-line);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    font-size: 0.85rem;
    position: relative;
    transition: border-color 0.12s, background 0.12s;
}
.column-chip-interactive { cursor: pointer; }
.column-chip-interactive:hover { border-color: var(--clean); background: var(--clean-soft); }
.column-chip .col-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.column-chip .col-type {
    display: inline-block;
    color: var(--ink-faint);
    background: var(--bg);
    border: 1px solid var(--grid-line);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
/* Only an interactive chip (date/email/address, or an
   ambiguous-format phone - see isInteractive in the script below)
   has anything to click into, so only those get the accent
   treatment - an inert "Unknown"/"Text" chip staying neutral
   makes the difference visible at a glance, not just on hover. */
.column-chip-interactive .col-type {
    color: var(--clean);
    background: var(--clean-soft);
    border-color: var(--clean-line);
}
.column-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--grid-line);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    z-index: 10;
    width: max-content;
    max-width: 16rem;
    font-size: 0.8rem;
}
.column-options label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
}
