/* ==========================================================================
   Meevo Support Center
   Single stylesheet. No framework, no build step, no third-party requests.
   ========================================================================== */

/* Inter, self-hosted. Google serves one variable file for the whole weight
   axis, so a single @font-face with a weight range gives real 400 and 600
   rather than synthetic bold. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Tokens
   The orange is the logo's own #FF5F23 and the only saturated colour here.
   Contrast values are measured against --surface-raised (#fff):
     --border 3.6:1 (bordas need 3:1 — the usual pale grey fails at ~1.3:1)
     --text 14.6:1 · --accent-ink 5.1:1 · --danger 6.5:1 · --ok 6.4:1
   --accent itself is 3.0:1, so it is never used for text: the button pairs it
   with --text (5.6:1) instead of white (3.0:1, which fails AA).
   -------------------------------------------------------------------------- */
:root {
  --surface:        #F7F8FA;
  --surface-raised: #FFFFFF;
  --border:         #7A848F;
  --text:           #1F2933;
  --accent:         #FF5F23;
  --accent-ink:     #C2440F;
  --danger:         #B3261E;
  --ok:             #1E6C41;

  --muted:      #4A5560;   /* 7.5:1 — help text, still comfortably AA */
  --rule:       #E3E6EA;   /* decorative dividers only, never a field border */
  --tint:       #FFF4EF;   /* accent at 6% — dropzone hover, confirmation */

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;

  --fs-xs: 0.8125rem;  /* 13px */
  --fs-md: 1rem;       /* 16px — every control, so iOS never zooms on focus */
  --fs-lg: 1.25rem;    /* 20px */
  --fs-xl: 1.875rem;   /* 30px */

  --radius: 6px;
  --measure: 680px;
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 400 var(--fs-md)/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

h1, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: var(--accent-ink); }
a:hover { text-decoration-thickness: 2px; }

/* One focus treatment for everything, defined once and never removed. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--sp-2);
  top: -100px;
  z-index: 10;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-raised);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--sp-2); }

/* --------------------------------------------------------------------------
   Header / intro / footer
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-4);
}
.logo { width: 132px; height: auto; margin: 0 auto; }

main { display: block; outline: none; }

.intro {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-4) var(--sp-6);
}
h1 { font-size: var(--fs-xl); line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; }
.intro__sub { margin-top: var(--sp-2); color: var(--muted); }

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-4);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.site-footer p + p { margin-top: var(--sp-2); }
.site-footer__name { color: var(--text); font-weight: 600; font-size: var(--fs-md); }

/* --------------------------------------------------------------------------
   Card + layout
   Two columns collapse to one through minmax(), so there is no breakpoint to
   maintain: a column simply stops fitting and the track wraps.
   -------------------------------------------------------------------------- */
.card {
  max-width: var(--measure);
  margin: 0 auto;
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-6);
}

fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-size: var(--fs-lg); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}
.field--full { grid-column: 1 / -1; }

.field { min-width: 0; }
label { display: block; margin-bottom: var(--sp-1); font-weight: 600; font-size: var(--fs-xs); }
.req { color: var(--accent-ink); }

