/* Página do pré-registo da app beta (beta.agendai.pt): herói curto com o tríptico estático e o bloco
   do teste (perfil + telemóvel + consentimento → portal do perfil). Telemóvel primeiro; sem
   dependências. Mesma identidade da landing original: tokens, botões e cartão do formulário. */
:root {
  --navy: #0a1330; --navy-2: #101c44; --night: #060c20;
  --ink: #0f172a; --muted: #4b5567; --muted-dark: #aab4ca; --line: #e4e7ee; --soft: #f5f7fb; --white: #fff;
  --blue: #2563eb; --amber: #f59e0b; --teal: #14b8a6;
  --gut: clamp(20px, 5vw, 64px); --wrap: 1200px;
  --hdr: 60px; --offset: 76px; /* altura do cabeçalho + folga, para o scroll das âncoras */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --accent: var(--blue); --accent-ink: #1d4ed8; --accent-hi: #a5c3ff; --accent-soft: #eef3ff; --accent-line: #c7d7fe; --accent-glow: rgba(37, 99, 235, .22);
}
@media (min-width: 760px) { :root { --hdr: 68px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: var(--offset); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--white); line-height: 1.6; font-size: 16px; overflow-x: clip; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent-ink); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; }
p { margin: 0; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--white); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- Botões (MAIÚSCULAS, sem ícones) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0; background: var(--accent); color: var(--white); font: inherit; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; text-align: center; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, filter .2s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 28px -12px var(--accent); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px #c3c9d6; }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); filter: none; }
.dark .btn-line { color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38); }
.dark .btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--white); }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); }

