/*
 * Design system for DatumParser — Milestone 10 (Section 13).
 *
 * Extracted from two Claude Design mockups (html_parser.html = Excel to
 * DXF upload page, homepage_parser.html = homepage). Colors are kept as
 * oklch() exactly as authored there. Clean, minimal, card/border-based —
 * no gradients, shadows, or animation gimmicks, per Section 3's frontend
 * reasoning.
 */

:root {
    --color-bg: oklch(98.4% 0.004 250);
    --color-text: oklch(22% 0.006 250);
    --color-text-muted: oklch(48% 0.006 250);
    --color-text-faint: oklch(58% 0.006 250);
    --color-border: oklch(88% 0.004 250);
    --color-border-strong: oklch(78% 0.006 250);
    --color-accent: oklch(47% 0.13 246);
    --color-accent-hover: oklch(41% 0.13 246);
    --color-accent-soft: oklch(94% 0.025 246);
    --color-card-bg: oklch(99.5% 0.002 250);
    --color-card-bg-hover: oklch(96% 0.003 250);
    --color-info-card-bg: oklch(96.5% 0.015 246);
    --color-muted-bg: oklch(96% 0.003 250);
    --color-muted-icon-bg: oklch(93% 0.003 250);
    --color-error-bg: oklch(96% 0.03 25);
    --color-error-border: oklch(75% 0.12 25);
    --color-error-text: oklch(35% 0.12 25);
    --color-success-bg: oklch(96% 0.05 145);
    --color-success-border: oklch(70% 0.15 145);
    --color-success-text: oklch(35% 0.12 145);

    --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

/* Guarantees the semantic `hidden` attribute always wins over any
   component's own `display` rule (e.g. `.file-chip { display: flex }`) —
   without this, JS setting `el.hidden = true` on an element that also has
   an explicit `display` value silently does nothing, since normal-priority
   author CSS always beats the browser's own `[hidden] { display: none }`
   default regardless of selector specificity. Standard fix, found in most
   modern CSS resets for exactly this reason. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-hover);
}

/* ---- Header ---- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 48px;
    border-bottom: 1px solid var(--color-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 2px;
}

.brand-name {
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.2px;
    color: var(--color-text);
}

.breadcrumb-sep {
    color: var(--color-border);
    font-size: 15px;
}

.breadcrumb-current {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-text-muted);
}

.auth-nav {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-nav a {
    text-decoration: none;
}

.auth-nav a:hover {
    text-decoration: underline;
}

.auth-nav-sep {
    color: var(--color-border);
}

.auth-nav-name {
    color: var(--color-text);
}

/* ---- Main layout ---- */

.page-main {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 72px 48px 96px;
    max-width: 1080px;
}

.page-main--narrow {
    max-width: 680px;
    padding-bottom: 120px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.page-title {
    font-size: 30px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 10px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0 0 12px;
    max-width: 560px;
    line-height: 1.5;
}

.quota-status {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin: 0 0 40px;
}

/* ## Small, right-aligned secondary feedback link under the upload
   area/info-cards — deliberately not accent-weight, so it doesn't
   compete with .btn-primary (Convert to DXF) or the dropzone above it. */
.page-feedback-link {
    text-align: right;
    font-size: 12px;
    color: var(--color-text-faint);
    margin: 16px 0 0;
}

/* ---- Tool grid (homepage) ---- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    display: block;
    padding: 32px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-card-bg);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, background .15s;
}

.tool-card:hover {
    border-color: var(--color-border-strong);
    background: var(--color-card-bg-hover);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--color-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tool-card-icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 9px);
    grid-template-rows: repeat(2, 9px);
    gap: 2px;
}

.tool-card-icon-grid span {
    width: 9px;
    height: 9px;
    background: var(--color-accent);
    border-radius: 1.5px;
}

.tool-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px;
}

.tool-card-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 0 20px;
}

.tool-card-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--color-accent);
}

.tool-card--coming-soon {
    position: relative;
    border: 1.5px dashed var(--color-border-strong);
    background: var(--color-muted-bg);
    color: var(--color-text-muted);
}

.tool-card--coming-soon .tool-card-title {
    color: var(--color-text-muted);
}

.tool-card--coming-soon .tool-card-desc {
    color: var(--color-text-faint);
}

.tool-card--coming-soon .tool-card-icon {
    background: var(--color-muted-icon-bg);
    flex-direction: column;
    gap: 2px;
}

/* Stylized I-beam cross-section for the Steel Layout Validator card. */
.beam-icon-bar {
    width: 20px;
    height: 3px;
    background: var(--color-border-strong);
    border-radius: 1px;
}

.beam-icon-stem {
    width: 3px;
    height: 12px;
    background: var(--color-border-strong);
}

.coming-soon-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.coming-soon-status {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-text-faint);
}

/* ## "Beta" badge — live-but-early, distinct from .coming-soon-badge
   (not-live-yet) above: soft accent blue instead of neutral gray, and
   inline next to a heading instead of pinned to a card corner. Used on
   the homepage tool card title and the tool page's own <h1>. */
.beta-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--color-accent-soft);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--color-accent);
    vertical-align: middle;
}

/* ---- Dropzone (upload page) ---- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 24px;
    border-radius: 10px;
    cursor: pointer;
    background: var(--color-bg);
    border: 2px dashed var(--color-border-strong);
    transition: border-color .15s, background .15s;
}

.dropzone.is-dragover {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}

.dropzone-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone-icon {
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.dropzone-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
}

.dropzone-hint {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.dropzone-hint a,
.dropzone-hint .browse-link {
    color: var(--color-accent);
    text-decoration: underline;
}

.dropzone-meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-top: 18px;
}

/* ---- Selected-file chip ---- */

.file-chip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card-bg);
    width: 100%;
    box-sizing: border-box;
    max-width: 420px;
    margin: 0 auto;
}

.file-chip-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--color-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-chip-icon-glyph {
    width: 14px;
    height: 18px;
    border: 1.5px solid var(--color-accent);
    border-radius: 2px;
}

.file-chip-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.file-chip-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-size {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.file-chip-remove {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.file-chip-remove:hover {
    color: var(--color-text);
}

/* ---- Buttons ---- */

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Info cards (Privacy / Output format) ---- */

.info-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 48px;
}

.info-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 18px 20px;
    background: var(--color-info-card-bg);
}

.info-card-bullet {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--color-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-card-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.info-card-body {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--color-text);
}

/* ---- Error banner (not in the source design — styled to match) ---- */

.error-banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--color-error-border);
    border-radius: 8px;
    padding: 14px 18px;
    background: var(--color-error-bg);
    color: var(--color-error-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.success-banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--color-success-border);
    border-radius: 8px;
    padding: 14px 18px;
    background: var(--color-success-bg);
    color: var(--color-success-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ---- Footer ---- */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 24px 48px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--color-text-muted);
}

/* No-JS fallback (plain input + button) lives inside a <noscript> tag in
   the template itself — browsers only render that content as real,
   visible DOM when scripting is disabled, so it needs no extra CSS here. */
