/* All Done Property Management — owner onboarding form
   Brand: reference/brand/BRAND.md
   Deep blue #003F70 (primary) · Bright blue #009AD0 (accent) · Dark grey #4D4D4F (body)
   Montserrat, self-hosted — no third-party request from a page that collects personal data.

   Mobile first. Owners open this on a phone. */

@font-face {
  font-family: 'Montserrat';
  src: url('/assets/Montserrat-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/Montserrat-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/Montserrat-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --deep-blue: #003F70;
  --bright-blue: #009AD0;
  --dark-grey: #4D4D4F;
  --muted: #6B7280;
  --page-bg: #F4F6F8;
  --card-bg: #FFFFFF;
  --rule: #DFE4E9;
  --input-border: #C3CBD3;
  --warn-bg: #FFF8E6;
  --warn-border: #E8C766;
  --error: #B3261E;

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --max-width: 40rem;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark-grey);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- accessibility utilities --------------------------------------------- */

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

.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--deep-blue);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 10;
}
.skip-to-content:focus { left: 0; }

/* Visible focus on everything interactive. Never colour-only signalling. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--bright-blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- masthead ------------------------------------------------------------ */

.masthead { background: var(--deep-blue); padding: 1.125rem 1.25rem; }
.masthead__inner { max-width: var(--max-width); margin: 0 auto; }
.masthead__logo { display: block; height: 2.25rem; width: auto; }

/* --- layout -------------------------------------------------------------- */

.app {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem 1.125rem;
  box-shadow: 0 1px 3px rgba(0, 63, 112, 0.06);
}

.screen__title {
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.25;
  color: var(--deep-blue);
  margin: 0 0 0.5rem;
}
.screen__title:focus { outline: none; }

