/*
 * Victor Matias · servicos.allyco.com.br
 * Mobile first. Paleta da marca pessoal (_opensquad/_memory/marca.md):
 * carvão, off-white, cobre e ardósia.
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fallback com a métrica aproximada da Plus Jakarta: o texto não pula quando a fonte chega. */
@font-face {
  font-family: "Jakarta Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 104%;
  ascent-override: 98%;
  descent-override: 21%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  --bg: #141416;
  --surface: #1c1c20;
  --surface-2: #232328;
  --line: rgba(243, 238, 230, 0.1);
  --line-strong: rgba(243, 238, 230, 0.2);

  --text: #f3eee6;
  --text-2: #b4b0aa;
  --text-3: #8c8a87;

  --copper: #c9875a;
  --copper-soft: rgba(201, 135, 90, 0.14);

  --paper: #f3eee6;
  --ink: #1a1a1d;
  --ink-2: #4c4b50;
  --copper-ink: #8a4f25;

  --error: #ff8a7a;

  --radius-lg: 22px;
  --radius-md: 14px;
  --gutter: 16px;
  --column: 560px;

  --font: "Plus Jakarta Sans", "Jakarta Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(120% 50% at 50% -12%, rgba(201, 135, 90, 0.1), transparent 62%) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: var(--copper);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.arrow {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 220ms var(--ease);
}

/* ---------- Home ---------- */

.page {
  width: min(100% - var(--gutter) * 2, var(--column));
  margin-inline: auto;
  padding-block: 28px 8px;
}

