/* ===== Theme Variables ===== */
:root {
  --primary: #3d5c1a;
  --primary-light: #4a7425;
  --primary-lighter: #5a8a32;
  --primary-bg: rgba(61, 92, 26, 0.06);
  --primary-bg-hover: rgba(61, 92, 26, 0.1);

  --bg: #f8f9f6;
  --bg-white: #ffffff;
  --bg-muted: #f0f2ec;
  --bg-input: #ffffff;

  --text: #1e2e14;
  --text-secondary: #6b7568;
  --text-muted: #94a38e;
  --text-placeholder: #b0baa9;

  --border: #d8ddd0;
  --border-light: #e8ede0;
  --border-focus: #3d5c1a;

  --red: #dc3545;
  --red-light: #fef2f2;
  --red-border: #fca5a5;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --yellow: #ca8a04;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.2s ease;

  /* Safe area for notched phones */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ===== Header ===== */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: 0.875rem 1.5rem;
  padding-top: calc(0.875rem + var(--safe-top));
  padding-left: calc(1.5rem + var(--safe-left));
  padding-right: calc(1.5rem + var(--safe-right));
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.header-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ===== Hero ===== */
.hero {
  background: var(--primary);
  padding: 3rem 1.5rem;
  padding-left: calc(1.5rem + var(--safe-left));
  padding-right: calc(1.5rem + var(--safe-right));
  text-align: center;
}

.hero-inner {
  max-width: 560px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

/* ===== Emergency Banner ===== */
.emergency-banner {
  background: var(--red-light);
  border-bottom: 2px solid var(--red-border);
  padding: 1rem 1.5rem;
  padding-left: calc(1.5rem + var(--safe-left));
  padding-right: calc(1.5rem + var(--safe-right));
  display: none;
}

.emergency-banner.visible {
  display: block;
}

.emergency-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.emergency-icon {
  width: 28px;
  height: 28px;
  color: var(--red);
  flex-shrink: 0;
}

.emergency-inner strong {
  color: var(--red);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.15rem;
}

.emergency-inner p {
  color: #991b1b;
  font-size: 0.82rem;
}

/* ===== Form Container ===== */
.form-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  padding-left: calc(1rem + var(--safe-left));
  padding-right: calc(1rem + var(--safe-right));
  padding-bottom: calc(4rem + var(--safe-bottom));
}

/* ===== Form Sections ===== */
.form-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.form-section:hover {
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.section-number {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ===== Form Elements ===== */
.form-row {
  margin-bottom: 0.875rem;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.form-group {
  margin-bottom: 0.5rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.required {
  color: var(--red);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  /* 16px prevents iOS auto-zoom on focus */
  font-size: 16px;
  padding: 0.7rem 0.85rem;
  min-height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 92, 26, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-placeholder);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

/* ===== Urgency Pills ===== */
.urgency-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.radio-pill {
  cursor: pointer;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  transition: all var(--transition);
  user-select: none;
}

.radio-pill input:checked ~ .pill.low {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.radio-pill input:checked ~ .pill.medium {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.radio-pill input:checked ~ .pill.high {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.radio-pill input:checked ~ .pill.emergency {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.pill:active {
  transform: scale(0.96);
}

/* ===== Checkbox ===== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  user-select: none;
  line-height: 1.5;
  padding: 0.5rem 0;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg-white);
  position: relative;
  transition: all var(--transition);
  margin-top: 1px;
}

.checkbox-label input:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ===== Suspect Toggle ===== */
.suspect-toggle {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  transition: all var(--transition);
}

.suspect-toggle:has(input:checked) {
  border-color: var(--red);
  background: var(--red-light);
}

.suspect-toggle .checkbox-label {
  padding: 0;
  gap: 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.suspect-toggle .checkmark {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-width: 2px;
  border-radius: 6px;
}

.suspect-toggle input:checked ~ .checkmark {
  background: var(--red);
  border-color: var(--red);
}

.suspect-toggle input:checked ~ .checkmark::after {
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border-width: 0 2.5px 2.5px 0;
}

/* ===== Dynamic Cards ===== */
.dynamic-card {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 0.875rem;
}

.dynamic-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dynamic-card h3::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-lighter);
}

.dynamic-card .form-row:last-child {
  margin-bottom: 0;
}

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-muted);
  -webkit-tap-highlight-color: transparent;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.upload-zone:active {
  transform: scale(0.99);
}

.upload-svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.upload-zone:hover .upload-svg,
.upload-zone.dragover .upload-svg {
  color: var(--primary);
}

.upload-main {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.upload-browse {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.upload-browse:hover {
  text-decoration: underline;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Preview Grid ===== */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  aspect-ratio: 1;
  background: var(--bg-muted);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  -webkit-tap-highlight-color: transparent;
}

.preview-remove:hover {
  background: var(--red);
  transform: scale(1.1);
}

.preview-remove:active {
  transform: scale(0.95);
}

/* ===== Privacy Notice ===== */
.privacy-notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.privacy-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--text-muted);
  margin-top: 2px;
}

.privacy-notice p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.privacy-notice strong {
  color: var(--text);
}

/* ===== Confirm Box ===== */
.confirm-box {
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.5rem;
  transition: border-color var(--transition);
}

.confirm-box:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.confirm-box .checkbox-label {
  padding: 0;
  gap: 0.85rem;
  align-items: flex-start;
}

.confirm-box .checkmark {
  margin-top: 2px;
}

.confirm-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.confirm-box.error {
  border-color: var(--red);
  background: var(--red-light);
}

/* ===== Submit Button ===== */
.submit-btn {
  width: 100%;
  padding: 1rem;
  min-height: 52px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 0.75rem;
  box-shadow: 0 1px 2px rgba(61,92,26,0.2);
  -webkit-tap-highlight-color: transparent;
}

.submit-btn:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(61,92,26,0.25);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-sm);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Error Banner ===== */
.error-banner {
  background: var(--bg-white);
  border: 1px solid #e53e3e;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.error-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.error-banner-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: #e53e3e;
}

.error-banner h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c53030;
  margin-bottom: 0.3rem;
}

.error-banner p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Success Message ===== */
.success-message {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.success-checkmark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.success-checkmark svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.success-message h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.success-message > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.reference-number {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.reference-number strong {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ref-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Honeypot ===== */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ===== Validation Errors ===== */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
}

.error-message {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.3rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-light);
  padding: 2rem 1.5rem;
  padding-bottom: calc(2rem + var(--safe-bottom));
  text-align: center;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.6rem;
  opacity: 0.5;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.footer-emergency {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-emergency a {
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
}

.footer-emergency a:hover {
  text-decoration: underline;
}

/* ========================================
   MOBILE — max-width: 640px
   ======================================== */
@media (max-width: 640px) {
  /* Header */
  .site-header {
    padding: 0.75rem 1rem;
    padding-top: calc(0.75rem + var(--safe-top));
    padding-left: calc(1rem + var(--safe-left));
    padding-right: calc(1rem + var(--safe-right));
  }

  .header-badge {
    display: none;
  }

  .logo {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  /* Hero */
  .hero {
    padding: 2rem 1.25rem;
    padding-left: calc(1.25rem + var(--safe-left));
    padding-right: calc(1.25rem + var(--safe-right));
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero p {
    font-size: 0.88rem;
  }

  /* Form container — edge-to-edge feel */
  .form-container {
    padding: 0.75rem 0.5rem 5rem;
    padding-left: calc(0.5rem + var(--safe-left));
    padding-right: calc(0.5rem + var(--safe-right));
    padding-bottom: calc(5rem + var(--safe-bottom));
  }

  /* Sections */
  .form-section {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
  }

  .section-header {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .section-number {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  /* Grid stacks to single column */
  .form-row.two-col {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .form-row {
    margin-bottom: 0.5rem;
  }

  .form-group {
    margin-bottom: 0.35rem;
  }

  .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
  }

  /* Bigger touch targets on inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    padding: 0.75rem 0.85rem;
    min-height: 50px;
    border-radius: var(--radius-sm);
  }

  textarea {
    min-height: 130px;
  }

  /* Urgency pills — full width row */
  .urgency-radios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .pill {
    width: 100%;
    text-align: center;
    padding: 0.6rem 0.5rem;
    min-height: 44px;
    font-size: 0.85rem;
  }

  /* Checkbox — bigger tap area */
  .checkbox-label {
    padding: 0.6rem 0;
    gap: 0.7rem;
    font-size: 0.88rem;
  }

  .checkmark {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
  }

  .checkbox-label input:checked ~ .checkmark::after {
    left: 8px;
    top: 3px;
    width: 7px;
    height: 13px;
  }

  /* Dynamic cards */
  .dynamic-card {
    padding: 1rem;
    margin-top: 0.75rem;
  }

  .dynamic-card .form-row.two-col {
    grid-template-columns: 1fr;
  }

  /* Upload zone — taller tap target */
  .upload-zone {
    padding: 2rem 1rem;
  }

  .upload-svg {
    width: 40px;
    height: 40px;
  }

  .upload-main {
    font-size: 0.92rem;
  }

  /* Preview grid — bigger thumbnails, bigger remove */
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  .preview-remove {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    top: 4px;
    right: 4px;
  }

  /* Privacy */
  .privacy-notice {
    padding: 0.875rem 1rem;
  }

  .privacy-notice p {
    font-size: 0.78rem;
  }

  /* Confirm box */
  .confirm-box {
    padding: 1rem;
  }

  .confirm-box .checkbox-label {
    gap: 0.75rem;
  }

  .confirm-text {
    font-size: 0.9rem;
  }

  /* Submit — bigger on mobile */
  .submit-btn {
    padding: 1rem;
    min-height: 54px;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
  }

  /* Emergency banner */
  .emergency-banner {
    padding: 0.875rem 1rem;
    padding-left: calc(1rem + var(--safe-left));
    padding-right: calc(1rem + var(--safe-right));
  }

  .emergency-inner {
    flex-direction: row;
    text-align: left;
    gap: 0.75rem;
  }

  .emergency-icon {
    width: 24px;
    height: 24px;
  }

  .emergency-inner strong {
    font-size: 0.82rem;
  }

  .emergency-inner p {
    font-size: 0.78rem;
  }

  /* Success */
  .success-message {
    padding: 2.5rem 1.25rem;
  }

  .success-message h2 {
    font-size: 1.15rem;
  }

  .reference-number {
    font-size: 0.88rem;
    padding: 0.75rem;
    word-break: break-all;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 1rem;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
  }
}

/* ========================================
   EXTRA SMALL — max-width: 380px
   ======================================== */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.25rem;
  }

  .hero p {
    font-size: 0.82rem;
  }

  .form-section {
    padding: 1rem 0.85rem;
  }

  .section-header h2 {
    font-size: 0.95rem;
  }

  .urgency-radios {
    grid-template-columns: 1fr 1fr;
  }

  .pill {
    padding: 0.55rem 0.4rem;
    font-size: 0.8rem;
  }

  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   TABLET — 641px to 1024px
   ======================================== */
@media (min-width: 641px) and (max-width: 1024px) {
  .form-container {
    padding: 1.5rem 1.5rem 4rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  select {
    min-height: 48px;
  }

  .pill {
    min-height: 42px;
    padding: 0.5rem 1.1rem;
  }

  .submit-btn {
    min-height: 52px;
  }
}

/* ========================================
   HOVER CAPABLE DEVICES ONLY
   ======================================== */
@media (hover: hover) {
  .pill:hover {
    border-color: var(--text-muted);
  }

  .upload-browse:hover {
    text-decoration: underline;
  }

  .submit-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(61,92,26,0.25);
    transform: translateY(-1px);
  }

  .form-section:hover {
    box-shadow: var(--shadow);
  }

  .preview-remove:hover {
    background: var(--red);
    transform: scale(1.1);
  }
}

/* No hover — remove hover effects on touch devices */
@media (hover: none) {
  .form-section:hover {
    box-shadow: var(--shadow-sm);
  }

  .submit-btn:hover {
    background: var(--primary);
    box-shadow: 0 1px 2px rgba(61,92,26,0.2);
    transform: none;
  }

  .preview-remove:hover {
    transform: none;
  }
}
