/* Accenture IA v3: fontes, tokens, casca (fundos, logo, contador, voltar), componentes e animações.
   Mobile primeiro (largura de projeto 390, 1 unidade = var(--m)). O modo PC (1920x1080, var(--u)) fica em pc.css. */

@font-face { font-family: 'Graphik'; src: url('../../fonts/Graphik-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Graphik'; src: url('../../fonts/Graphik-Medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Graphik'; src: url('../../fonts/Graphik-Bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --brand: #8200ff;
  --brand-2: #8a40ff;
  --white: #fff;
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.86);
  --input-fill: rgba(64, 8, 150, 0.55);
  --input-stroke: linear-gradient(90deg, #ff2bd6 0%, #a100ff 35%, #3fd0ff 70%, #f9e912 100%);
  --err: #ffb3d9;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: Graphik, 'Helvetica Neue', Arial, sans-serif;
  --u: min(calc(100vw / 1920), calc(100vh / 1080));
  --m: min(calc(100vw / 390), 1.5px);
  --glow: 0 0 calc(22 * var(--m)) rgba(130, 0, 255, 0.7);
  /* Graphik do pacote é mais largo que o texto das artes: o designer aplicou tracking negativo (medido por largura de linha). */
  --tr-title: -0.03em;
  --tr-lead: -0.015em;
  --tr-body: -0.03em;
  --tr-tip: -0.03em;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@supports (height: 100dvh) {
  :root { --u: min(calc(100vw / 1920), calc(100dvh / 1080)); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #12002e; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: #12002e; color: var(--text);
  font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.3;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
html.modal-open, html.modal-open body { overflow: hidden; }
h1, h2, h3, p, ul, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, video, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.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;
}
:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
[tabindex='-1']:focus, [tabindex='-1']:focus-visible { outline: none; }
.noscript { position: relative; z-index: 3; padding: 24px; margin: 0; }

/* ---------- fundos (crossfade de 260 ms entre duas camadas, disparado por shell.js pouco antes da troca de telas) ---------- */
.bgs { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 0; overflow: hidden; background: #12002e; }
.bg {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-size: cover; background-position: center;
  background-repeat: no-repeat; opacity: 0; transition: opacity 0.26s ease-in-out;
}
.bg.is-on { opacity: 1; }
.bg[data-bg='login'] { background-image: url('../../img/v3/bg-login-m.webp'); }
.bg[data-bg='main'], .bg[data-bg='values'] { background-image: url('../../img/v3/bg-main-m.webp'); }
.bg[data-bg='final'] { background-image: url('../../img/v3/bg-final-m.webp'); background-position: center bottom; }

/* ---------- casca ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; width: 100%; }
.stage { position: relative; width: calc(390 * var(--m)); max-width: 100%; min-height: inherit; margin: 0 auto; }
.logo {
  position: absolute; z-index: 3; left: 50%; top: calc(74 * var(--m)); width: calc(36 * var(--m)); height: auto;
  margin-left: calc(-18 * var(--m)); pointer-events: none;
}
.back {
  position: absolute; z-index: 4; left: calc(10 * var(--m)); top: calc(72 * var(--m)); min-width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px;
  background: var(--btn2-fill); box-shadow: inset 0 0 0 1.5px var(--btn2-stroke); color: #fff; font-weight: 500; font-size: 16px;
  transition: background 0.2s, transform 0.18s var(--ease-out);
}
.back:active { background: var(--btn2-fill-down); transform: scale(0.96); }
@media (hover: hover) { .back:hover { background: var(--btn2-fill-hover); } }
.back .icon { stroke-width: 2; }
.back-label { display: none; }
.counter {
  position: absolute; z-index: 3; right: calc(20 * var(--m)); bottom: calc(20 * var(--m) + var(--safe-b)); margin: 0;
  font-size: max(13px, calc(13 * var(--m))); font-weight: 400; line-height: 1; color: #fff; pointer-events: none;
}
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.chev-mask {
  display: block; background: var(--brand);
  -webkit-mask: url('../../img/v3/chevron.png') center / contain no-repeat; mask: url('../../img/v3/chevron.png') center / contain no-repeat;
}
.boot-chev { width: 48px; height: 51px; animation: pulse 1.2s ease-in-out infinite; }

/* ---------- botões (sistema único) ---------- */
/* Todo botão tem fundo preenchido. Primário: roxo do KV com brilho. Secundário (--soft): roxo escuro translúcido com borda.
   Mesma altura, raio, peso e espaçamento em todas as telas; o tamanho só muda a largura mínima. */
:root {
  --btn-h: max(48px, calc(50 * var(--m)));
  --btn-px: calc(24 * var(--m));
  --btn-fill: linear-gradient(180deg, #9a3cff 0%, #7a00f2 100%);
  --btn-fill-hover: linear-gradient(180deg, #a85bff 0%, #8a12ff 100%);
  --btn-fill-down: linear-gradient(180deg, #7a00f2 0%, #6600d0 100%);
  --btn2-fill: rgba(34, 6, 96, 0.84);
  --btn2-fill-hover: rgba(62, 14, 150, 0.9);
  --btn2-fill-down: rgba(24, 3, 72, 0.92);
  --btn2-stroke: rgba(255, 255, 255, 0.58);
}
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: calc(10 * var(--m));
  min-width: calc(200 * var(--m)); min-height: var(--btn-h); padding: 0 var(--btn-px); border: 0; border-radius: 999px;
  background: var(--btn-fill); color: #fff; font-family: var(--font); font-weight: 500; text-transform: uppercase; text-align: center;
  font-size: max(14px, calc(14 * var(--m))); line-height: 1.15; letter-spacing: 0.01em; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--glow);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 0.18s var(--ease-out), background 0.2s, opacity 0.2s;
}
@media (hover: hover) { .pill:hover { background: var(--btn-fill-hover); transform: translateY(-1px); } }
.pill:active { background: var(--btn-fill-down); transform: scale(0.97); }
.pill:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* Secundário (Compartilhar, Concluir, Tirar outra foto, Baixar de novo, Reiniciar): também preenchido, só menos vistoso. */
.pill--soft { background: var(--btn2-fill); box-shadow: inset 0 0 0 1.5px var(--btn2-stroke), 0 0 18px rgba(130, 0, 255, 0.22); }
@media (hover: hover) { .pill--soft:hover { background: var(--btn2-fill-hover); } }
.pill--soft:active { background: var(--btn2-fill-down); }
.pill--login { min-width: calc(220 * var(--m)); }
.pill--wide { min-width: calc(300 * var(--m)); padding: 0 calc(18 * var(--m)); }
.pill--download { min-width: calc(220 * var(--m)); }
.pill--small { min-width: calc(160 * var(--m)); padding: 0 calc(20 * var(--m)); }
.pill-icon { width: auto; height: calc(17 * var(--m)); min-height: 16px; flex: none; }
.pill[aria-disabled='true'] { background: #4a2a8a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.7); cursor: default; }
.pill.is-busy { pointer-events: none; }
.pill.is-busy .pill-label, .pill.is-busy .pill-icon { opacity: 0; }
.pill.is-busy::after {
  content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff;
  border-right-color: transparent; animation: spin 0.8s linear infinite;
}
/* Grupo de botões empilhados: mesma largura, mesmo espaçamento, em qualquer tela. */
.pill-stack, .result-actions, .confirm-actions, .msg-actions, .final-links, .final-actions, .cam-actions, .gen-slow-actions {
  display: flex; flex-direction: column; align-items: stretch; gap: calc(12 * var(--m)); width: min(100%, calc(300 * var(--m)));
}
.pill-stack .pill, .result-actions .pill, .confirm-actions .pill, .msg-actions .pill, .final-links .pill, .final-actions .pill, .cam-actions .pill, .gen-slow-actions .pill { width: 100%; min-width: 0; }
.banner {
  margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 179, 217, 0.14); color: var(--err);
  font-size: max(14px, calc(14 * var(--m))); font-weight: 500; text-align: center;
}
.banner-box:empty { display: none; }

/* ---------- campos ---------- */
.field-box {
  position: relative; display: flex; align-items: center; min-height: 48px; border-radius: calc(12 * var(--m)); background: var(--input-fill);
  transition: box-shadow 0.25s;
}
.field-box::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: inherit; padding: 1.5px; background: var(--input-stroke); opacity: 0.7;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude; pointer-events: none;
  transition: opacity 0.25s;
}
.field-box:focus-within { box-shadow: 0 0 calc(18 * var(--m)) rgba(150, 90, 255, 0.55); }
.field-box:focus-within::before { opacity: 1; }
.field-icon { position: absolute; left: calc(14 * var(--m)); top: 50%; width: calc(22 * var(--m)); height: auto; transform: translateY(-50%); pointer-events: none; }
.field-input {
  width: 100%; min-height: 48px; padding: 0 calc(16 * var(--m)); border: 0; border-radius: inherit; background: transparent; color: #fff;
  font-family: var(--font); font-weight: 400; font-size: 16px; caret-color: #fff; -webkit-appearance: none; appearance: none;
}
.field-box.has-icon .field-input { padding-left: calc(52 * var(--m)); }
.field-input::placeholder { color: rgba(255, 255, 255, 0.8); }
.field-input[aria-invalid='true'] { box-shadow: inset 0 0 0 1.5px var(--err); }
.field-error { margin: 0; min-height: 0; color: var(--err); font-size: max(14px, calc(14 * var(--m))); font-weight: 500; }
.field-error:empty { display: none; }

/* ---------- consentimentos ---------- */
.check-row { display: grid; grid-template-columns: 44px 1fr; align-items: start; text-align: left; }
.check-wrap { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.check-wrap input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.check-box {
  position: relative; display: block; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(40, 6, 110, 0.5); transition: background 0.2s, border-color 0.2s;
}
.check-box::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform 0.2s var(--ease-out);
}
.check-wrap input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check-wrap input:checked + .check-box::after { transform: rotate(45deg) scale(1); }
.check-wrap input:focus-visible + .check-box { outline: 2px solid #fff; outline-offset: 3px; }
.check-row.has-error .check-box { border-color: var(--err); }
.check-body { display: block; padding-top: 11px; color: rgba(255, 255, 255, 0.86); font-size: max(12px, calc(12 * var(--m))); line-height: 1.4; letter-spacing: var(--tr-body); }
.check-text { display: inline; cursor: pointer; }
.terms-link {
  display: inline; margin-left: 6px; padding: 0; background: none; border: 0; color: #fff; font: inherit; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.check .field-error { padding-left: 44px; text-align: left; }

/* ---------- modal de termos ---------- */
.modal { position: fixed; z-index: 50; left: 0; top: 0; right: 0; bottom: 0; display: grid; align-items: end; justify-items: center; font-family: var(--font); }
.modal-backdrop { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: rgba(10, 0, 30, 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in 0.25s both; }
.modal-card {
  position: relative; width: 100%; max-width: 680px; max-height: 92vh; max-height: 92dvh; display: grid; grid-template-rows: auto 1fr auto;
  background: #1c0446; border-radius: 24px 24px 0 0; box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.16); animation: sheet-in 0.45s var(--ease-out) both;
}
.modal.is-leaving .modal-card { animation: sheet-out 0.2s ease-in both; }
.modal.is-leaving .modal-backdrop { animation: fade-in 0.2s reverse both; }
.modal-head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 18px 16px 10px 24px; }
.modal-head h2 { font-size: 21px; font-weight: 700; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 0; color: #fff; padding: 0; }
.modal-body { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 6px 24px 20px; color: rgba(255, 255, 255, 0.82); font-size: 15px; line-height: 1.6; }
.modal-body:focus-visible { outline-offset: -3px; }
.terms-sec { display: grid; row-gap: 8px; margin-top: 18px; }
.terms-sec h3 { font-size: 16px; font-weight: 700; color: #fff; }
.terms-sec h3.terms-part { font-size: 18px; color: #d9b8ff; }
.terms-sec ul { padding-left: 20px; display: grid; row-gap: 6px; list-style: disc; }
.terms-contact { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); font-weight: 500; overflow-wrap: anywhere; }
.terms-version { margin-top: 20px; font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.modal-foot { padding: 12px 24px calc(18px + var(--safe-b)); border-top: 1px solid rgba(255, 255, 255, 0.14); }
.modal-foot .btn {
  width: 100%; min-height: 48px; border: 0; border-radius: 999px; background: var(--btn-fill); color: #fff; font-family: var(--font); font-weight: 500; font-size: 16px; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.modal-foot .btn:active { background: var(--btn-fill-down); }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 24px; max-height: 84vh; max-height: 84dvh; } }

/* ---------- animações ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.45; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-out { to { transform: translateY(30px); opacity: 0; } }

[data-s] { animation: rise 0.42s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms); }

@media (prefers-reduced-motion: reduce) {
  [data-s] { animation: none; }
  .bg { transition-duration: 0.12s; }
  .boot-chev { animation: none; }
  .pill, .back, .field-box, .field-box::before { transition: none; }
  .pill:hover, .pill:active, .back:active { transform: none; }
  .modal-card, .modal-backdrop { animation-duration: 0.12s; }
}