.profile-id {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-role {
  color: var(--text-3);
  font-size: 0.875rem;
}

/* O ponto da Plus Jakarta tem folga grande à esquerda; com o tracking negativo parece um espaço. */
.headline .dot {
  margin-left: -0.06em;
}

.headline {
  margin-top: 22px;
  font-size: clamp(1.95rem, 8.4vw, 3rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.subheadline {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.proof {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 0.875rem;
}

.proof span {
  text-wrap: balance;
}

.proof::before {
  width: 18px;
  height: 2px;
  flex: none;
  border-radius: 2px;
  background: var(--copper);
  content: "";
}

.proof strong {
  color: var(--text);
  font-weight: 700;
}

.offers {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

/* O card inteiro é clicável: o link do CTA se estende por cima dele. */
.offer {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background-color 220ms var(--ease);
}

.offer-tag {
  color: var(--copper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.offer-title {
  margin-top: 8px;
  font-size: 1.3125rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.offer-text {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 0.96875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.offer-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.offer-cta::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
}

/* Com :has(), o anel de foco contorna o card inteiro; sem ele, fica no próprio link. */
@supports selector(:has(*)) {
  .offer-cta:focus-visible {
    outline: none;
  }

  .offer:has(.offer-cta:focus-visible) {
    outline: 2px solid var(--copper);
    outline-offset: 3px;
  }
}

.offer--primary {
  padding: 24px 18px 18px;
  border-color: transparent;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.7);
}

.offer--primary .offer-tag {
  color: var(--copper-ink);
}

.offer--primary .offer-title {
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.offer--primary .offer-text {
  color: var(--ink-2);
  font-size: 1rem;
}

.offer--primary .offer-cta {
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 20px;
  padding: 8px 12px;
  font-size: 0.96875rem;
  text-align: center;
  line-height: 1.3;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--paper);
}

@media (hover: hover) {
  .offer:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 135, 90, 0.45);
    background: var(--surface-2);
  }

  .offer--primary:hover {
    border-color: transparent;
    background: #f7f3ec;
  }

  .offer:hover .arrow {
    transform: translateX(4px);
  }
}

.offer:active {
  transform: scale(0.992);
}

.lab {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.lab h2 {
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lab p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 0.96875rem;
  text-wrap: pretty;
}

.lab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 6px;
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.lab-link .arrow {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .lab-link:hover .arrow {
    transform: translate(2px, -2px);
  }
}

.footer {
  width: min(100% - var(--gutter) * 2, var(--column));
  margin: 36px auto 0;
  padding-block: 24px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.875rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
}

.footer-label {
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-brands {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-brands a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
}

.footer-brands a:hover {
  color: var(--text);
}

.footer-copy {
  margin-top: 6px;
}

/* Entrada discreta. Só roda para quem não pediu movimento reduzido. */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 460ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 60ms);
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Fluxos: /estrutura/ e /diagnostico/ ---------- */

.topbar {
  width: min(100% - var(--gutter) * 2, var(--column));
  margin-inline: auto;
  padding-top: 12px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-right: 8px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.back .arrow {
  width: 16px;
  height: 16px;
}

.back .avatar {
  width: 28px;
  height: 28px;
}

.flow {
  width: min(100% - var(--gutter) * 2, var(--column));
  margin-inline: auto;
  padding-block: 16px calc(40px + env(safe-area-inset-bottom));
}

.flow-title {
  margin-top: 8px;
  font-size: clamp(1.75rem, 7.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.flow-intro {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 1rem;
  text-wrap: pretty;
}

/* Depois da primeira etapa o título encolhe e a introdução sai: menos rolagem. */
.flow:not([data-view="step-1"]) .flow-intro {
  display: none;
}

.flow:not([data-view="step-1"]) .flow-title {
  font-size: 1.375rem;
}

.flow[data-view="agenda"] .flow-head {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 22px;
}

.progress span {
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  transition: background-color 300ms var(--ease);
}

.progress span.is-done {
  background: var(--copper);
}

.step {
  margin-top: 16px;
}

.step[hidden],
[hidden] {
  display: none !important;
}

.step-count {
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 600;
}

.step-title {
  margin-top: 2px;
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.step-title:focus,
.agenda-title:focus {
  outline: none;
}

.field,
.group {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.group legend {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.96875rem;
  font-weight: 650;
  line-height: 1.35;
}

.optional {
  margin-left: 6px;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 500;
}

.hint {
  margin: -4px 0 10px;
  color: var(--text-3);
  font-size: 0.875rem;
}

.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.0625rem; /* 17px: o iOS não dá zoom ao focar */
  line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  appearance: none;
}

textarea.input {
  min-height: 84px;
  resize: vertical;
}

.input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.input:focus {
  border-color: var(--copper);
  outline: none;
  box-shadow: 0 0 0 3px var(--copper-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Opções como botões de toque. O input nativo continua lá: teclado e leitor de tela funcionam. */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choices--stack {
  grid-template-columns: 1fr;
}

.choice {
  position: relative;
  display: flex;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.96875rem;
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.choice span::before {
  width: 18px;
  height: 18px;
  flex: none;
  border: 1.5px solid var(--text-3);
  border-radius: 50%;
  content: "";
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.choice input[type="checkbox"] + span::before {
  border-radius: 5px;
}

.choice input:checked + span {
  border-color: var(--copper);
  background: var(--copper-soft);
}

.choice input:checked + span::before {
  border-color: var(--copper);
  background: var(--copper);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.choice input[type="checkbox"]:checked + span::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231a1a1d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat,
    var(--copper);
  box-shadow: none;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

@media (hover: hover) {
  .choice span:hover {
    border-color: rgba(243, 238, 230, 0.36);
  }
}

.group[data-invalid] .choice span {
  border-color: rgba(255, 138, 122, 0.55);
}

@media (max-width: 359px) {
  .choices {
    grid-template-columns: 1fr;
  }
}

.consent {
  margin-top: 22px;
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.form-error {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 138, 122, 0.4);
  border-radius: 12px;
  background: rgba(255, 138, 122, 0.08);
  color: var(--text);
  font-size: 0.9375rem;
}

.actions {
  display: grid;
  gap: 4px;
  margin-top: 24px;
}

.consent + .form-error + .actions,
.consent + .actions {
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .btn:hover {
    background: #fffaf2;
  }

  .btn:hover .arrow {
    transform: translateX(4px);
  }
}

.btn:active {
  transform: scale(0.99);
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.75;
}

.btn[aria-busy="true"] .arrow {
  display: none;
}

.btn-back {
  min-height: 48px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 0.96875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-back:hover {
  color: var(--text);
}

.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Honeypot: invisível para gente, visível para robô. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Agenda (Cal.com) ---------- */

.agenda {
  margin-top: 8px;
}

.agenda-title {
  font-size: clamp(1.5rem, 6.4vw, 2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.agenda-text {
  margin-top: 8px;
  color: var(--text-2);
}

.cal-shell {
  position: relative;
  min-height: 520px;
  margin: 20px calc(var(--gutter) * -1) 0;
}

.cal-inline {
  width: 100%;
  overflow: hidden;
}

.cal-inline iframe {
  width: 100% !important;
  max-width: 100%;
  border: 0;
}

/* Fundo sólido: cobre o loader do próprio Cal.com enquanto a agenda não chega. */
.cal-loading {
  position: absolute;
  z-index: 1;
  inset: 0 var(--gutter) auto;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 240px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  font-size: 0.9375rem;
}

.cal-fallback,
.booked {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.cal-fallback p,
.booked p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.cal-fallback .btn {
  margin-top: 14px;
}

.booked {
  border-color: rgba(201, 135, 90, 0.5);
}

.booked strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.0625rem;
}

.edit-link {
  display: block;
  min-height: 48px;
  margin: 12px auto 0;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Telas maiores ---------- */

@media (min-width: 640px) {
  :root {
    --gutter: 32px;
  }

  .page {
    padding-top: 64px;
  }

  .avatar {
    width: 60px;
    height: 60px;
  }

  .headline {
    margin-top: 28px;
  }

  .subheadline {
    font-size: 1.1875rem;
  }

  .offer {
    padding: 26px 26px 22px;
  }

  .offer--primary {
    padding: 30px 28px 26px;
  }

  .offer--primary .offer-title {
    font-size: 1.875rem;
  }

  .offer--primary .offer-cta {
    width: auto;
  }

  .topbar {
    padding-top: 28px;
  }

  .flow {
    padding-top: 28px;
  }

  .cal-shell {
    margin-inline: 0;
  }

  .cal-loading {
    inset-inline: 0;
  }

  .actions {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .actions .btn {
    grid-column: 1;
    width: auto;
    min-width: 240px;
  }

  .actions .btn-back {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}
