:root {
  --sage: #8c9c92;
  --mist: #e6e9e7;
  --forest: #173f34;
  --forest-soft: #315f50;
  --cream: #f7f4ee;
  --white: #fff;
  --ink: #183229;
  --muted: #66756f;
  --line: rgba(23, 63, 52, .16);
  --danger: #9e352f;
  --success: #276849;
  --shadow: 0 24px 70px rgba(28, 55, 47, .13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 4%, rgba(140, 156, 146, .26), transparent 28rem),
    var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; }
button, input, select { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.pre-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.pre-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
  background: var(--forest);
}

.pre-header-inner,
.pre-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.pre-header-inner { min-height: 86px; }

.pre-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  text-decoration: none;
}

.pre-brand img {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}

.pre-brand span {
  display: grid;
  line-height: 1.05;
}

.pre-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.pre-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pre-security {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, .86);
  font-size: .84rem;
  font-weight: 700;
}

.pre-security span:first-child {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}

.pre-main { min-height: calc(100vh - 180px); }

.pre-intro {
  padding: 66px 0 116px;
  background: var(--forest);
  color: var(--white);
}

.pre-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 56px;
}

.pre-eyebrow,
.pre-kicker {
  margin: 0 0 12px;
  color: var(--sage);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pre-intro h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}

.pre-intro p:last-child {
  max-width: 670px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .75);
  font-size: 1.05rem;
}

.pre-deadline {
  min-width: 226px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}

.pre-deadline span,
.pre-deadline small {
  display: block;
  color: rgba(255, 255, 255, .67);
  font-size: .74rem;
}

.pre-deadline strong {
  display: block;
  margin: 3px 0;
  font-size: 1.02rem;
}

.pre-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  margin-top: -70px;
  padding-bottom: 72px;
}

.pre-summary,
.pre-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.pre-summary {
  position: sticky;
  top: 24px;
  padding: 28px;
}

.pre-summary h2,
.pre-form-heading h2,
.pre-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -.025em;
}

.pre-summary dl { margin: 24px 0; }

.pre-summary dl div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.pre-summary dt {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pre-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.pre-summary-note {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.pre-side-steps {
  display: grid;
  gap: 18px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.pre-side-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}

.pre-side-steps li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--mist);
  color: var(--forest);
  font-size: .78rem;
  font-weight: 850;
}

.pre-side-steps li div {
  display: grid;
  gap: 2px;
}

.pre-side-steps small {
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.4;
}

.pre-card { min-width: 0; }

.pre-state {
  min-height: 390px;
  padding: 70px 34px;
  text-align: center;
}

.pre-state p {
  max-width: 530px;
  margin: 12px auto 28px;
  color: var(--muted);
}

.pre-state-icon,
.pre-spinner {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 50%;
}

.pre-spinner {
  border: 4px solid var(--mist);
  border-top-color: var(--forest);
  animation: spin .9s linear infinite;
}

.pre-state-icon {
  background: var(--mist);
  color: var(--forest);
  font-size: 1.5rem;
  font-weight: 900;
}

.pre-state-error .pre-state-icon {
  background: #f7e4e1;
  color: var(--danger);
}

@keyframes spin { to { transform: rotate(360deg); } }

#pre-cadastro-form { padding: 38px; }

.pre-form-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.pre-form-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 34px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

legend {
  width: 100%;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 600;
}

.pre-help {
  margin: -10px 0 20px;
  color: var(--muted);
  font-size: .8rem;
}

.pre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pre-span-2 { grid-column: 1 / -1; }

.pre-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
}

.pre-field input,
.pre-field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(23, 63, 52, .22);
  border-radius: 9px;
  outline: 0;
  background: var(--white);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.pre-field input:focus,
.pre-field select:focus,
.pre-upload:focus-within {
  border-color: var(--forest-soft);
  box-shadow: 0 0 0 4px rgba(140, 156, 146, .23);
}

.pre-field input[readonly] {
  background: var(--mist);
  color: #4d5d57;
}

.pre-field input[aria-invalid="true"],
.pre-field select[aria-invalid="true"] {
  border-color: var(--danger);
}

.pre-field-feedback {
  min-height: 1.2em;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 600;
}

