/* Vistoria — landing. Espelho do design system do app (PO UI).
   Regenere os tokens a partir de packages/shared/design-tokens.json; não invente hex.
   PARES DE CONTRASTE APROVADOS (WCAG AA, medidos em qa.sh > contraste):
     texto sobre claro  -> --text (16.6:1), --text-body (12.6:1), --text-muted (5.0:1)  [--text-support só >=18px]
     branco sobre --brand (#753399) -> 7.8:1  (CTA real do app; passa AAA — Entrar/Assinar/Salvar)
     branco sobre --brand-dark (#3a0f52) -> 15:1 (navbar/seções/footer escuros)
   PROIBIDO: texto pequeno em --text-support sobre branco (4.0:1). */
@layer tokens, base, components, sections, utilities;

@layer tokens {
  :root {
    --brand:            #753399; /* design-tokens.json colors.brand-01 (CTA e marca) */
    --brand-hover:      #5b1c7d; /* colors.brand-01-hover */
    --brand-pressed:    #400e58; /* colors.brand-01-pressed */
    --brand-dark:       #3a0f52; /* derivado de brand-01-pressed p/ superfícies escuras (mesmo matiz) */
    --brand-02:         #b92f72; /* colors.brand-02 (links/badges) */
    --brand-03:         #ffd464; /* colors.brand-03 (acento) */
    --brand-tint:       #f2eaf6; /* colors.brand-01-bg-selected (tint claro) */
    --brand-tint-2:     #d9c2e5; /* colors.brand-01-bg-hover */
    --surface:          #ffffff; /* colors.surface-card */
    --surface-neutral:  #f4f6f6; /* derivado de border-secundaria #eceeee p/ faixa neutra */
    --surface-input:    #fbfbfb; /* colors.surface-input */
    --text:             #1d2426; /* colors.text-principal */
    --text-body:        #2c3739; /* colors.text-corpo */
    --text-muted:       #59656a; /* derivado de text-suporte escurecido p/ AA em corpo pequeno */
    --text-support:     #6e7c7f; /* colors.text-suporte (só >=18px/decorativo) */
    --border:           #dadedf; /* colors.border */
    --border-2:         #eceeee; /* colors.border-secundaria */
    --ok-bg:            #def7ed; /* colors.tag-ok-bg */
    --ok-text:          #0f5236; /* colors.tag-ok-texto */
    --warn-bg:          #fcf6e3; /* colors.tag-faltando-bg */
    --warn-text:        #473400; /* colors.tag-faltando-texto */
    --danger-bg:        #f6e6e5; /* colors.tag-danificado-bg */
    --danger-text:      #72211d; /* colors.tag-danificado-texto */
    --success:          #107048; /* colors.feedback-sucesso */
    --r-sm:             4px;     /* radii.sm (raio dos componentes do app) */
    --r-md:             8px;     /* radii.md */
    --r-full:           9999px;  /* radii.full */
    --shadow-card:      0 4px 8px rgba(0,0,0,.10);  /* shadows.card */
    --shadow-modal:     0 6px 12px rgba(0,0,0,.10); /* shadows.modal */
    --nav-h:            64px;    /* altura da navbar fixa */
    --maxw:             1120px;  /* largura de leitura */
  }
}

@layer base {
  @font-face {
    font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../assets/fonts/roboto-400.woff2') format('woff2');
  }
  @font-face {
    font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../assets/fonts/roboto-700.woff2') format('woff2');
  }
  * { box-sizing: border-box; }
  html { scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; background: var(--surface); color: var(--text-body);
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { color: var(--text); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; text-wrap: balance; }
  h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.01em; }
  h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); letter-spacing: -.01em; }
  h3 { font-size: 1.25rem; }
  p  { margin: 0 0 1rem; text-wrap: pretty; }
  a  { color: var(--brand-02); }
  img, svg { max-width: 100%; }
  :focus-visible { outline: 3px solid var(--brand-02); outline-offset: 2px; border-radius: var(--r-sm); }
  ::selection { background: var(--brand-tint-2); }
}

