:root {
  --ink: #16201c;
  --muted: #68736e;
  --paper: #f5f3ec;
  --card: #fffefa;
  --line: #deddd5;
  --accent: #df5b35;
  --accent-dark: #bd4020;
  --green: #1d6b51;
  --soft-green: #dcebe3;
  --danger: #aa3428;
  --shadow: 0 20px 70px rgba(33, 43, 38, .11);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(223, 91, 53, .08), transparent 30%),
    linear-gradient(rgba(22, 32, 28, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 32, 28, .025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 24px 24px, 24px 24px, auto;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: calc(100vh - 62px);
}

.upload-page {
  display: grid;
  grid-template-columns: minmax(165px, 1fr) minmax(760px, 5fr);
  gap: clamp(22px, 2.5vw, 34px);
  align-items: start;
  width: min(1320px, calc(100% - 24px));
  padding: 12px 0 16px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9b71;
  box-shadow: 0 0 0 5px rgba(47, 155, 113, .12);
}

.hero h1, .dashboard h1, .login-card h1 {
  margin: 24px 0 18px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(46px, 6vw, 78px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.hero { align-self: center; }

.hero h1 { margin-top: 15px; font-size: clamp(29px, 2.8vw, 41px); line-height: 1.1; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 12px; line-height: 1.6; }
.hero .eyebrow { font-size: 10px; letter-spacing: .13em; }
.thanks-art { margin: 18px 0 0; text-align: center; }
.thanks-art img { display: block; width: min(135px, 82%); height: auto; margin: 0 auto; filter: drop-shadow(0 10px 18px rgba(33, 43, 38, .08)); }
.thanks-art figcaption { margin-top: 3px; color: var(--green); font-family: Georgia, "Songti SC", serif; font-size: 12px; letter-spacing: .08em; }
.hero p, .dashboard-header p, .login-card > p {
  max-width: 430px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.card {
  background: rgba(255, 254, 250, .95);
  border: 1px solid rgba(222, 221, 213, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.upload-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 28px);
  padding: 16px 22px;
}
.upload-card form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 7px; }
.card-heading > div { display: flex; align-items: center; gap: 12px; }
.card-heading h2 { margin: 0; font-size: 22px; }
.step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.limit { color: var(--muted); font-size: 12px; line-height: 32px; }

.type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.type-option { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; text-align: left; transition: .2s ease; }
.type-option:first-child { color: #185d47; border-color: #a8cfbd; background: #e9f5ef; }
.type-option:last-child { color: #b84729; border-color: #efb39f; background: #fff0e9; }
.type-option span { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 900; }
.type-option strong { font-size: 16px; }
.type-option:hover { filter: saturate(1.15); transform: translateY(-1px); }
.type-option:first-child.active { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 8px 20px rgba(223, 91, 53, .22); }
.type-option:last-child.active { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 8px 20px rgba(223, 91, 53, .22); }
.type-option.active span { color: #fff; border-color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .13); }

.field { display: block; margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 110px; gap: 14px; }
.field-row-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.intake-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; }
.intake-grid .field { display: grid; grid-template-columns: minmax(160px, 44%) minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; margin-bottom: 0; }
.intake-grid .field-wide { grid-column: 1 / -1; grid-template-columns: 205px minmax(0, 1fr); }
.form-intro, .file-section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 1px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.form-intro strong, .file-section-title strong { font-size: 15px; }
.form-intro span, .file-section-title span { color: var(--muted); font-size: 12px; text-align: right; }
.file-section-title { margin-top: 8px; }
.field > span { display: block; margin-bottom: 3px; font-size: 14px; font-weight: 750; }
.intake-grid .field > span { margin-bottom: 0; }
.field em { color: #8f9893; font-size: 11px; font-style: normal; font-weight: 500; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.25;
  transition: border-color .2s, box-shadow .2s;
}
.intake-grid .field input,
.intake-grid .field textarea { height: 40px; min-height: 40px; max-height: 80px; }
.intake-grid .field input { height: 40px; min-height: 40px; }
.field textarea { min-height: 34px; max-height: 68px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8f9893; opacity: .68; }
.simple-fields { padding: 18px 0 12px; }
.simple-fields .field { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: start; gap: 12px; }
.simple-fields .field > span { margin: 10px 0 0; }
.simple-fields textarea { min-height: 92px; padding: 12px; font-size: 13px; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(29, 107, 81, .1); }

.upload-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(128px, 13vw, 156px);
  align-items: center;
  gap: 14px;
  flex: 1 1 300px;
  min-height: 300px;
}
.drop-zone {
  display: flex;
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 22px;
  gap: 15px;
  border: 1.5px dashed #b8bbb4;
  border-radius: 16px;
  background: #faf9f4;
  cursor: pointer;
  transition: .2s ease;
}
.drop-zone:hover, .drop-zone:focus, .drop-zone.dragging { border-color: var(--accent); background: #fff7f2; transform: translateY(-2px); }
.upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 0;
  border-radius: 50%;
  color: var(--accent);
  background: #f8e2d9;
}
.upload-icon svg { width: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.drop-zone strong { font-size: 15px; }
.drop-zone > span { margin-top: 0; color: var(--muted); font-size: 12px; }

.file-list { margin-top: 12px; border-top: 1px solid var(--line); }
.selected-file { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.selected-file span { color: var(--muted); font-size: 12px; }

.notice { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--soft-green); color: var(--green); font-size: 13px; line-height: 1.5; }
.notice.error { color: var(--danger); background: #f8e2de; }
.consent-field { display: flex; align-items: flex-start; gap: 7px; margin-top: 6px; color: var(--muted); cursor: pointer; font-size: 9px; line-height: 1.3; }
.consent-field input { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--green); }

.primary-button, .secondary-button, .text-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: .2s ease;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  box-shadow: 0 9px 22px rgba(223, 91, 53, .22);
}
.primary-button:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.upload-area > .primary-button {
  align-self: center;
  width: 100%;
  margin: 0;
  padding: 12px 10px;
  line-height: 1.35;
}
.privacy-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 8px; }
.privacy-note svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }

footer { height: 62px; color: #949b97; text-align: center; font-size: 10px; letter-spacing: .18em; }

.admin-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0; }
.login-card { width: min(460px, 100%); margin: 8vh auto 0; padding: 38px; }
.login-card h1 { font-size: 46px; margin-bottom: 8px; }
.login-card > p { margin: 0 0 28px; font-size: 14px; }
.dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 45px; }
.dashboard h1 { margin: 18px 0 8px; font-size: 58px; }
.dashboard-header p { margin: 0; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.secondary-button { padding: 11px 16px; color: var(--ink); border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; }
.secondary-button:hover { border-color: var(--ink); }
.text-button { padding: 11px 8px; color: var(--muted); background: transparent; font-size: 13px; }
.text-button:hover { color: var(--danger); }

.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.file-card { padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.submission-card { grid-column: 1 / -1; }
.file-card-top { display: flex; align-items: flex-start; gap: 13px; }
.file-type { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 10px; color: var(--green); background: var(--soft-green); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.file-info { min-width: 0; flex: 1; }
.file-info h3 { overflow: hidden; margin: 1px 0 6px; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.file-info p { margin: 0; color: var(--muted); font-size: 12px; }
.file-message { margin: 17px 0; padding: 12px; border-radius: 9px; color: #46504c; background: #f4f3ed; font-size: 13px; line-height: 1.55; }
.file-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.download-link { color: var(--accent-dark); font-size: 13px; font-weight: 800; text-decoration: none; }
.delete-button { padding: 6px 0; border: 0; color: #9b615b; background: transparent; cursor: pointer; font-size: 12px; }
.delete-button:hover { color: var(--danger); }
.intake-details { display: grid; grid-template-columns: 120px 1fr; gap: 9px 16px; margin: 20px 0; padding: 16px; border-radius: 12px; background: #f4f3ed; font-size: 13px; line-height: 1.55; }
.intake-details dt { color: var(--muted); font-weight: 700; }
.intake-details dd { margin: 0; white-space: pre-wrap; }
.attachment-list { margin-top: 18px; border-top: 1px solid var(--line); }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.attachment-row > div:first-child { min-width: 0; }
.attachment-row strong { display: block; overflow: hidden; max-width: 620px; margin-bottom: 3px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.attachment-row span { color: var(--muted); font-size: 11px; }
.attachment-actions { display: flex; align-items: center; gap: 14px; }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed #b8bbb4; border-radius: 20px; }
.empty-icon { color: var(--accent); font: 56px Georgia, serif; }
.empty-state h2 { margin: 10px 0 8px; }
.empty-state p { color: var(--muted); }

@media (max-width: 820px) {
  .upload-page { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero { text-align: center; }
  .hero .eyebrow { justify-content: center; }
  .hero p { margin-inline: auto; }
  .hero h1 { font-size: clamp(42px, 12vw, 68px); }
  .thanks-art img { width: 120px; }
  .intake-grid { grid-template-columns: 1fr; }
  .intake-grid .field, .intake-grid .field-wide { display: block; grid-column: auto; }
  .intake-grid .field > span { margin-bottom: 3px; }
  .simple-fields .field { display: block; }
  .simple-fields .field > span { margin: 0 0 6px; }
  .upload-card { min-height: calc(100svh - 24px); }
  .upload-area {
    grid-template-columns: minmax(0, 1fr) 132px;
    min-height: clamp(300px, 48svh, 460px);
  }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .file-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page, .admin-shell { width: min(100% - 24px, 1120px); }
  .upload-card, .login-card { padding: 22px; border-radius: 18px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .type-switch { grid-template-columns: 1fr; }
  .upload-area {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
    min-height: clamp(300px, 52svh, 460px);
  }
  .drop-zone { flex-direction: column; padding: 18px 12px; }
  .upload-area > .primary-button { min-height: 56px; font-size: 13px; }
  .card-heading { flex-direction: column; gap: 8px; }
  .limit { line-height: 1.4; }
  .dashboard h1 { font-size: 43px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .intake-details { grid-template-columns: 1fr; gap: 4px; }
  .intake-details dd { margin-bottom: 8px; }
  .attachment-row { align-items: flex-start; }
  .attachment-row strong { max-width: 190px; }
}

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