/* ---------- Cabeçalho ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; color: var(--white); padding-top: env(safe-area-inset-top); transition: background-color .35s, box-shadow .35s, backdrop-filter .35s; }
.site-header::before { content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(180deg, rgba(6, 12, 32, .55), rgba(6, 12, 32, 0)); pointer-events: none; transition: opacity .35s; }
.site-header.solid { background: rgba(10, 19, 48, .9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 rgba(255, 255, 255, .07); }
.site-header.solid::before { opacity: 0; }
.hdr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; min-height: var(--hdr); padding: 0 var(--gut); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--hdr); margin-right: auto; color: var(--white); font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; text-decoration: none; }
.brand img { width: 30px; }
.btn-head { min-height: 40px; padding: 0 16px; color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38); font-size: .74rem; }
.btn-head:hover { box-shadow: inset 0 0 0 1.5px var(--white); filter: none; }
.btn-beta { min-height: 40px; padding: 0 18px; background: var(--amber); color: #1a1205; font-size: .74rem; box-shadow: 0 6px 20px -8px rgba(245, 158, 11, .8); }
.btn-beta:hover { box-shadow: 0 10px 26px -8px rgba(245, 158, 11, .9); }

/* Pulso (dot do capítulo e do herói) */
.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--amber); opacity: 0; }
.pulse-live { background: #22c55e; }
.pulse-live::after { border-color: #22c55e; }
@media (prefers-reduced-motion: no-preference) { .pulse::after { animation: ring 2.2s ease-out infinite; } }
@keyframes ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Herói curto (tríptico estático, sem vídeos) ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: calc(var(--hdr) + 72px) 0 84px; color: var(--white); background: var(--navy); }
.hero-media { position: absolute; inset: 0; z-index: -2; background: var(--night); }
.hero-col { position: absolute; inset: 0; }
.hero-col img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.hero-col + .hero-col { display: none; } /* no telemóvel só o primeiro poster */
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(6, 12, 32, .5) 0%, rgba(6, 12, 32, .1) 34%, rgba(10, 19, 48, .78) 66%, var(--navy) 100%); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .88); }
.hero h1 { margin-top: 14px; font-size: clamp(2.4rem, 9vw, 4.6rem); font-weight: 800; line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
.grad { background: linear-gradient(92deg, #5eead4 0%, #7dd3fc 45%, #a5b4fc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin-top: 16px; max-width: 42rem; font-size: clamp(1.06rem, 2.4vw, 1.22rem); line-height: 1.55; color: #d5ddee; }
.hero-lead em { font-style: normal; font-weight: 700; color: var(--white); }
@media (min-width: 760px) { .hero { padding-top: calc(var(--hdr) + 96px); padding-bottom: 96px; } }
/* Tríptico estático a partir de 1000 px */
@media (min-width: 1000px) {
  .hero-media { display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-col { position: relative; inset: auto; }
  .hero-col + .hero-col { display: block; box-shadow: -1px 0 0 rgba(255, 255, 255, .12); }
}

/* ---------- Bloco do teste ---------- */
.dark { background: var(--navy); color: #dfe5f2; }
.dark h2, .dark h3, .dark h4 { color: var(--white); }
.chapter { display: inline-flex; align-items: center; gap: 12px; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.dark .chapter { color: var(--accent-hi); }
.lead { margin-top: 18px; max-width: 34rem; font-size: clamp(1.06rem, 2.4vw, 1.22rem); line-height: 1.55; color: var(--muted); }
.dark .lead { color: var(--muted-dark); }
.beta .lead a { color: var(--white); font-weight: 700; text-underline-offset: 3px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.beta .cta-row .btn { flex: 0 0 auto; }
.beta { position: relative; padding: 72px 0 88px; overflow: clip; --accent: #2563eb; --accent-ink: #1d4ed8; --accent-hi: #a5c3ff;
  background: radial-gradient(900px 520px at 0% 0%, rgba(37, 99, 235, .38), rgba(37, 99, 235, 0) 60%), radial-gradient(760px 560px at 100% 100%, rgba(20, 184, 166, .24), rgba(20, 184, 166, 0) 60%), var(--navy); }
.beta-layout { display: grid; gap: 40px; align-items: center; }
.beta .chapter { color: #fcd34d; }
.beta .lead { color: #c3cde2; }
.beta h2 { margin-top: 16px; font-size: clamp(2.2rem, 3.6vw + 1.2rem, 4rem); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.beta h2 em { font-style: normal; color: var(--accent-hi); }
.beta-steps { list-style: none; display: grid; gap: 12px; margin: 30px 0 0; padding: 0; counter-reset: bs; }
.beta-steps li { display: flex; align-items: center; gap: 14px; color: var(--white); font-weight: 700; font-size: 1.04rem; }
.bs-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #a5c3ff; }
.bs-ic svg { width: 21px; height: 21px; }
.web-links { margin-top: 26px; color: #c3cde2; font-size: .98rem; }
.web-links a { color: var(--white); font-weight: 700; text-underline-offset: 3px; }
.form-card { padding: 26px 20px; border-radius: 26px; background: var(--white); color: var(--ink); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .1); }
.form-card .form-title { color: var(--ink); }
.form-title { margin-bottom: 18px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
@media (min-width: 900px) {
  .beta { padding: 112px 0 120px; }
  .beta-layout { grid-template-columns: 1fr minmax(400px, 480px); gap: 80px; }
  .form-card { padding: 36px 34px; }
  html.beta-closed .beta-layout { grid-template-columns: 1fr; } /* sem o cartão do teste */
}

/* Formulário do teste: "Sou" → "O meu telemóvel" → consentimento → Google / Apple */
.stepform fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.lbl, .stepform legend { display: block; padding: 0; margin-bottom: 8px; font-size: .92rem; font-weight: 600; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.opts label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid #cfd5e0; background: var(--soft); font-weight: 700; cursor: pointer; user-select: none; transition: background-color .2s, border-color .2s, color .2s; }
.opts label:hover { border-color: #9aa3b5; }
.opts input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opts label:has(input:checked) { background: var(--blue); border-color: var(--blue); color: var(--white); }
.opts label:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.consent { display: flex; align-items: flex-start; gap: 12px; font-size: .9rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.consent input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--blue); }
.consent a { font-weight: 600; }
.sso-roles { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.sso-roles .opts { grid-template-columns: repeat(3, 1fr); }
.sso-roles .opts label { padding: 8px 6px; font-size: .92rem; }
.sso-phone .opts { grid-template-columns: repeat(2, 1fr); }
.sso .consent { margin-bottom: 18px; }
.sso-btns { display: grid; gap: 12px; }
.btn-google, .btn-apple { gap: 12px; }
.btn-google { background: var(--white); color: #1f2937; box-shadow: inset 0 0 0 1.5px #cfd5e0; }
.btn-google:hover { background: #f8fafc; filter: none; box-shadow: inset 0 0 0 1.5px #9aa3b5; }
.btn-google[disabled] { box-shadow: inset 0 0 0 1.5px #e2e6ee; }
/* Apple: botão preto com logótipo branco, como pedem as directrizes da Apple (o mesmo dos portais) */
.btn-apple { background: #000; color: #fff; }
.btn-apple:hover { background: #000; filter: none; opacity: .88; }
.btn .g-icon { width: 20px; height: 20px; flex: none; }

/* ---------- Rodapé ---------- */
.site-footer { padding: 40px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--night); color: #9aa6c0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.brand-foot { margin-right: 0; font-size: 1.05rem; }
.brand-foot img { width: 26px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.site-footer a { color: #e2e8f0; }

/* Estado do teste da app (programa android-app na admin): aberto por omissão; fechado = app pública */
html:not(.beta-closed) [data-store-only], html.beta-closed [data-beta-only] { display: none !important; }

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
