/* Casa dos Associates — identidade baseada no KV (verde floresta, azul oceano, areia, amarelo solar). */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-bold.woff") format("woff"); }

:root {
  --green: #0f3b2c;
  --green-2: #1c5540;
  --green-soft: #e3ebdf;
  --ocean: #1f4fae;
  --ocean-soft: #dde6f6;
  --sand: #f1e4cc;
  --sand-2: #e8d7b8;
  --paper: #fbf6ec;
  --sun: #eea92a;
  --sun-soft: #fbe9c4;
  --ink: #12261e;
  --muted: #4d5e56;
  --danger: #9b1c22;
  --danger-soft: #f8e1dc;
  --ok: #1c5540;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(15, 59, 44, .08), 0 8px 24px -12px rgba(15, 59, 44, .25);
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Títulos "brush" do KV: usa fontes manuscritas do sistema quando existem; senão Poppins. */
  --brush: "Marker Felt", "Segoe Print", "Bradley Hand", "Poppins", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--ocean); text-underline-offset: .18em; }
a:hover { color: var(--green); }
p { margin: 0 0 .9rem; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }

:focus-visible { outline: 3px solid var(--ocean); outline-offset: 3px; border-radius: 6px; }
.visually-hidden, .legend-hidden > legend {
  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-link { position: absolute; left: -9999px; top: 0; background: var(--green); color: var(--paper); padding: .6rem 1rem; z-index: 10; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* Faixa quadriculada da borda do KV */
.stripe {
  height: 14px;
  flex: none;
  background: repeating-linear-gradient(90deg, var(--green) 0 22px, transparent 22px 44px);
}

/* ---------- Estrutura ---------- */
.page { width: 100%; max-width: 680px; margin: 0 auto; padding: 1rem 1rem 2rem; flex: 1; }
.page.narrow { max-width: 520px; padding-top: 2rem; }
.card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card-center { text-align: center; }
@media (min-width: 560px) { .card { padding: 1.75rem 1.75rem; } }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 680px; margin: 0 auto; padding: .6rem 1rem 0;
}
.topbar-brand img { display: block; width: 84px; }

.site-footer { text-align: center; padding: 1.25rem 1rem 1rem; color: var(--green); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; }
.site-footer p { margin: .35rem 0 0; }
.footer-wave { display: block; margin: 0 auto; }

/* ---------- Tipografia ---------- */
.eyebrow { font-size: .78rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--green); margin-bottom: .35rem; }
.title { font-family: var(--brush); font-weight: 700; color: var(--green); font-size: 1.85rem; letter-spacing: .01em; }
.title-sm { font-size: 1.4rem; }
.lead { font-size: 1.02rem; }
.muted { color: var(--muted); }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.disclaimer {
  background: var(--sun-soft); border-left: 4px solid var(--sun); border-radius: 10px;
  padding: .75rem .9rem; font-size: .93rem; margin: 1rem 0 0;
}

/* ---------- Login ---------- */
.login { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 1rem 2rem; position: relative; }
.hero { margin: 0 -1rem; border-bottom: 2px solid var(--green); overflow: hidden; max-height: 210px; }
.hero-art { display: block; width: 100%; height: 210px; object-fit: cover; object-position: 30% 60%; }
@media (min-width: 560px) {
  .hero { margin: 1rem 0 0; border: 2px solid var(--green); border-radius: var(--radius); max-height: 240px; }
  .hero-art { height: 240px; }
}
.login-card { margin-top: -2.5rem; text-align: center; }
.login-card .logo { width: 220px; display: block; margin: -.5rem auto .5rem; }
.login-card .form { text-align: left; margin-top: 1rem; }
.logo-sm { width: 150px; margin: 0 auto .75rem; display: block; }
.privacy { display: flex; gap: .65rem; align-items: flex-start; text-align: left; margin-top: 1.25rem; padding: .85rem .9rem; border-radius: var(--radius-sm); background: var(--ocean-soft); font-size: .88rem; }
.privacy img { flex: none; margin-top: .15rem; }
.privacy p { margin: 0; }
.deco { pointer-events: none; user-select: none; }
.deco-leaves { display: block; width: 220px; margin: .5rem auto 0; opacity: .95; }
.deco-corner { position: absolute; top: -2px; right: -2px; width: 78px; border-top-right-radius: var(--radius); opacity: .9; }

