/* Document-style form theme — matches the emailed Shower Return Report */

:root {
  --gold: #c8a96a;
  --gold-deep: #938165;
  --teal: #2E5960;
  --teal-bright: #3d7782;
  --bronze: #b87253;

  --bg: #faf7f1;
  --bg-cream: #f3ede1;
  --surface: #ffffff;
  --surface-input: #fbf9f3;

  --line: rgba(46, 89, 96, 0.18);
  --line-strong: rgba(46, 89, 96, 0.35);
  --line-soft: rgba(46, 89, 96, 0.10);

  --text: #1e2a2c;
  --muted: #5a6669;
  --dim: #8a9296;

  --error: #b04545;
  --success: #3d7e5a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Arial, Helvetica, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Inert aurora — divs are harmless if left in HTML */
.aurora { display: none; }

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 22px 60px;
  flex: 1;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all 0.18s ease;
}
.back:hover {
  color: var(--teal);
  border-color: var(--line-strong);
  background: var(--bg-cream);
}
.back svg { width: 14px; height: 14px; stroke-width: 2; }
.logo-mini {
  height: 32px;
  width: auto;
  opacity: 0.95;
}

/* Page banner — matches email's black header */
.banner { display: none; }
form.report .form-banner,
.report-card .form-banner {
  background: #0a1416;
  padding: 20px 24px;
  text-align: center;
}
.form-banner-title {
  font-family: 'Bebas Neue', 'Cinzel', Arial, sans-serif;
  font-weight: 400;
  font-size: 28px;
  color: #efe9dd;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

/* The main form is now styled like the email's white card */
form.report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(30, 42, 44, 0.05);
}
.report-body {
  padding: 24px 24px 18px;
}

/* Header field grid — mirrors the email's 4-cell header table */
.card-section { margin-bottom: 18px; }
.card-section.no-bg { background: transparent; padding: 0; }
.card-section.no-bg .section-head { padding-top: 0; }

.header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 22px;
}
.header-grid .field {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.header-grid .field:nth-child(odd) { border-right: 1px solid var(--line); }
.header-grid .field:nth-last-child(-n+2) { border-bottom: none; }
.header-grid .field label {
  background: var(--bg-cream);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 12px;
  margin: 0;
  display: flex;
  align-items: center;
}
.header-grid .field input {
  border: none !important;
  background: var(--surface) !important;
  border-radius: 0 !important;
  padding: 10px 12px !important;
  font-size: 14px;
  color: var(--text);
  outline: none;
  width: 100%;
}
.header-grid .field input:focus {
  background: #fcf7e8 !important;
  box-shadow: inset 0 0 0 2px var(--gold) !important;
}
.header-grid .req { display: none; }

/* Section header — matches the email h2 (Bebas Neue teal w/ gold underline) */
.section-head {
  display: block;
  font-family: 'Bebas Neue', 'Cinzel', Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  margin: 22px 0 12px;
}
.card-section .section-head { margin-top: 0; }

/* Standard fields */
.field {
  margin-bottom: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.35;
}
.field label u { text-decoration-color: var(--gold); }
.field .req {
  color: var(--bronze);
  margin-left: 2px;
}
.field .muted {
  color: var(--dim);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%232E5960' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1.5 6 6.5 11 1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
}
.field select option { background: var(--surface); color: var(--text); }
.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.18);
}
.field .hint {
  font-size: 12px;
  color: var(--dim);
  margin-top: 6px;
  line-height: 1.45;
}

/* Input with trailing unit suffix */
.input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-suffix input { padding-right: 78px; }
.input-suffix .suffix {
  position: absolute;
  right: 14px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  pointer-events: none;
}

/* Handoff briefing — mirrors the email's gold-left-border quote block */
.handoff-block {
  background: var(--bg-cream);
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  border-radius: 0 6px 6px 0;
  line-height: 1.55;
  color: var(--text);
}

/* Radio buttons */
.radio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all 0.18s ease;
}
.radio:hover { border-color: var(--line-strong); }
.radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.radio input[type="radio"]:checked {
  border-color: var(--teal);
  background: radial-gradient(circle, var(--teal) 0% 45%, transparent 50%);
}
.radio:has(input:checked) {
  border-color: var(--teal);
  background: rgba(46, 89, 96, 0.08);
}

