/* Colour, font and radius custom properties are written onto :root by boot.js
   from config/app.config.js. Nothing brand-specific is hardcoded here. */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.masthead-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.masthead-logo { height: 26px; width: auto; display: block; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 72px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--muted);
}

.step { display: flex; align-items: center; gap: 6px; }

.step-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rule);
}

.step[data-state="current"] { color: var(--ink); font-weight: 600; }
.step[data-state="current"] .step-dot { background: var(--accent); }
.step[data-state="done"] .step-dot { background: var(--accent); opacity: 0.45; }

.step-sep { flex: 0 0 14px; height: 1px; background: var(--rule); }

h1 {
  font-size: 25px;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.012em;
  max-width: 22ch;
}

.help {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
  max-width: 46ch;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}

.field { margin-bottom: 22px; }

.phone-row { display: flex; gap: 8px; }

select, input[type="tel"], input[type="text"] {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 11px 12px;
  width: 100%;
  min-height: 46px;
}

select { flex: 0 0 auto; width: auto; max-width: 46%; }
input[type="tel"] { flex: 1 1 auto; }

:is(select, input, button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 18px;
  min-height: 46px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn:disabled { opacity: 0.45; cursor: default; }

.btn-quiet {
  background: none;
  color: var(--accent);
  border-color: var(--rule);
}

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 0;
  width: auto;
  min-height: 0;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.actions .btn { width: 100%; }

/* OTP entry */
.otp-row { display: flex; gap: 8px; margin-bottom: 22px; }

.otp-box {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  padding: 10px 0;
  min-height: 54px;
}

/* Choice lists — companies and pending items */
.choices { list-style: none; margin: 0 0 22px; padding: 0; }

.choice {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
}

.choice button, .choice a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  padding: 14px 16px;
  cursor: pointer;
  border-radius: var(--radius);
}

.choice-title { font-weight: 600; display: block; }

.choice-meta {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

/* File picker */
.dropzone {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px 18px;
  text-align: center;
  margin-bottom: 18px;
}

.dropzone[data-dragging="true"] { border-color: var(--accent); }

.filelist { list-style: none; margin: 0 0 20px; padding: 0; font-size: 14px; }

.filelist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}

.filelist .size { color: var(--muted); flex: 0 0 auto; }

.filelist .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font: inherit; padding: 0 0 0 8px;
}

/* Progress */
.progress {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* Messages */
.message {
  border-left: 3px solid var(--rule);
  padding: 2px 0 2px 14px;
  margin-bottom: 22px;
  font-size: 15px;
}

.message[data-tone="error"] { border-left-color: var(--alert); color: var(--alert); }
.message[data-tone="done"] { border-left-color: var(--accent); }

.hidden { display: none !important; }

.footnote {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}

/* One deliberate motion: the confirmation mark on a completed upload. */
.tick { width: 34px; height: 34px; margin-bottom: 14px; }
.tick path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: draw 0.4s 0.05s ease-out forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .tick path { animation: none; stroke-dashoffset: 0; }
  .progress-bar { transition: none; }
}

@media (max-width: 420px) {
  h1 { font-size: 22px; }
  main { padding-top: 30px; }
  .otp-box { font-size: 19px; min-height: 48px; }
}
