:root {
  color-scheme: light;
  --fp-magenta: #c6005d;
  --fp-blue: #0198ce;
  --fp-orange: #fedf00;
  --fp-ink: #0a0000;
  --fp-gray: #5d5d5d;
  --fp-line: #e6e6e6;
  --fp-paper: #ffffff;
  --fp-soft: #f5f5f5;
  --shadow: 0 24px 60px rgba(10, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--fp-ink);
  background:
    linear-gradient(135deg, rgba(198, 0, 93, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(1, 152, 206, 0.16), transparent 38%),
    var(--fp-soft);
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 32px 20px;
}

.home-hero {
  position: relative;
  display: grid;
  gap: 20px;
  justify-items: start;
  width: 100%;
  padding: clamp(32px, 7vw, 76px);
  overflow: hidden;
  background: var(--fp-paper);
  border: 1px solid rgba(93, 93, 93, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--fp-magenta) 0 42%,
    var(--fp-blue) 42% 72%,
    var(--fp-orange) 72% 100%
  );
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 8px;
  height: 36px;
  align-items: end;
}

.brand-mark span {
  display: block;
  width: 28px;
  border-radius: 3px;
}

.brand-mark span:nth-child(1) {
  height: 28px;
  background: var(--fp-magenta);
}

.brand-mark span:nth-child(2) {
  height: 36px;
  background: var(--fp-blue);
}

.brand-mark span:nth-child(3) {
  height: 22px;
  background: var(--fp-orange);
}

.brand-logo {
  display: block;
  width: min(100%, 190px);
  height: auto;
}

.brand-logo-large {
  width: min(100%, 240px);
}

.brand-logo-header {
  width: min(46vw, 180px);
}

.eyebrow {
  margin: 0;
  color: var(--fp-gray);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(3rem, 10vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.primary-action,
.secondary-action,
.text-button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 310px);
  padding: 0 28px;
  font-size: 1.12rem;
  font-weight: 800;
}

.primary-action {
  color: var(--fp-paper);
  background: var(--fp-magenta);
  box-shadow: 0 12px 24px rgba(198, 0, 93, 0.24);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #a90050;
}

.secondary-action {
  color: var(--fp-ink);
  background: var(--fp-line);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: #d7d7d7;
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.logout-form {
  display: flex;
  justify-content: center;
  margin: 24px 0 0;
}

.text-button {
  padding: 0 18px;
  color: var(--fp-gray);
  background: transparent;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--fp-magenta);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 32px;
  background: var(--fp-paper);
  border: 1px solid rgba(93, 93, 93, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  font-size: 2.25rem;
  line-height: 1;
}

.google-action {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--fp-ink);
  background: #fff;
  border: 2px solid var(--fp-line);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.google-action:hover,
.google-action:focus-visible {
  border-color: var(--fp-blue);
  outline: 3px solid rgba(1, 152, 206, 0.16);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fp-gray);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--fp-line);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--fp-gray);
  font-size: 0.95rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 2px solid var(--fp-line);
  border-radius: 6px;
  font-size: 1.2rem;
}

.field input:focus {
  border-color: var(--fp-blue);
  outline: 3px solid rgba(1, 152, 206, 0.16);
}

.error {
  margin: 0;
  color: var(--fp-magenta);
  font-weight: 700;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: var(--fp-ink);
  background: var(--fp-paper);
  border: 1px solid rgba(93, 93, 93, 0.16);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(10, 0, 0, 0.08);
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
}

.icon-link:hover,
.icon-link:focus-visible {
  color: var(--fp-paper);
  background: var(--fp-magenta);
}

.form-panel {
  position: relative;
  padding: clamp(24px, 5vw, 48px);
  overflow: hidden;
  background: var(--fp-paper);
  border: 1px solid rgba(93, 93, 93, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--fp-magenta) 0 42%,
    var(--fp-blue) 42% 72%,
    var(--fp-orange) 72% 100%
  );
}

.form-panel h1 {
  margin-bottom: 28px;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
}

.pickup-form {
  display: grid;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.field select,
.field textarea,
.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  color: var(--fp-ink);
  background: var(--fp-paper);
  border: 2px solid var(--fp-line);
  border-radius: 6px;
  font-size: 1.1rem;
}

.field textarea {
  min-height: 116px;
  padding-top: 12px;
  resize: vertical;
}

.field select:focus,
.field textarea:focus,
.field input:focus {
  border-color: var(--fp-blue);
  outline: 3px solid rgba(1, 152, 206, 0.16);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--fp-magenta);
}

.field input[readonly] {
  color: var(--fp-gray);
  background: var(--fp-soft);
}

.field-error {
  margin: 0;
  color: var(--fp-magenta);
  font-size: 0.95rem;
  font-weight: 700;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--fp-gray);
  font-size: 0.95rem;
  font-weight: 800;
}

.choice,
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  background: var(--fp-soft);
  border: 2px solid var(--fp-line);
  border-radius: 6px;
  font-weight: 800;
}

.choice input,
.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--fp-magenta);
}

.conditional-field {
  display: none;
}

.conditional-field.is-visible {
  display: grid;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.photo-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: var(--fp-soft);
  border: 2px dashed var(--fp-line);
  border-radius: 8px;
}

.photo-panel-top {
  border-style: solid;
}

.photo-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.photo-panel p {
  margin: 4px 0 0;
  color: var(--fp-gray);
}

.ocr-debug {
  display: none;
  max-height: 180px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  color: var(--fp-ink);
  white-space: pre-wrap;
  background: var(--fp-paper);
  border: 1px solid var(--fp-line);
  border-radius: 6px;
  font-size: 0.9rem;
}

.ocr-debug.is-visible {
  display: block;
}

.photo-button {
  min-width: 170px;
}

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

.saved-panel {
  display: grid;
  gap: 20px;
}

.saved-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.saved-summary div {
  padding: 16px;
  background: var(--fp-soft);
  border-radius: 6px;
}

.saved-summary dt {
  color: var(--fp-gray);
  font-size: 0.85rem;
  font-weight: 800;
}

.saved-summary dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.history-panel h1 {
  margin-bottom: 24px;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.history-table th,
.history-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--fp-line);
}

.history-table th {
  color: var(--fp-gray);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.history-table a {
  color: var(--fp-magenta);
  font-weight: 800;
}

.history-action-heading,
.history-action-cell {
  width: 1%;
  text-align: center;
}

.history-action-cell form {
  margin: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--fp-line);
  border-radius: 6px;
  background: #fff;
  color: var(--fp-gray);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--fp-magenta);
  color: var(--fp-magenta);
  outline: none;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: #b42318;
  color: #b42318;
}

.empty-state {
  margin: 0;
  color: var(--fp-gray);
  font-weight: 700;
}

@media (max-width: 560px) {
  .home-shell {
    padding: 18px;
  }

  .home-hero {
    padding: 32px 22px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .form-grid,
  .saved-summary {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
  }

  .photo-panel {
    grid-template-columns: 1fr;
  }

  .photo-button {
    width: 100%;
  }
}