/* ---------- Formulários ---------- */
.field { margin: 0 0 1.25rem; border: 0; padding: 0; min-width: 0; }
fieldset.field { margin-inline: 0; }
.field-label { display: block; font-weight: 500; margin-bottom: .45rem; color: var(--green); font-size: 1.02rem; padding: 0; }
.hint { color: var(--muted); font-size: .88rem; margin: -.15rem 0 .6rem; }
.input {
  width: 100%; font: inherit; color: var(--ink); background: #fffdf8;
  border: 2px solid rgba(15, 59, 44, .45); border-radius: var(--radius-sm);
  padding: .75rem .85rem; min-height: 48px;
}
.input:focus { border-color: var(--green); }
textarea.input { resize: vertical; min-height: 96px; }
.input[aria-invalid="true"], [aria-invalid="true"] > .choices .choice, [aria-invalid="true"] .picker-list { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .9rem; font-weight: 500; margin: .4rem 0 0; }
.field-error::before { content: "! "; font-weight: 700; }
.counter { color: var(--muted); font-size: .8rem; text-align: right; margin: .25rem 0 0; }

.choices { display: grid; gap: .55rem; }
.choice {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .8rem .95rem; min-height: 52px;
  border: 2px solid rgba(15, 59, 44, .28); border-radius: 14px;
  background: #fffdf8; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.choice:hover { border-color: var(--green-2); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ocean); outline-offset: 2px; }
input[type="radio"] { accent-color: var(--green); width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; flex: none; }

.conditional { margin: -.25rem 0 1.25rem; padding: 1rem; border-radius: 14px; background: var(--sand); border: 2px dashed rgba(15, 59, 44, .35); }
.conditional .field { margin-bottom: 0; }

/* Nome com sugestões */
.combo-box { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  list-style: none; margin: 0; padding: .3rem; max-height: 260px; overflow-y: auto;
  background: #fffdf8; border: 2px solid var(--green); border-radius: 14px; box-shadow: var(--shadow);
}
.combo-list [role="option"] { padding: .75rem .8rem; min-height: 48px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; }
.combo-list [role="option"]:hover, .combo-list [aria-selected="true"] { background: var(--green-soft); }
.combo-empty { padding: .75rem .8rem; color: var(--muted); }

/* Seletor de pessoas */
.picker { margin-bottom: 1.25rem; }
.picker-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.picker-search { margin-bottom: .5rem; }
.picker-list {
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  border: 2px solid rgba(15, 59, 44, .3); border-radius: 14px; background: #fffdf8; padding: .3rem;
}
.picker-option { display: flex; gap: .7rem; align-items: center; padding: .7rem .75rem; min-height: 48px; border-radius: 10px; cursor: pointer; }
.picker-option:hover { background: var(--sand); }
.picker-option:has(input:checked) { background: var(--green-soft); font-weight: 500; }
.picker-option:has(input:focus-visible) { outline: 3px solid var(--ocean); outline-offset: -3px; }
.picker-option.is-disabled, .picker-option:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.picker-option input { margin: 0; }
.picker-none { color: var(--muted); border-bottom: 1px dashed rgba(15, 59, 44, .25); border-radius: 10px 10px 0 0; }
.picker-empty { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.picker-locked { background: var(--ocean-soft); border-radius: 10px; padding: .6rem .75rem; font-size: .88rem; margin: 0 0 .5rem; }
.is-locked .picker-search-wrap { display: none; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 500; letter-spacing: .02em;
  min-height: 48px; padding: .7rem 1.35rem;
  border-radius: 999px; border: 2px solid var(--green);
  background: var(--green); color: var(--paper); text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .05s;
}
.btn:hover { background: var(--green-2); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: .4rem 1rem; font-size: .9rem; }
.btn-outline, .btn-ghost { background: transparent; color: var(--green); }
.btn-outline:hover, .btn-ghost:hover { background: var(--green-soft); color: var(--green); }
.btn-ghost { border-color: transparent; text-decoration: underline; text-underline-offset: .2em; }
.btn-sun { background: var(--sun); border-color: var(--green); color: var(--green); font-weight: 700; }
.btn-sun:hover { background: #f4ba4c; color: var(--green); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #7d1519; color: #fff; }
.link-btn { font: inherit; color: var(--ocean); background: none; border: 0; padding: .35rem 0; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; min-height: 40px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.actions form { margin: 0; }

/* Avisos */
.notice { background: var(--ocean-soft); border: 2px solid var(--ocean); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.alert { border-radius: var(--radius-sm); padding: .8rem .95rem; margin-bottom: 1rem; }
.alert p:last-child { margin: 0; }
.alert-error { background: var(--danger-soft); border: 2px solid var(--danger); color: #5d0f13; }
.alert-ok { background: var(--green-soft); border: 2px solid var(--green); }
.badge { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 500; border: 1.5px solid currentColor; }
.badge-ok { color: var(--ok); background: var(--green-soft); }
.badge-warn { color: #7a4d00; background: var(--sun-soft); }
.badge-muted { color: var(--muted); background: #fff; }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--ocean); background: var(--ocean-soft); }

/* Participante — introdução */
.intro { overflow: hidden; padding-right: 5.2rem; }
@media (min-width: 560px) { .intro { padding-right: 6rem; } }
.facts { display: grid; gap: .6rem; margin: .75rem 0 0; }
.facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; border-bottom: 1px dashed rgba(15, 59, 44, .25); padding-bottom: .45rem; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 500; }
.house-pill { background: var(--ocean); color: #fff; border-radius: 999px; padding: .05rem .75rem; }

/* Progresso */
.progress { margin: .25rem 0 1rem; }
.progress ol { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; padding: 0; margin: 0; }
.progress li { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: .7rem; color: var(--muted); text-align: center; }
.progress-num {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--green); background: var(--paper); color: var(--green); font-weight: 700; font-size: .9rem;
}
.progress li.is-done .progress-num { background: var(--green); color: var(--paper); }
.progress li.is-current .progress-num { background: var(--sun); }
.progress li.is-current { color: var(--green); font-weight: 500; }
.progress-label { display: none; }
@media (min-width: 460px) { .progress-label { display: block; } }
.progress-text { text-align: center; font-size: .85rem; color: var(--muted); margin: .5rem 0 0; }
html:not(.js) .progress { display: none; }

.step-kicker { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ocean); font-weight: 500; margin-bottom: .25rem; }
.step h2:focus { outline: none; }
.step-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap-reverse; }
.step-nav .btn { flex: 1 1 auto; }
@media (min-width: 460px) { .step-nav .btn { flex: 0 0 auto; } }
html:not(.js) [data-next], html:not(.js) [data-prev], html:not(.js) .step-later, html:not(.js) .step-nav > span { display: none; }
.step-later { text-align: center; margin: .75rem 0 0; }
.save-status { text-align: center; font-size: .88rem; color: var(--muted); min-height: 1.4em; }
.save-status.is-ok { color: var(--ok); }
.save-status.is-error { color: var(--danger); font-weight: 500; }

/* Resumo */
.summary { margin: 1rem 0 0; display: grid; gap: 0; }
.summary > div { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .7rem 0; border-bottom: 1px dashed rgba(15, 59, 44, .25); }
.summary dt { color: var(--muted); font-size: .86rem; grid-column: 1; }
.summary dd { margin: 0; font-weight: 500; grid-column: 1; }
.summary .edit-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.summary-meta dd { font-weight: 400; font-size: .9rem; }

.success { text-align: center; }
.success .summary { text-align: left; }
.success:focus { outline: none; }
.success-sun { display: block; margin: 0 auto .5rem; }

.debug { text-align: left; white-space: pre-wrap; background: #fff; padding: .75rem; border-radius: 8px; font-size: .8rem; overflow: auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Versão enxuta (v1.2) ---------- */
.topbar { gap: .75rem; padding-top: .5rem; }
.topbar-brand img { width: 56px; }
.whoami { flex: 1; margin: 0; font-size: .9rem; line-height: 1.3; color: var(--green); }
.whoami .muted { font-size: .8rem; }
.topbar form { margin: 0; }
.page > .progress:first-child, .prefs > .progress { margin-top: 0; }
.step .title-sm { margin-bottom: .9rem; }
.choices-inline .choices { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choices-inline .choice { min-height: 48px; padding: .7rem .8rem; align-items: center; }
.step .field { margin-bottom: 1.1rem; }
.small-note { font-size: .85rem; margin: .75rem 0 0; }
.step-later { margin-top: .4rem; }