@layer components {
  .wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
  .eyebrow {
    display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--brand); background: var(--brand-tint);
    padding: 6px 12px; border-radius: var(--r-full); margin-bottom: 16px;
  }
  .sub { font-size: 1.15rem; color: var(--text-body); max-width: 56ch; }

  /* Logo lockup (SVG mark + wordmark em texto Roboto para nitidez em qualquer DPR) */
  .logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
  .logo__mark { width: 34px; height: 34px; flex: none; display: block; }
  .logo__word { font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; color: var(--brand); }
  .logo--light .logo__word { color: #fff; }

  /* Botões — pill do app, cor real do CTA (branco sobre --brand = 7.8:1) */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 700 1rem/1 'Roboto', sans-serif; padding: 15px 26px; border-radius: var(--r-full);
    border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
    min-height: 48px;
  }
  .btn--primary { background: var(--brand); color: #fff; }
  .btn--primary:hover { background: var(--brand-hover); }
  .btn--ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
  .btn--ghost:hover { background: var(--brand-tint); }
  .btn--on-dark { background: #fff; color: var(--brand); }
  .btn--on-dark:hover { background: var(--brand-tint); }
  .btn--lg { padding: 17px 34px; font-size: 1.06rem; }
  .btn--block { width: 100%; }

  .check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
  .check-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
  .check-list svg { width: 22px; height: 22px; color: var(--success); margin-top: 1px; }

  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); }

  /* ---------- Réplicas dos componentes do app (mockups decorativos, dados sintéticos) ---------- */
  .mock { font-family: 'Roboto', sans-serif; color: var(--text); }
  .mock, .mock * { pointer-events: none; }

  /* Réplica: card de imóvel da home */
  .m-propcard {
    width: min(320px, 86vw); background: var(--surface); border-radius: var(--r-md);
    box-shadow: var(--shadow-card); overflow: hidden; border: 1px solid var(--border-2);
  }
  .m-propcard__img { height: 138px; background: linear-gradient(160deg,#8fb8d6 0%,#bcd6e6 45%,#e7dcc4 46%,#d8c9a8 100%); position: relative; }
  .m-propcard__img::after { content:""; position:absolute; inset:auto 0 0 0; height:46%; background:linear-gradient(#00000000,#00000018); }
  .m-propcard__body { padding: 14px 16px 16px; }
  .m-propcard__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .m-propcard__title { font-weight: 700; font-size: 1.05rem; }
  .m-tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); }
  .m-tag--ok { background: var(--ok-bg); color: var(--ok-text); }
  .m-propcard__addr { display:flex; align-items:center; gap:6px; color: var(--text-muted); font-size:.85rem; margin:6px 0 12px; }
  .m-propcard__foot { display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--border-2); padding-top:11px; font-size:.82rem; color:var(--text-muted); }
  .m-propcard__cta { color: var(--brand); font-weight: 700; display:inline-flex; align-items:center; gap:4px; }

  /* Réplica: tela de vistoria por cômodo (web) */
  .m-room { width: min(320px, 86vw); background: var(--surface-neutral); border-radius: var(--r-md); box-shadow: var(--shadow-card); overflow: hidden; border: 1px solid var(--border-2); }
  .m-room__bar { background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--border-2); display:flex; align-items:center; gap:10px; }
  .m-room__bar svg { color: var(--brand); width: 20px; height: 20px; }
  .m-room__title { font-weight: 700; font-size: .98rem; }
  .m-room__meta { font-size: .76rem; color: var(--text-muted); }
  .m-room__body { padding: 14px; display: grid; gap: 12px; }
  .m-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; }
  .m-item__name { font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
  .m-seg { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
  .m-seg span { font-size: .74rem; font-weight: 700; text-align: center; padding: 8px 4px; border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--text-muted); }
  .m-seg .on-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-text); }
  .m-progress { height: 8px; background: var(--border-2); border-radius: var(--r-full); overflow: hidden; }
  .m-progress i { display:block; height:100%; width: 34%; background: var(--brand); border-radius: var(--r-full); }
  .m-room__save { background: var(--brand); color:#fff; text-align:center; font-weight:700; font-size:.85rem; padding:11px; border-radius: var(--r-full); }
}