/* Checkboxes */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all 0.18s ease;
}
.check:hover { border-color: var(--line-strong); }
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.check input[type="checkbox"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}
.check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check:has(input:checked) {
  border-color: var(--teal);
  background: rgba(46, 89, 96, 0.08);
}

/* Optional replacement-panel toggle — bronze accent like the email */
.toggle-section {
  background: rgba(184, 114, 83, 0.08);
  border: 1px solid rgba(184, 114, 83, 0.35);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  opacity: 0;
}
.toggle-box {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  position: relative;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.toggle input[type="checkbox"]:checked + .toggle-box {
  background: var(--bronze);
  border-color: var(--bronze);
}
.toggle input[type="checkbox"]:checked + .toggle-box::after {
  content: '';
  position: absolute;
  top: 3px; left: 7px;
  width: 5px; height: 11px;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.toggle-label { flex: 1; }
.toggle-sub {
  margin-top: 8px;
  margin-left: 34px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.hidden { display: none; }

/* Replacement section gets bronze section-head when shown */
#replacementBlock .section-head {
  color: var(--bronze);
  border-bottom-color: var(--bronze);
}

/* File drop */
.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  background: var(--bg-cream);
  transition: all 0.18s ease;
  cursor: pointer;
  position: relative;
}
.file-drop:hover {
  border-color: var(--gold);
  background: rgba(200, 169, 106, 0.08);
}
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-drop .drop-icon {
  color: var(--gold);
  margin-bottom: 8px;
}
.file-drop .drop-icon svg { width: 28px; height: 28px; stroke-width: 1.6; }
.file-drop .drop-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 3px;
}
.file-drop .drop-sub {
  font-size: 12px;
  color: var(--muted);
}
.file-list {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}
.file-list .file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.file-list .file:last-child { border-bottom: none; }
.file-list .file .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-list .file .size { color: var(--dim); font-variant-numeric: tabular-nums; }

/* Form footer area inside the white card (action buttons live here) */
.report-footer {
  background: var(--bg-cream);
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.actions {
  display: flex;
  gap: 12px;
}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.18s ease;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #0a1416;
  box-shadow: 0 2px 8px -2px rgba(200, 169, 106, 0.5);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(200, 169, 106, 0.7);
  filter: brightness(1.04);
}
.btn-primary:disabled {
  background: var(--dim);
  color: var(--bg-cream);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  background: var(--bg-cream);
  color: var(--teal);
  border-color: var(--teal);
}

/* Status message */
.status {
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  display: none;
}
.status.show { display: block; }
.status.error {
  background: rgba(176, 69, 69, 0.08);
  color: var(--error);
  border: 1px solid rgba(176, 69, 69, 0.25);
}
.status.success {
  background: rgba(61, 126, 90, 0.08);
  color: var(--success);
  border: 1px solid rgba(61, 126, 90, 0.25);
}

/* Success screen — keep the document feel */
.success-screen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 48px 28px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(30, 42, 44, 0.05);
}
.success-screen .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(61, 126, 90, 0.12);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.success-screen .check svg { width: 32px; height: 32px; stroke-width: 2.5; }
.success-screen h2 {
  font-family: 'Bebas Neue', 'Cinzel', Arial, sans-serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.success-screen p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 26px;
}
.success-screen .actions { max-width: 360px; margin: 0 auto; }

/* Page-level footer */
footer {
  text-align: center;
  padding: 20px 18px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
footer a { color: var(--dim); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--teal); }

@media (max-width: 600px) {
  .container { padding: 18px 14px 50px; }
  .report-body { padding: 18px 16px 12px; }
  .report-footer { padding: 16px; }
  .form-banner { padding: 18px 16px; }
  .form-banner-title { font-size: 22px; letter-spacing: 0.06em; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field { margin-bottom: 14px; }
  .header-grid { grid-template-columns: 1fr; }
  .header-grid .field { grid-template-columns: 110px 1fr; border-right: none !important; }
  .header-grid .field:last-child { border-bottom: none; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .actions { flex-direction: column-reverse; }
  .topbar { gap: 10px; }
  .logo-mini { height: 26px; }
}