.hint { color: var(--muted); font-size: var(--fs-xs); margin-top: var(--sp-1); }
.counter { text-align: right; }
.counter.is-near { color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */
input[type='text'], input[type='file'], select, textarea {
  width: 100%;
  min-height: 44px;                 /* touch target */
  padding: var(--sp-2) var(--sp-3);
  font: inherit;                    /* 16px — keeps iOS from zooming */
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
textarea { min-height: 132px; resize: vertical; line-height: 1.5; }

select {
  appearance: none;
  padding-right: var(--sp-8);
  /* Inline chevron as a data URI — no icon library, no extra request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%231F2933' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
}

.control { position: relative; }
.control__status {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-md);
  line-height: 1;
}
.control:has(.control__status:not(:empty)) input { padding-right: var(--sp-8); }

/* Invalid state is applied only after the field has been touched — the class
   comes from script.js, never from :invalid, which would paint every required
   field red on first paint. */
[aria-invalid='true'] { border-color: var(--danger); border-width: 2px; }
.is-verified input { border-color: var(--ok); }

.error, .ok { font-size: var(--fs-xs); margin-top: var(--sp-1); }
.error { color: var(--danger); font-weight: 600; }
.error:empty, .ok:empty { display: none; }
.ok { color: var(--ok); font-weight: 600; }

.check { display: flex; gap: var(--sp-3); align-items: flex-start; }
.check input {
  flex: none;
  width: 24px; height: 24px;
  margin: 10px 0 0;               /* centres against the 44px target */
  accent-color: var(--accent);
}
.check label { margin: 0; padding: 10px 0; font-weight: 400; font-size: var(--fs-md); }

/* --------------------------------------------------------------------------
   Error summary
   -------------------------------------------------------------------------- */
.summary {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: var(--fs-xs);
}
.summary strong { display: block; margin-bottom: var(--sp-1); font-size: var(--fs-md); }
.summary ul { margin-top: var(--sp-2); }
.summary li + li { margin-top: var(--sp-1); }
.summary a { color: var(--danger); }

/* --------------------------------------------------------------------------
   Dropzone
   The native input is clipped rather than display:none, so it stays focusable
   for anyone who reaches it before script.js upgrades the UI.
   -------------------------------------------------------------------------- */
.dropzone { display: none; }

.js .dropzone-wrap input[type='file'] {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.js .dropzone {
  display: block;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.js .dropzone:hover { background: var(--tint); }
.js .dropzone.is-dragging {
  border-color: var(--accent);
  border-style: solid;
  background: var(--tint);
}
.dropzone__icon { width: 28px; height: 28px; margin: 0 auto var(--sp-2); color: var(--accent-ink); }
.dropzone__title { font-weight: 600; }

/* Keep the native input's own focus ring visible while it is clipped. */
.js .dropzone-wrap input[type='file']:focus-visible + .dropzone {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   File list
   -------------------------------------------------------------------------- */
.filelist:not(:empty) { margin-top: var(--sp-3); border: 1px solid var(--rule); border-radius: var(--radius); }
.filelist li { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); }
.filelist li + li { border-top: 1px solid var(--rule); }

.file__thumb {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  object-fit: cover;
  overflow: hidden;
}
.file__thumb svg { width: 20px; height: 20px; }

.file__body { flex: 1; min-width: 0; }
/* The name is truncated in the middle by script.js so the extension survives —
   this only stops a pathological single-token name from widening the row. */
.file__name { font-size: var(--fs-xs); font-weight: 600; overflow-wrap: anywhere; }
.file__meta { font-size: var(--fs-xs); color: var(--muted); }
.file__saved { color: var(--ok); font-weight: 600; }
.file__error { font-size: var(--fs-xs); color: var(--danger); font-weight: 600; }
.filelist li.is-rejected { background: #FDF3F2; }

.file__remove {
  flex: none;
  min-width: 44px; min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  font: inherit; font-size: var(--fs-xs); font-weight: 600;
  color: var(--accent-ink);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.file__remove:hover { background: var(--tint); }

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }

.btn {
  min-height: 48px;
  padding: var(--sp-3) var(--sp-6);
  font: inherit; font-weight: 600;
  color: var(--text);                /* 5.6:1 on the orange; white would be 3.0:1 */
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn[disabled]:hover { background: var(--accent); border-color: var(--accent); color: var(--text); }

.btn--quiet { color: var(--text); background: none; border-color: var(--border); }
.btn--quiet:hover { background: var(--surface); color: var(--text); border-color: var(--border); }

.progress-row { display: flex; gap: var(--sp-3); align-items: center; margin-top: var(--sp-4); }
progress { flex: 1; height: 8px; }
.progress__pct { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; min-width: 4ch; }

/* --------------------------------------------------------------------------
   Confirmation
   -------------------------------------------------------------------------- */
.confirmation { border-color: var(--ok); border-left: 4px solid var(--ok); outline: none; }
.confirmation h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-lg); color: var(--ok); }
.confirmation__ref {
  display: inline-block;
  margin: var(--sp-3) 0;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: var(--fs-lg); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.confirmation ul { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--danger); }

/* --------------------------------------------------------------------------
   Honeypot — off-screen, not display:none, so a bot filling everything trips it
   -------------------------------------------------------------------------- */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Narrow phones: reclaim the card's horizontal padding. */
@media (max-width: 420px) {
  .card { padding: var(--sp-4); border-radius: 0; border-left: 0; border-right: 0; }
  .intro { padding-top: var(--sp-8); }
  .actions .btn { flex: 1; }
}
