/* GetARQ LocaleCheck — ice silver base, deep aubergine, marigold accent. */

:root {
    --ice-0: #ffffff;
    --ice-50: #f6f8fb;
    --ice-100: #eef1f6;
    --ice-200: #e0e5ee;
    --ice-300: #c9d0dc;
    --ice-500: #8791a3;
    --ink: #1d1524;
    --ink-soft: #564d60;
    --aubergine-900: #26112b;
    --aubergine-800: #331838;
    --aubergine-700: #432149;
    --aubergine-500: #6a3d74;
    --aubergine-100: #efe6f1;
    --marigold: #f2a618;
    --marigold-strong: #e09200;
    --marigold-soft: #fff3d6;
    --error: #b3261e;
    --error-soft: #fbe9e7;
    --warning: #8a5300;
    --success: #1c7349;
    --success-soft: #e3f4ea;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(38, 17, 43, .05), 0 8px 24px -12px rgba(38, 17, 43, .18);
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .7, .3, 1);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ice-100);
    color: var(--ink);
    font: 400 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--aubergine-500); text-underline-offset: 3px; }
a:hover { color: var(--aubergine-900); }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

.muted { color: var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .86em; font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 1.1rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 20;
    background: var(--marigold); color: var(--aubergine-900);
    padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- Top bar ---------- */

.topbar { background: var(--aubergine-900); color: #fff; }
.topbar__inner {
    max-width: 1180px; margin: 0 auto; padding: .85rem 1.25rem;
    display: flex; align-items: center; gap: 1rem 2rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark { flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 650; letter-spacing: -.01em; }
.brand__tag { font-size: .74rem; color: #cdbdd2; letter-spacing: .02em; }

.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav__link {
    color: #e3d7e6; text-decoration: none; padding: .45rem .85rem; border-radius: 999px;
    font-size: .93rem; font-weight: 500; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav__link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav__link.is-active { background: var(--aubergine-700); color: #fff; box-shadow: inset 0 -2px 0 var(--marigold); }

.topbar__user { display: flex; align-items: center; gap: .75rem; }
.topbar__name { font-size: .88rem; color: #cdbdd2; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Page ---------- */

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 2.25rem 1.25rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head p { margin-top: .4rem; max-width: 62ch; }

.footer { padding: 1.25rem; text-align: center; font-size: .8rem; color: var(--ink-soft); }
.footer p { max-width: 80ch; margin: 0 auto; }

.flash {
    background: var(--success-soft); color: var(--success); border: 1px solid #bfe3cd;
    padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 500;
}

.alert {
    background: var(--error-soft); color: #7a1a14; border: 1px solid #f1c4bf;
    padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem;
}
.alert ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.alert strong { font-weight: 650; }

.note {
    font-size: .86rem; color: var(--ink-soft); background: var(--ice-50);
    border-left: 3px solid var(--marigold); padding: .65rem .85rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.note--spaced { margin-bottom: 1.25rem; }

/* ---------- Cards ---------- */

.card {
    background: var(--ice-0); border: 1px solid var(--ice-200); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.5rem;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.card__step {
    display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: .55rem;
    border-radius: 50%; background: var(--aubergine-100); color: var(--aubergine-700);
    font-size: .8rem; font-weight: 700; vertical-align: .1em;
}
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty > * + * { margin-top: .8rem; }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: 600 .95rem/1 var(--font); padding: .8rem 1.25rem; border-radius: 10px;
    border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--sm { padding: .5rem .8rem; font-size: .85rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--aubergine-700); color: #fff; }
.btn--primary:hover { background: var(--aubergine-900); color: #fff; }
.btn--accent { background: var(--marigold); color: var(--aubergine-900); }
.btn--accent:hover { background: var(--marigold-strong); color: var(--aubergine-900); }
.btn--quiet { background: var(--ice-0); color: var(--aubergine-700); border-color: var(--ice-300); }
.btn--quiet:hover { background: var(--ice-50); border-color: var(--aubergine-500); color: var(--aubergine-900); }
.btn--danger { color: var(--error); }
.btn--danger:hover { border-color: var(--error); color: var(--error); background: var(--error-soft); }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn--ghost-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */

.field label, .field__label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field select {
    width: 100%; font: inherit; color: var(--ink); background: var(--ice-0);
    border: 1px solid var(--ice-300); border-radius: var(--radius-sm); padding: .65rem .75rem;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:hover, .field select:hover { border-color: var(--ice-500); }
.field input:focus, .field select:focus { outline: none; border-color: var(--aubergine-500); box-shadow: 0 0 0 3px rgba(106, 61, 116, .18); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field__error { color: var(--error); font-size: .84rem; margin-top: .3rem; }
.field__hint { color: var(--ink-soft); font-size: .84rem; margin-top: .3rem; }

.check { display: flex; align-items: center; gap: .55rem; font-size: .92rem; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--aubergine-700); }

.thresholds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.unit-input { position: relative; }
.unit-input input { padding-right: 3.4rem !important; font-variant-numeric: tabular-nums; }
.unit-input__unit {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ice-500); pointer-events: none;
}

/* ---------- Auth ---------- */

.is-auth .page { display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; padding: 2rem; }
.auth-card > .muted { margin: .5rem 0 1.5rem; }
.auth-card__alt { margin-top: 1.4rem; font-size: .92rem; text-align: center; color: var(--ink-soft); }

/* ---------- Workspace ---------- */

.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
    text-align: center; padding: 2rem 1.25rem; cursor: pointer;
    background: var(--ice-50); border: 1.5px dashed var(--ice-300); border-radius: var(--radius);
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--aubergine-500); background: var(--aubergine-100); }
.dropzone:focus-within { border-color: var(--aubergine-500); box-shadow: 0 0 0 3px rgba(106, 61, 116, .18); }
.dropzone__icon { color: var(--aubergine-500); }
.dropzone__title { font-weight: 600; }
.dropzone__title span { color: var(--aubergine-500); text-decoration: underline; text-underline-offset: 3px; }
.dropzone__hint { font-size: .84rem; color: var(--ink-soft); }
.js .dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.no-js .dropzone input[type="file"] { margin-top: .6rem; max-width: 100%; }

.file-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.file-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .3rem .75rem;
    padding: .65rem .75rem; border: 1px solid var(--ice-200); border-radius: var(--radius-sm); background: var(--ice-0);
    animation: rise .2s var(--ease);
}
.file-item__name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__meta { grid-column: 1; font-size: .8rem; color: var(--ink-soft); }
.file-item__meta.is-error { color: var(--error); }
.file-item .pill { grid-row: 1 / span 2; grid-column: 2; }
.file-item__remove {
    grid-row: 1 / span 2; grid-column: 3; width: 2rem; height: 2rem; border-radius: 50%;
    border: 0; background: transparent; color: var(--ink-soft); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.file-item__remove:hover { background: var(--ice-100); color: var(--error); }

.actionbar { display: flex; align-items: center; gap: 1rem 1.25rem; flex-wrap: wrap; margin-top: 1.25rem; }
.actionbar .muted { font-size: .86rem; }

.progress-card { margin-top: 1.25rem; }
.progress-card__row { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .55rem; }
progress {
    display: block; width: 100%; height: .6rem; border: 0; border-radius: 999px; overflow: hidden;
    background: var(--ice-200); appearance: none; -webkit-appearance: none;
}
progress::-webkit-progress-bar { background: var(--ice-200); }
progress::-webkit-progress-value { background: var(--marigold); border-radius: 999px; transition: width .25s var(--ease); }
progress::-moz-progress-bar { background: var(--marigold); border-radius: 999px; }

/* ---------- Pills ---------- */

.pill {
    display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px;
    font-size: .74rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
    background: var(--ice-100); color: var(--ink-soft);
}
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.pill--passed { background: var(--success-soft); color: var(--success); }
.pill--warnings, .pill--warning { background: var(--marigold-soft); color: var(--warning); }
.pill--failed, .pill--rejected, .pill--error { background: var(--error-soft); color: var(--error); }
.pill--working { background: var(--aubergine-100); color: var(--aubergine-700); }
.pill--working::before { animation: pulse 1s ease-in-out infinite; }
.pill--plain::before { display: none; }

.badge {
    display: inline-block; padding: .12rem .45rem; border-radius: 6px; border: 1px solid var(--ice-300);
    font: 600 .72rem/1.4 var(--mono); color: var(--ink-soft); background: var(--ice-50);
}

.count { font-variant-numeric: tabular-nums; }
.count--error { color: var(--error); font-weight: 650; }
.count--warning { color: var(--warning); font-weight: 650; }

/* ---------- Results ---------- */

.results-region { margin-top: 2rem; scroll-margin-top: 1rem; }
.results-region:focus { outline: none; }
.results { display: grid; gap: 1.25rem; animation: rise .3s var(--ease); }
.results > * { min-width: 0; }

.verdict {
    display: flex; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; flex-wrap: wrap;
    background: var(--aubergine-900); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.6rem;
    border-left: 6px solid var(--ice-500);
}
.verdict--passed { border-left-color: #4fc38a; }
.verdict--warnings { border-left-color: var(--marigold); }
.verdict--failed { border-left-color: #f0685f; }
.verdict h2 { font-size: 1.45rem; }
.verdict p { color: #d9cbdd; margin-top: .35rem; max-width: 60ch; }
.verdict__actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.eyebrow { font-size: .74rem !important; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--marigold) !important; margin: 0 0 .4rem !important; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.chips div {
    display: flex; gap: .4rem; align-items: baseline; background: var(--ice-0); border: 1px solid var(--ice-200);
    border-radius: 999px; padding: .3rem .8rem; font-size: .84rem;
}
.chips dt { color: var(--ink-soft); }
.chips dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .75rem; }
.tile { background: var(--ice-0); border: 1px solid var(--ice-200); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.tile__value { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__label { display: block; margin-top: .3rem; font-size: .8rem; color: var(--ink-soft); }
.tile--error .tile__value { color: var(--error); }
.tile--warning .tile__value { color: var(--warning); }

.corrections { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.corrections li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--ice-200); align-items: start; }
.corrections li:first-child { border-top: 0; padding-top: 0; }
.corrections__count { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.corrections__count.is-error { color: var(--error); }
.corrections__count.is-warning { color: var(--warning); }
.corrections strong { font-weight: 650; }
.corrections p { color: var(--ink-soft); font-size: .92rem; }

.file { background: var(--ice-0); border: 1px solid var(--ice-200); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.file + .file { margin-top: .75rem; }
.file > summary {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem 1rem; align-items: center;
    padding: 1rem 1.25rem; cursor: pointer; list-style: none;
}
.file > summary::-webkit-details-marker { display: none; }
.file > summary:hover { background: var(--ice-50); }
.file__name { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 650; }
.file__name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__counts { font-size: .86rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.file__body { border-top: 1px solid var(--ice-200); padding: 1.25rem; }
.file__body > * + * { margin-top: 1.1rem; }
.file__message { color: var(--error); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin: 0; }
.stats div { background: var(--ice-50); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.stats dt { font-size: .76rem; color: var(--ink-soft); }
.stats dd { margin: .15rem 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats dd small { font-weight: 400; color: var(--ink-soft); font-size: .78rem; }
.stats dd.is-over { color: var(--warning); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.filters__count { margin-left: auto; font-size: .84rem; color: var(--ink-soft); }
.filter {
    font: 600 .82rem/1 var(--font); padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
    background: var(--ice-0); color: var(--ink-soft); border: 1px solid var(--ice-300);
    transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.filter:hover { border-color: var(--aubergine-500); color: var(--aubergine-900); }
.filter[aria-pressed="true"] { background: var(--aubergine-700); border-color: var(--aubergine-700); color: #fff; }

/* ---------- Tables ---------- */

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
    text-align: left; font-size: .74rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ink-soft); padding: .7rem 1rem; background: var(--ice-50); border-bottom: 1px solid var(--ice-200);
}
.table th.num { text-align: right; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--ice-200); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table__actions { display: flex; gap: .4rem; justify-content: flex-end; }
.table-wrap { border: 1px solid var(--ice-200); border-radius: var(--radius-sm); overflow: hidden; }

.issue__message { font-weight: 550; }
.issue__fix { color: var(--ink-soft); font-size: .88rem; margin-top: .2rem; }
.issue__fix::before { content: "Fix: "; font-weight: 650; color: var(--aubergine-500); }
.issue__text { margin-top: .35rem; font-size: .84rem; color: var(--ink-soft); font-style: italic; overflow-wrap: anywhere; }
.issue__where { white-space: nowrap; }
.issue__where small { display: block; color: var(--ink-soft); }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }

/* ---------- Profiles ---------- */

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.profile-card > * + * { margin-top: 1rem; }
.profile-card__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding-top: .25rem; }
.profile-card__foot .check { margin-right: auto; }
.profile-card--new { border-style: dashed; background: var(--ice-50); box-shadow: none; }

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
    .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .workspace, .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
    .topbar__user { margin-left: auto; }
}

@media (max-width: 640px) {
    .page { padding: 1.5rem 1rem 2.5rem; }
    .card { padding: 1.15rem; }
    .card--flush { padding: 0; }
    .brand__tag { display: none; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .verdict { padding: 1.25rem; }
    .verdict__actions, .verdict__actions .btn { width: 100%; }
    .file > summary { grid-template-columns: minmax(0, 1fr) auto; padding: .9rem 1rem; }
    .file__counts { grid-column: 1 / -1; }
    .file__body { padding: 1rem; }
    .filters__count { margin-left: 0; width: 100%; }
    .actionbar .btn { width: 100%; }
    .corrections li { grid-template-columns: 3rem minmax(0, 1fr); }

    /* Tables become stacked cards. */
    .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: .85rem 1rem; border-bottom: 1px solid var(--ice-200); }
    .table--stack tbody tr:last-child { border-bottom: 0; }
    .table--stack td { padding: .15rem 0; border: 0; text-align: left; }
    .table--stack td[data-label]::before {
        content: attr(data-label); display: inline-block; min-width: 7.5rem;
        font-size: .74rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft);
    }
    .table--stack td.issue__main::before { display: none; }
    .table--stack td.table__actions { display: flex; justify-content: flex-start; padding-top: .6rem; }
    .issue__where small { display: inline; margin-left: .4rem; }
}

@media print {
    .topbar, .footer, .workspace-form, .verdict__actions, .filters { display: none !important; }
    body { background: #fff; }
    .card, .tile, .file { box-shadow: none; }
}
