/* Soft and pastel: butter-yellow buttons on a pale cream page, serif headings.
   Text colours keep at least 4.5:1 contrast. System fonts only, so nothing
   is fetched from outside the site. */

:root {
  --bg: #fdf8e7;
  --wash-1: #fbeec0;       /* soft yellow glow, top left */
  --wash-2: #fbe7dc;       /* faint peach, bottom right */
  --card: #fffdf6;
  --shadow: 0 12px 32px rgba(176, 140, 40, 0.12);
  --text: #3b3427;
  --muted: #6b6250;
  --line: #efe5c4;
  --accent: #f7e3a1;       /* butter yellow: button fills */
  --accent-text: #3b3021;
  --accent-deep: #e4c45e;  /* honey: borders, rules */
  --accent-ink: #7a5d0c;   /* dark gold: accent text, focus rings */
  --accent-soft: #faefcb;
  --progress: #a8831a;
  --error: #9e3a32;
  --error-soft: #fbe6e2;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a14;
    --wash-1: #29251a;
    --wash-2: #1c1a14;
    --card: #25221a;
    --shadow: none;
    --text: #f3ecda;
    --muted: #bdb399;
    --line: #3b3627;
    --accent: #f2dc93;
    --accent-text: #2a2415;
    --accent-deep: #d9bb5c;
    --accent-ink: #f2dc93;
    --accent-soft: #3a3322;
    --progress: #f2dc93;
    --error: #f2a79e;
    --error-soft: #3d2622;
  }
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 10% 0%, var(--wash-1), transparent 55%),
    radial-gradient(circle at 100% 100%, var(--wash-2), transparent 45%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.5 var(--sans);
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 36px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

header { margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-ink);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 400 34px/1.2 var(--serif);
  overflow-wrap: anywhere;
}

h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin: 18px auto 0;
  background: var(--accent-deep);
}

.lede {
  margin: 18px 0 0;
  color: var(--muted);
}

/* Forms */

form, section { display: flex; flex-direction: column; gap: 12px; }

label { text-align: left; font-weight: 600; font-size: 15px; }
.optional { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 17px; /* 16px+ stops iOS zooming in on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus { outline: 2px solid var(--accent-ink); outline-offset: 1px; border-color: transparent; }

/* Buttons (and the label that opens the photo picker) */

.button {
  display: block;
  width: 100%;
  padding: 15px 18px;
  font: 600 17px/1.2 var(--sans);
  text-align: center;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent-deep);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.4; cursor: default; transform: none; }

.button.secondary { color: var(--accent-ink); background: transparent; }

#pick .button.secondary { margin-top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.visually-hidden:focus-visible + .button { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.summary { min-height: 1.5em; margin: 0; color: var(--muted); }

/* Progress */

.status { margin: 0; font: 400 22px/1.3 var(--serif); }

progress {
  width: 100%;
  height: 10px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--accent-soft); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--progress); border-radius: 999px; transition: width 0.2s; }
progress::-moz-progress-bar { background: var(--progress); border-radius: 999px; }

.hint { margin: 0; color: var(--muted); font-size: 14px; }

/* Results */

.result { margin: 0; font: 400 22px/1.35 var(--serif); }

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: var(--error);
  background: var(--error-soft);
  border-radius: 10px;
  font-size: 15px;
}
section .banner { margin: 0; }

.problems {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
  font-size: 15px;
}
.problems:empty { display: none; }

.problems li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.problems li:last-child { border-bottom: 0; }

.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.file-error { flex-shrink: 0; color: var(--error); }

.link {
  flex-shrink: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 380px) {
  .card { padding: 28px 20px; }
  h1 { font-size: 29px; }
}
