/* ADA Report form — scoped under .ada-report-root so it never leaks into a theme. */
.ada-report-root {
  --accent: #0b3d91;
  --ink: #0f1b33;
  --ink-2: #3b4a68;
  --muted: #5a6a85;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --border: #d6ddea;
  --error: #b32d2e;
  --radius: 12px;
  --tap: 48px;
  display: block;
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-width: 820px;
  margin: 0 auto;
}
.ada-report-root *, .ada-report-root *::before, .ada-report-root *::after { box-sizing: border-box; }

.ada-report-root .ada-report-header { margin-bottom: 16px; }
.ada-report-root .ada-report-header h2 { margin: 0 0 4px; font-size: 1.35rem; color: var(--ink); }
.ada-report-root .ada-report-header p  { margin: 0; color: var(--ink-2); }

.ada-report-root fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 4px;
  margin: 14px 0;
  background: var(--surface-2);
}
.ada-report-root fieldset > legend {
  font-weight: 700;
  color: var(--ink);
  padding: 0 6px;
}

.ada-report-root .ada-report-row { margin-bottom: 12px; }
.ada-report-root .ada-report-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.ada-report-root .req { color: var(--error); }
.ada-report-root .ada-report-hint { display: block; margin-top: 4px; color: var(--muted); font-size: .9em; }

.ada-report-root input[type="text"],
.ada-report-root input[type="email"],
.ada-report-root input[type="tel"],
.ada-report-root input[type="date"],
.ada-report-root input[type="number"],
.ada-report-root select,
.ada-report-root textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ada-report-root textarea { min-height: 120px; resize: vertical; }
.ada-report-root input[readonly] { background: #f7f9ff; color: var(--ink-2); }
.ada-report-root input:focus,
.ada-report-root select:focus,
.ada-report-root textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,61,145,.15);
}

.ada-report-root .ada-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 14px;
}

.ada-report-root input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.ada-report-root .ada-report-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ada-report-root .ada-report-previews figure {
  margin: 0;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.ada-report-root .ada-report-previews img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}
.ada-report-root .ada-report-previews figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .75em;
  text-align: center;
}

.ada-report-root .ada-report-consent {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink-2);
}
.ada-report-root .ada-report-consent label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.ada-report-root .ada-report-consent input[type="checkbox"] { margin-top: 4px; flex: 0 0 auto; }

.ada-report-root .ada-report-actions { margin-top: 16px; }
.ada-report-root .ada-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: transform .05s ease, box-shadow .15s ease;
}
.ada-report-root .ada-report-btn--primary {
  background: var(--accent);
  color: #fff;
}
.ada-report-root .ada-report-btn--primary:hover { box-shadow: 0 4px 14px rgba(11,61,145,.25); }
.ada-report-root .ada-report-btn--primary:active { transform: translateY(1px); }
.ada-report-root .ada-report-btn--ghost {
  background: transparent;
  color: var(--accent);
  margin-top: 6px;
}
.ada-report-root .ada-report-btn--ghost:hover { background: rgba(11,61,145,.08); }

.ada-report-root .ada-report-legal {
  margin-top: 14px;
  color: var(--muted);
  font-size: .88em;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.ada-report-root .ada-report-errors {
  background: #fff5f5;
  border: 1px solid #f3bcbc;
  color: #8c2121;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ada-report-root .ada-report-errors ul { margin: 6px 0 0 18px; padding: 0; }

.ada-report-root .ada-report-success {
  padding: 18px;
  background: #f0fbf4;
  border: 1px solid #bde3c8;
  border-radius: var(--radius);
}
.ada-report-root .ada-report-success h2 { margin: 0 0 6px; color: #156e3b; }
.ada-report-root .ada-report-success .ada-report-ref { margin: 0 0 8px; color: #156e3b; }
.ada-report-root .ada-report-success code { background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid #bde3c8; }

.ada-report-root .ada-report-disabled {
  padding: 14px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  border-radius: var(--radius);
}

.ada-report-root .ada-report-honey {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Compliance-era hint (shown once a year is entered in building-age fieldset). */
.ada-report-root .ada-report-era {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
  font-size: .93em;
}
.ada-report-root .ada-report-era strong { color: var(--ink); }
.ada-report-root .ada-report-era--pre { border-left-color: #b32d2e; }
.ada-report-root .ada-report-era--mid { border-left-color: #c28400; }
.ada-report-root .ada-report-era--new { border-left-color: #156e3b; }

@media (prefers-color-scheme: dark) {
  .ada-report-root {
    --ink: #f0f3fa;
    --ink-2: #c7d0e3;
    --muted: #9fb0cf;
    --surface: #121a2c;
    --surface-2: #0e1628;
    --border: #26324c;
  }
  .ada-report-root input[readonly] { background: #1a2540; color: var(--ink-2); }
  .ada-report-root .ada-report-consent { color: var(--ink-2); }
  .ada-report-root .ada-report-errors   { background: #2a0f0f; color: #f5c0c0; border-color: #633636; }
  .ada-report-root .ada-report-success  { background: #0b2418; color: #b9e3c9; border-color: #1f5a3a; }
  .ada-report-root .ada-report-success h2,
  .ada-report-root .ada-report-success .ada-report-ref { color: #9ae0b4; }
}

/* ---------------- Narrow-screen adjustments (handheld) ---------------- */
.ada-report-root img { max-width: 100%; height: auto; display: block; }
.ada-report-root { overflow-wrap: break-word; word-break: break-word; }

@media (max-width: 480px) {
  .ada-report-root {
    padding: 14px 12px;
    border-radius: 10px;
    margin: 0 -4px;           /* claw back a few px the theme wrapper may cost us */
  }
  .ada-report-root .ada-report-header h2 { font-size: 1.2rem; }
  .ada-report-root fieldset {
    padding: 12px 12px 4px;
    margin: 12px 0;
  }
  .ada-report-root .ada-report-grid {
    grid-template-columns: 1fr;        /* stack all fields in one column */
    gap: 10px;
  }
  .ada-report-root .ada-report-previews {
    grid-template-columns: repeat(2, 1fr);
  }
  .ada-report-root .ada-report-previews img { height: 120px; }
  .ada-report-root .ada-report-btn { width: 100%; }
  .ada-report-root .ada-report-btn--ghost { margin-top: 8px; }
  .ada-report-root input[type="text"],
  .ada-report-root input[type="email"],
  .ada-report-root input[type="tel"],
  .ada-report-root input[type="date"],
  .ada-report-root input[type="number"],
  .ada-report-root select,
  .ada-report-root textarea {
    font-size: 16px;                   /* prevent iOS focus-zoom */
    min-height: 48px;
  }
}

/* Tablet / phablet */
@media (min-width: 481px) and (max-width: 768px) {
  .ada-report-root { padding: 16px; }
  .ada-report-root .ada-report-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