.pre-field-feedback[data-state="loading"] { color: var(--forest-soft); }
.pre-field-feedback[data-state="success"] { color: var(--success); }
.pre-field-feedback[data-state="warning"] { color: #8a5b18; }
.pre-field-feedback[data-state="error"] { color: var(--danger); }

.pre-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.pre-upload {
  position: relative;
  display: flex;
  min-height: 142px;
  padding: 21px;
  flex-direction: column;
  justify-content: center;
  border: 1px dashed rgba(23, 63, 52, .35);
  border-radius: 11px;
  background: var(--mist);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.pre-upload:hover {
  transform: translateY(-1px);
  border-color: var(--forest-soft);
  background: #eef1ef;
}

.pre-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.pre-upload-title { font-weight: 800; }

.pre-upload-copy,
.pre-upload-file {
  margin-top: 4px;
  color: var(--muted);
  font-size: .77rem;
}

.pre-upload-file {
  margin-top: 13px;
  color: var(--forest-soft);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.pre-upload[data-ready="true"] {
  border-style: solid;
  border-color: var(--success);
  background: #edf5f0;
}

.pre-photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.pre-camera-card {
  display: flex;
  min-height: 142px;
  padding: 16px;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(23, 63, 52, .18);
  border-radius: 11px;
  background: var(--white);
}

.pre-camera-card video {
  width: 100%;
  max-height: 320px;
  border-radius: 9px;
  background: #10251f;
  object-fit: cover;
  transform: scaleX(-1);
}

.pre-camera-card p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.pre-camera-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.pre-camera-actions .pre-button {
  min-height: 42px;
  padding: 0 16px;
  font-size: .78rem;
}

.pre-alert {
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid rgba(158, 53, 47, .25);
  border-radius: 9px;
  background: #fff3f1;
  color: var(--danger);
  font-size: .84rem;
  font-weight: 700;
}

.pre-alert-warning {
  border-color: rgba(138, 91, 24, .28);
  background: #fff8e9;
  color: #744a11;
}

.pre-consent-fieldset {
  padding-bottom: 26px;
}

.pre-consent {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(23, 63, 52, .2);
  border-radius: 11px;
  background: var(--mist);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.55;
}

.pre-consent input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--forest);
}

.pre-consent input[aria-invalid="true"] {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.pre-terms-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pre-consent-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.pre-progress {
  margin-top: 28px;
  padding: 16px;
  border-radius: 10px;
  background: var(--mist);
}

.pre-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .8rem;
}

.pre-progress-track {
  display: block;
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(23, 63, 52, .13);
}

#pre-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
  transition: width .2s ease;
}

.pre-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-top: 28px;
}

.pre-submit-row > div {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: .76rem;
}

.pre-submit-row strong { color: var(--ink); }

.pre-button {
  display: inline-flex;
  min-height: 50px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}

.pre-button:hover { transform: translateY(-1px); background: var(--forest-soft); }
.pre-button:disabled { cursor: wait; opacity: .62; transform: none; }

.pre-button-secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--forest);
}

body.pre-terms-open {
  overflow: hidden;
}

.pre-terms-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.pre-terms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 32, 27, .72);
  backdrop-filter: blur(4px);
}

.pre-terms-dialog {
  position: relative;
  display: grid;
  width: min(820px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 34px 100px rgba(8, 26, 21, .34);
}

.pre-terms-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.pre-terms-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 550;
  line-height: 1.15;
}

.pre-terms-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--forest);
  cursor: pointer;
  font-size: 1.5rem;
}

.pre-terms-body {
  overflow-y: auto;
  padding: 24px 28px;
  color: #43564f;
  font-size: .86rem;
}

.pre-terms-body p:first-child { margin-top: 0; }
.pre-terms-body li + li { margin-top: 7px; }
.pre-terms-body h3 { color: var(--ink); }

.pre-terms-footer {
  display: flex;
  justify-content: flex-end;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}

.pre-footer {
  padding: 34px 0;
  background: var(--forest);
  color: var(--white);
}

.pre-footer-inner > div {
  display: flex;
  flex-direction: column;
}

.pre-footer span {
  color: rgba(255, 255, 255, .62);
  font-size: .76rem;
}

.pre-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.pre-footer a {
  color: rgba(255, 255, 255, .82);
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}

.pre-footer a:hover { color: var(--white); text-decoration: underline; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .pre-intro-grid,
  .pre-layout { grid-template-columns: 1fr; }
  .pre-intro { padding: 48px 0 100px; }
  .pre-deadline { min-width: 0; }
  .pre-layout { margin-top: -55px; }
  .pre-summary { position: static; }
}

@media (max-width: 620px) {
  .pre-shell { width: min(100% - 28px, 1180px); }
  .pre-header-inner { min-height: 74px; }
  .pre-brand img { width: 48px; height: 48px; }
  .pre-security span:last-child { display: none; }
  .pre-intro h1 { font-size: clamp(2.05rem, 12vw, 3.2rem); }
  .pre-intro-grid { gap: 30px; }
  .pre-layout { width: 100%; gap: 16px; }
  .pre-summary,
  .pre-card { border-radius: 0; border-right: 0; border-left: 0; }
  .pre-summary { padding: 25px 20px; }
  #pre-cadastro-form { padding: 28px 20px; }
  .pre-grid,
  .pre-photo-grid { grid-template-columns: 1fr; }
  .pre-span-2 { grid-column: auto; }
  .pre-consent { padding: 15px; }
  .pre-terms-modal { padding: 0; }
  .pre-terms-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .pre-terms-head,
  .pre-terms-body,
  .pre-terms-footer { padding-right: 20px; padding-left: 20px; }
  .pre-terms-footer .pre-button { width: 100%; }
  .pre-submit-row,
  .pre-footer-inner { align-items: stretch; flex-direction: column; }
  .pre-submit-row .pre-button { width: 100%; }
  .pre-footer nav { gap: 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
