:root {
  color-scheme: light dark;
  --page: #f8f7f5;
  --surface: #ffffff;
  --surface-soft: #f5f1ed;
  --ink: #2d2926;
  --muted: #756e68;
  --line: #e6dfd8;
  --primary: #e66a12;
  --primary-hover: #c95708;
  --focus: #b84c08;
  --green: #28754b;
  --green-bg: #e9f5ed;
  --amber: #94590d;
  --amber-bg: #fff3d9;
  --red: #a63e35;
  --red-bg: #fbecea;
  --shadow: 0 22px 60px rgba(57, 43, 31, .09), 0 2px 8px rgba(57, 43, 31, .04);
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #201b17;
    --surface: #2b241f;
    --surface-soft: #342b25;
    --ink: #f3ece5;
    --muted: #b8aaa0;
    --line: #4a3d34;
    --primary: #f28a3d;
    --primary-hover: #ffa260;
    --focus: #ffb17d;
    --green: #91d4a9;
    --green-bg: #193a29;
    --amber: #ffd27c;
    --amber-bg: #45351c;
    --red: #ffaaa0;
    --red-bg: #482824;
    --shadow: 0 22px 60px rgba(0, 0, 0, .27), 0 2px 8px rgba(0, 0, 0, .18);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(230, 106, 18, .08), transparent 48%),
    var(--page);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 48%, transparent);
  outline-offset: 3px;
}
.portal-shell {
  width: min(100% - 32px, 610px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.portal-brand { margin: 0 0 25px; display: flex; justify-content: center; }
.portal-logo { width: 198px; height: auto; max-height: 86px; object-fit: contain; }
.portal-card {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 34px 38px 30px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card-mark { position: absolute; top: 0; right: 0; display: flex; height: 4px; width: 76px; }
.card-mark span { flex: 1; background: var(--primary); }
.card-mark span:nth-child(2) { opacity: .68; }
.card-mark span:nth-child(3) { opacity: .34; }
.portal-intro { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.portal-title { margin: 0; font-size: clamp(1.7rem, 5vw, 2.15rem); line-height: 1.16; letter-spacing: -.035em; font-weight: 720; }
.company-name { margin: 10px 0 0; font-size: 1.05rem; font-weight: 650; }
.portal-copy { margin: 12px 0 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.section-title { margin: 0 0 12px; font-size: 1rem; letter-spacing: -.01em; }
.document-list { display: grid; gap: 12px; }
.document-item {
  padding: 17px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.document-top { display: flex; align-items: flex-start; gap: 12px; }
.document-number { color: #a79b90; font-size: .76rem; font-variant-numeric: tabular-nums; font-weight: 700; padding-top: 2px; }
.document-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; }
.document-title { margin: 0; font-size: .97rem; line-height: 1.35; font-weight: 650; }
.document-badges { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.requirement-label { color: var(--muted); font-size: .68rem; font-weight: 650; }
.requirement-label--required { color: var(--focus); }
.status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: .72rem; line-height: 1.2; font-weight: 700; }
.status-badge--missing, .status-badge--expired { color: var(--red); background: var(--red-bg); }
.status-badge--expiring { color: var(--amber); background: var(--amber-bg); }
.status-badge--valid { color: var(--green); background: var(--green-bg); }
.expiry-note { margin: 7px 0 0 30px; color: var(--muted); font-size: .82rem; }
.upload-form { margin: 15px 0 0 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 12px; align-items: end; }
.field-label { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: .81rem; font-weight: 600; }
.file-input, .date-input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: .82rem;
}
.file-input { padding: 6px; }
.file-input::file-selector-button {
  min-height: 28px;
  margin-right: 9px;
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
}
.field-hint { color: var(--muted); font-size: .75rem; font-weight: 400; }
.button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 7px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease, opacity .16s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .62; cursor: wait; }
.button--primary { border: 1px solid var(--primary); color: #fff; background: var(--primary); white-space: nowrap; }
.button--primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button--secondary { margin-top: 17px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.button--secondary:hover { background: var(--surface-soft); }
.upload-feedback { grid-column: 1 / -1; min-height: 0; margin: -2px 0 0; color: var(--muted); font-size: .81rem; }
.upload-feedback:empty { display: none; }
.feedback-success { color: var(--green); }
.feedback-error { color: var(--red); }
.progress-track { grid-column: 1 / -1; display: none; height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-track.is-visible { display: block; }
.progress-fill { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--primary); transition: transform .15s linear; }
.privacy-note { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .79rem; line-height: 1.5; }
.portal-message { padding: 13px 0 10px; }
.portal-message--error .portal-title { font-size: 1.55rem; }
.loading-line { margin: 14px 0; color: var(--muted); }
.portal-footer { margin-top: auto; padding-top: 24px; display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; }
.portal-footer a { color: inherit; text-decoration: none; }
.portal-footer a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .portal-shell { width: min(100% - 24px, 610px); padding-top: 24px; }
  .portal-brand { margin-bottom: 19px; }
  .portal-logo { width: 172px; max-height: 72px; }
  .portal-card { padding: 27px 20px 22px; border-radius: 12px; }
  .portal-intro { margin-bottom: 23px; }
  .document-item { padding: 15px 13px; }
  .document-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .document-badges { flex-wrap: wrap; }
  .upload-form { margin-left: 0; grid-template-columns: 1fr; }
  .expiry-note { margin-left: 0; }
  .button--primary { width: 100%; }
  .portal-footer { padding-top: 20px; }
}

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