.screen__intro {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

a { color: var(--bright-blue); text-underline-offset: 2px; }
a:hover { color: var(--deep-blue); }

/* --- progress ------------------------------------------------------------ */

.progress { margin: 0 0 1rem; }
.progress__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.progress__section {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--deep-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.progress__count { font-size: 0.75rem; color: var(--muted); }
.progress__track {
  height: 6px;
  background: #E3E8ED;
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--bright-blue);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* --- fields -------------------------------------------------------------- */

.field {
  padding: 1.125rem 0;
  border-top: 1px solid var(--rule);
}
.field:first-of-type { border-top: 0; padding-top: 0; }

.field__label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep-blue);
  margin-bottom: 0.25rem;
}
.field__label--small {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.field__help {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.field__control { margin-top: 0.4rem; }

.field--skipped { opacity: 0.75; }

/* --- inputs -------------------------------------------------------------- */

.input {
  width: 100%;
  font-family: var(--font);
  /* 16px minimum, or iOS Safari zooms the whole page on focus. */
  font-size: 1rem;
  line-height: 1.4;
  color: var(--dark-grey);
  background: #fff;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
}
.input:focus { border-color: var(--bright-blue); }
.input:disabled { background: #F0F2F4; color: var(--muted); }
.input--textarea { resize: vertical; min-height: 5rem; }
.input--small { padding: 0.45rem 0.6rem; font-size: 0.9375rem; }

select.input { appearance: none; background-image: none; }

.stack > * + * { margin-top: 0.5rem; }
.group__row + .group__row { margin-top: 0.7rem; }

/* --- choices (radio / checkbox) ------------------------------------------ */

.choices { display: flex; flex-direction: column; gap: 0.5rem; }
.choices--inline { flex-direction: row; gap: 0.75rem; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  background: #fff;
}
.choice:hover { border-color: var(--bright-blue); }
.choice:has(input:checked) {
  border-color: var(--bright-blue);
  background: rgba(0, 154, 208, 0.06);
  box-shadow: inset 0 0 0 1px var(--bright-blue);
}
.choice--compact { padding: 0.5rem 0.75rem; align-items: center; flex: 0 0 auto; }
.choice--inline { border: 0; padding: 0; }
.choice--consent { align-items: flex-start; }

.choice__body { display: flex; flex-direction: column; }
.choice__label { font-size: 0.9375rem; }
.choice__help { font-size: 0.8125rem; color: var(--muted); margin-top: 0.1rem; }

.radio, .checkbox {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--bright-blue);
}
.choice--compact .radio,
.choice--compact .checkbox { margin-top: 0; }

/* --- buttons and links --------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  /* Comfortable thumb target. */
  min-height: 2.75rem;
}
.btn--primary { background: var(--deep-blue); color: #fff; }
.btn--primary:hover { background: #00538F; }
.btn--primary:disabled { background: #9AA7B2; cursor: default; }
.btn--ghost {
  background: #fff;
  color: var(--deep-blue);
  border-color: var(--input-border);
}
.btn--ghost:hover { border-color: var(--bright-blue); }
.btn--small { padding: 0.4rem 0.75rem; font-size: 0.8125rem; min-height: 2.25rem; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--bright-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link:hover { color: var(--deep-blue); }
.link--quiet { color: var(--muted); margin-left: 0.6rem; }
.link--skip { display: inline-block; margin-top: 0.6rem; color: var(--muted); }

/* --- skip affordance ----------------------------------------------------- */

.skip-reason {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.skip-reason .input { flex: 1 1 12rem; width: auto; }

.skip-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--muted);
  background: #F0F2F4;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}

/* --- repeatable groups --------------------------------------------------- */

.repeatable__row {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #FAFBFC;
}
.repeatable__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.repeatable__num { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

/* --- uploads ------------------------------------------------------------- */

.upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
}
.upload:first-child { border-top: 0; padding-top: 0; }
.upload__meta { display: flex; flex-direction: column; flex: 1 1 12rem; }
.upload__label { font-size: 0.9375rem; font-weight: 600; color: var(--deep-blue); }
.upload__hint { font-size: 0.75rem; color: var(--muted); }
.upload__list { flex: 1 1 100%; list-style: none; margin: 0.25rem 0 0; padding: 0; }
.upload__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
}
.upload__file { word-break: break-all; }
.upload__size { color: var(--muted); flex: 0 0 auto; }

/* --- review -------------------------------------------------------------- */

.review__section {
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--deep-blue);
  margin: 1.75rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--rule);
}
.review__list { margin: 0; }
.review__row { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.review__term { font-size: 0.75rem; color: var(--muted); margin: 0; }
.review__def {
  margin: 0.1rem 0 0;
  font-size: 0.9375rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.review__def > span:first-child { word-break: break-word; }
.review__files { list-style: none; margin: 0; padding: 0; }
.review__files li { display: flex; gap: 0.5rem; font-size: 0.875rem; padding: 0.3rem 0; }
.review__empty { font-size: 0.875rem; color: var(--muted); }

/* The follow-up list is deliberately set apart and framed as fine. */
.followup {
  margin: 1.75rem 0 0;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 1rem;
}
.followup__title {
  font-weight: 700;
  font-size: 1rem;
  color: #7A5A00;
  margin: 0 0 0.25rem;
}
.followup__intro { font-size: 0.875rem; color: #7A5A00; margin: 0 0 0.75rem; }
.followup__list { margin: 0; padding-left: 1.1rem; font-size: 0.875rem; }
.followup__list li { padding: 0.2rem 0; }
.followup__reason { color: var(--muted); margin-left: 0.4rem; font-style: italic; }

/* --- nav and save indicator ---------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.nav .btn--primary { margin-left: auto; order: 2; }
.nav .btn--ghost { order: 1; }
.nav .save-indicator { order: 3; flex: 1 1 100%; }

.save-indicator {
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1rem;
}
.save-indicator--error { color: var(--error); }

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0.75rem 0 0;
  min-height: 1rem;
}

/* --- footer -------------------------------------------------------------- */

footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  padding: 1.25rem 1rem 2rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
footer .masthead__inner { max-width: var(--max-width); margin: 0 auto; }

/* --- wider screens ------------------------------------------------------- */

@media (min-width: 34rem) {
  .app { padding: 2rem 1.5rem 3rem; }
  .card { padding: 2rem 1.75rem; border-radius: var(--radius); }
  .screen__title { font-size: 1.625rem; }
  .masthead { padding: 1.25rem 1.5rem; }
  .masthead__logo { height: 2.5rem; }
  .nav .save-indicator { flex: 0 0 auto; order: 0; margin-right: auto; }
  .nav .btn--ghost { order: 1; }
  .nav .btn--primary { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tier-A outstanding items get a firmer treatment than tier B (plan.md §5a). */
.followup--blocking {
  background: #FDECEA;
  border-color: #E0A9A3;
}
.followup--blocking .followup__title,
.followup--blocking .followup__intro { color: #8A2018; }
.followup__context {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
