/* ==== Pactum Lead Capture — base styles ==== */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-mute: #8a8278;
  --paper: #f7f2e8;
  --paper-warm: #efe7d6;
  --paper-line: #e3d8c2;
  --navy: #0f2a44;
  --navy-deep: #08182a;
  --navy-soft: #213e5b;
  --gold: #b08a3e;
  --gold-soft: #c9a55a;
  --danger: #8a2a1f;
  --ok: #2f6b3a;

  --font-serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper texture via layered gradient lines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 31px,
      rgba(176, 138, 62, 0.04) 31px,
      rgba(176, 138, 62, 0.04) 32px
    );
  z-index: 0;
}

/* ===== Layout shell ===== */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Header ===== */
.app-header {
  border-bottom: 1px solid var(--paper-line);
  padding: 22px 0 18px;
  background: var(--paper);
}
.app-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark-img {
  width: 42px;
  height: 42px;
  display: block;
}
.brand-logo-full {
  height: 64px;
  width: auto;
  display: block;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.5px;
  background: var(--paper);
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--navy);
  text-transform: uppercase;
}
.brand-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2px;
}

.session-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  text-align: right;
  line-height: 1.6;
}
.session-meta .count {
  color: var(--navy);
  font-weight: 600;
}

/* ===== Form ===== */
.form-wrap {
  padding: 36px 0 60px;
}
.form-title {
  font-family: var(--font-serif);
  font-size: 38px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.form-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 56ch;
}

.section {
  margin-top: 28px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--paper-line);
}

.row {
  display: grid;
  gap: 16px;
}
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.row + .row { margin-top: 16px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.field .key-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.field .req {
  color: var(--gold);
  margin-left: 4px;
}

.input,
.textarea,
.select {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  padding: 11px 12px;
  width: 100%;
  outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.input:hover, .textarea:hover, .select:hover {
  border-color: var(--ink-mute);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 42, 68, 0.12);
  background: #fff;
}
.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.input.error, .textarea.error, .select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(138, 42, 31, 0.1);
}
.field-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
  min-height: 14px;
}

/* Custom select arrow */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%230F2A44' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Autocomplete dropdown */
.combo { position: relative; }
.combo-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--navy);
  border-radius: 2px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 8px 22px rgba(15, 42, 68, 0.12);
}
.combo-item {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--paper-line);
}
.combo-item:last-child { border-bottom: 0; }
.combo-item.active,
.combo-item:hover {
  background: var(--paper-warm);
  color: var(--navy);
}
.combo-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
}

/* Chip group (multiselect) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  background: #fffdf7;
  cursor: pointer;
  user-select: none;
  transition: all .12s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.chip:hover { border-color: var(--navy-soft); }
.chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 42, 68, 0.18);
}
.chip.selected {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.chip .chip-key {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 1px 4px;
  line-height: 1;
}
.chip.selected .chip-key {
  border-color: rgba(255, 255, 255, 0.4);
  opacity: 0.8;
}

/* Radio cards (for "Abrir uma escola? / Treinamento de professor?") */
.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.radio-card {
  border: 1px solid var(--paper-line);
  background: #fffdf7;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all .12s;
  position: relative;
}
.radio-card:hover { border-color: var(--navy-soft); }
.radio-card.selected {
  border-color: var(--navy);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--navy);
}
.radio-card.selected::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}
.radio-card .rc-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
}
.radio-card .rc-sub {
  font-size: 12px;
  color: var(--ink-soft);
}
.radio-card .rc-key {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
}

/* ===== Footer / actions ===== */
.actions {
  border-top: 1px solid var(--paper-line);
  padding: 16px 0;
  background: var(--paper);
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.actions .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.shortcut-strip {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.shortcut-strip kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: #fff;
  border: 1px solid var(--paper-line);
  border-bottom-width: 2px;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 3px;
  color: var(--ink);
}

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .12s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-deep);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--paper-line);
}
.btn-ghost:hover {
  border-color: var(--ink-mute);
  color: var(--ink);
}
.btn kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: inherit;
}
.btn-ghost kbd {
  background: #fff;
  border-color: var(--paper-line);
  color: var(--ink-mute);
}

/* ===== Success state ===== */
.success {
  text-align: center;
  padding: 80px 24px;
  animation: fadeUp .35s ease;
}
.success-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border: 1.5px solid var(--navy);
  display: grid;
  place-items: center;
  color: var(--navy);
}
.success-mark svg { width: 26px; height: 26px; }
.success h2 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 8px;
}
.success p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 28px;
}
.success-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 28px;
}
.success-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.success-cta .hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}
.countdown {
  font-family: var(--font-mono);
  color: var(--navy);
  font-weight: 600;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(15, 42, 68, 0.25);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 50;
  animation: fadeIn .2s ease;
  max-width: 360px;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Submission status pill ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

/* responsive */
@media (max-width: 640px) {
  .row.cols-2, .row.cols-3 { grid-template-columns: 1fr; }
  .form-title { font-size: 30px; }
  .shell { padding: 0 20px; }
  .session-meta { display: none; }
  .actions .shell { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .shortcut-strip { font-size: 10px; }
}