@layer sections {
  /* Skip link */
  .skip { position: absolute; left: 12px; top: -60px; background: #fff; color: var(--brand); padding: 10px 16px;
          border-radius: var(--r-sm); font-weight: 700; z-index: 200; transition: top .15s; }
  .skip:focus { top: 12px; }

  /* Navbar */
  .nav { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); background: var(--brand-dark); z-index: 100;
         display: flex; align-items: center; transition: box-shadow .2s; }
  .nav--scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.25); }
  .nav > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .nav__links { display: flex; align-items: center; gap: 28px; }
  .nav__links a:not(.btn) { color: #fff; text-decoration: none; font-weight: 500; font-size: .98rem; opacity: .92; }
  .nav__links a:not(.btn):hover { opacity: 1; text-decoration: underline; }
  .nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer;
                 min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .nav__toggle svg { width: 26px; height: 26px; color: #fff; }

  main { padding-top: var(--nav-h); }
  section { padding: clamp(52px, 8vw, 92px) 0; }
  .section--neutral { background: var(--surface-neutral); }
  .section--dark { background: var(--brand-dark); color: #fff; }
  .section--dark h2, .section--dark h3 { color: #fff; }
  .section--dark .sub { color: rgba(255,255,255,.85); }
  .section__head { max-width: 62ch; margin-bottom: 40px; }
  .section__head--center { margin-inline: auto; text-align: center; }

  /* Hero */
  .hero { background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface) 62%); padding-top: clamp(40px,6vw,64px); }
  .hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
  .hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 14px; }
  .hero__micro { font-size: .9rem; color: var(--text-muted); display:flex; align-items:center; gap:8px; }
  .hero__micro svg { width:18px; height:18px; color: var(--success); }
  .hero__art { display: flex; justify-content: center; }
  .trust-row { display:flex; flex-wrap:wrap; gap:10px 20px; margin-top:28px; }
  .trust-pill { display:inline-flex; align-items:center; gap:8px; font-size:.86rem; font-weight:500; color: var(--text-body); }
  .trust-pill svg { width:18px; height:18px; color: var(--brand); flex:none; }

  /* Steps */
  .steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; counter-reset: step; }
  .step { background: var(--surface); border:1px solid var(--border-2); border-radius: var(--r-md); padding: 26px 22px; }
  .step__n { width:38px; height:38px; border-radius: var(--r-full); background: var(--brand); color:#fff;
             display:grid; place-items:center; font-weight:700; margin-bottom:14px; }

  /* Features alternadas */
  .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .feat + .feat { margin-top: clamp(48px, 7vw, 84px); }
  .feat--rev .feat__art { order: -1; }
  .feat__art { display:flex; justify-content:center; }
  .pill { display:inline-block; background: var(--brand-tint); color: var(--brand); font-weight:700;
          padding:5px 12px; border-radius: var(--r-full); font-size:.82rem; margin-bottom:12px; }
  .section--dark .pill { background: rgba(255,255,255,.14); color:#fff; }

  /* Planos */
  .plans { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:22px; max-width: 720px; margin: 0 auto; }
  .plan { background: var(--surface); border:2px solid var(--border); border-radius: var(--r-md); padding: 28px 26px; position:relative; }
  .plan--hi { border-color: var(--brand); box-shadow: var(--shadow-card); }
  .plan__tag { position:absolute; top:-13px; left:26px; background: var(--brand); color:#fff; font-size:.72rem;
               font-weight:700; letter-spacing:.04em; padding:5px 12px; border-radius: var(--r-full); }
  .plan__name { color: var(--brand); font-weight:700; margin-bottom:6px; }
  .plan--month .plan__name { color: var(--text); }
  .plan__price { font-size:2.6rem; font-weight:700; line-height:1; }
  .plan__price small { font-size:1rem; font-weight:400; color: var(--text-muted); }
  .plan__note { color: var(--text-muted); font-size:.92rem; margin:6px 0 18px; }
  .plans__foot { text-align:center; color: var(--text-muted); font-size:.92rem; margin-top:22px; }

  /* FAQ */
  .faq { max-width: 760px; margin-inline: auto; }
  .faq details { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-md); margin-bottom: 12px; }
  .faq summary { cursor: pointer; padding: 18px 20px; font-weight: 700; color: var(--text); list-style: none;
                 display:flex; justify-content: space-between; align-items:center; gap:16px; }
  .faq summary::-webkit-details-marker { display:none; }
  .faq summary::after { content:"+"; font-size:1.4rem; color: var(--brand); flex:none; }
  .faq details[open] summary::after { content:"–"; }
  .faq__a { padding: 0 20px 18px; color: var(--text-body); }

  /* CTA final */
  .cta-final { text-align:center; }
  .cta-final .btn { margin-top: 8px; }

  /* Footer */
  .footer { background: var(--brand-dark); color: rgba(255,255,255,.82); padding: 56px 0 40px; }
  .footer__grid { display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
  .footer h3 { color:#fff; font-size:.95rem; margin-bottom: 14px; }
  .footer ul { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
  .footer a { color: rgba(255,255,255,.82); text-decoration:none; }
  .footer a:hover { color:#fff; text-decoration: underline; }
  .footer__mark { margin-bottom: 14px; }
  .footer__legal { border-top:1px solid rgba(255,255,255,.16); margin-top:36px; padding-top:20px; font-size:.84rem; display:flex; flex-wrap:wrap; gap:8px 20px; justify-content:space-between; }
}

@layer utilities {
  .reveal { }
  .js .reveal { opacity: 0; transform: translateY(14px); }
  .js .reveal.is-in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
  .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .nowrap { white-space: nowrap; }

  @media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    * { scroll-behavior: auto !important; }
  }

  /* ---------- Responsivo ---------- */
  @media (max-width: 900px) {
    .hero__grid { grid-template-columns: 1fr; gap: 32px; }
    .feat, .feat--rev .feat__art { grid-template-columns: 1fr; }
    .feat__art { order: 0 !important; }
    .steps { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 720px) {
    .nav__toggle { display: inline-flex; }
    .nav__links {
      position: fixed; inset: var(--nav-h) 0 auto 0; background: var(--brand-dark);
      flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 20px 24px;
      transform: translateY(-140%); transition: transform .25s ease; box-shadow: 0 12px 24px rgba(0,0,0,.3);
    }
    .nav__links[data-open="true"] { transform: translateY(0); }
    .nav__links a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
    .nav__links .btn { margin-top: 10px; }
  }
  @media (max-width: 560px) {
    .plans, .footer__grid { grid-template-columns: 1fr; }
    .footer__grid { gap: 28px; }
    .m-plans { }
  }
  @media (min-width: 721px) {
    .nav__links { transform: none !important; }
  }
}
