/* Studio Fotográfico EssêncIA
   Sistema visual da NeuroAlquimIA — tokens extraídos de
   IDENTIDADE-VISUAL-NEUROALQUIMIA-MASTER.html (fonte da verdade da marca).

   O app assume o escuro da marca, como o Brand Dashboard: fundo profundo,
   creme no texto, âmbar na ação. Num estúdio de fotos isso não é só coerência
   de marca — foto lê melhor sobre fundo escuro. */

/* --- fontes da marca, auto-hospedadas (o CSP é 'self' e o app é PWA) ------ */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fontes/cormorant-garamond.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/fontes/montserrat.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('/fontes/lora.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Dancing Script';
  src: url('/fontes/dancing-script.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* paleta — nomes e valores idênticos ao documento mestre */
  --amber: #c9913d;
  --amber-light: #e8d5b7;
  --amber-glow: #e8c87a;
  --moss: #2d4a3e;
  --moss-dark: #1e342b;
  --purple-deep: #5b3a7a;
  --purple-medium: #8e6aaf;
  --purple-light: #c4a8d8;
  --rose: #c97b84;
  --tiffany: #6abfad;
  --tiffany-light: #a3ddd0;
  --cream: #f5ecd7;
  --parchment: #f0e8d4;
  --charcoal: #2c2c2c;

  --bg-dark: #1a1a1a;
  --bg-dark-card: #242424;
  --bg-dark-input: #333333;

  --text-on-dark: #f5ecd7;
  --text-muted-dark: #b8b0a0;

  --status-success: #4a8f6e;
  --status-error: #c96b6b;
  --status-warning: #d4a843;
  --status-info: #8e6aaf;

  --gradient-hero: linear-gradient(135deg, #2d4a3e, #5b3a7a, #c9913d);
  --gradient-golden: linear-gradient(135deg, #c9913d 0%, #e8c87a 100%);
  --gradient-transmutation: linear-gradient(135deg, #5b3a7a, #c9913d);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .22);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .42);
  --shadow-amber: 0 4px 20px rgba(201, 145, 61, .3);

  /* papéis tipográficos, conforme o mestre */
  --font-display: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-accent: 'Dancing Script', 'Segoe Script', cursive;

  /* superfícies derivadas */
  --linha: rgba(245, 236, 215, .1);
  --linha-forte: rgba(245, 236, 215, .18);
  --vidro: rgba(245, 236, 215, .06);
  --barra-altura: calc(62px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html {
  background: var(--bg-dark);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(58vw 42vh at 82% -6%, rgba(201, 145, 61, .16), transparent 62%),
    radial-gradient(52vw 40vh at 6% 4%, rgba(91, 58, 122, .18), transparent 64%),
    radial-gradient(70vw 50vh at 50% 106%, rgba(45, 74, 62, .3), transparent 68%),
    var(--bg-dark);
  background-attachment: fixed;
  color: var(--text-on-dark);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

/* --- tipografia ---------------------------------------------------------- */

h1, h2, h3, .serifa {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: .002em;
  color: var(--cream);
  margin: 0 0 .34em;
}
/* O display da marca é generoso; num aparelho estreito ele empurrava o botão
   para fora da dobra. Escala com a tela, sem perder a presença editorial. */
h1 { font-size: clamp(1.72rem, 6.6vw, 2.3rem); }
h2 { font-size: clamp(1.35rem, 5vw, 1.6rem); }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1em; }

/* Texto de leitura em Lora — o papel de corpo definido pela marca. */
.discreta, .dica, .vazio p, .cartao > p, .aviso p, .modal-conteudo > p {
  font-family: var(--font-body);
  font-size: .95rem;
  line-height: 1.62;
  color: var(--text-muted-dark);
}
.dica { font-size: .86rem; margin: .4rem 0 0; }

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Micro-rótulo em versalete espaçado: a assinatura tipográfica da marca. */
.passo, .marca-nome small, .selo, th, .barra button span {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 600;
}
.passo { font-size: .68rem; color: var(--amber); margin-bottom: .55rem; display: block; }

.assinatura {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--amber-light);
  letter-spacing: .01em;
}

.pular {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: var(--charcoal); padding: .7rem 1rem;
  border-radius: 0 0 var(--radius-md) 0; font-weight: 700;
}
.pular:focus { left: 0; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: var(--radius-sm); }

/* --- estrutura ----------------------------------------------------------- */

.tela { min-height: 100dvh; display: flex; flex-direction: column; }
.conteudo { flex: 1; padding: 1.15rem 1.15rem calc(var(--barra-altura) + 1.6rem); max-width: 780px; width: 100%; margin: 0 auto; }
.conteudo.sem-barra { padding-bottom: 2.4rem; }

.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.15rem; padding-top: max(.9rem, env(safe-area-inset-top));
  background: rgba(26, 26, 26, .82);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--linha);
}
.topo h1, .topo h2 { margin: 0; font-size: 1.24rem; flex: 1; }
.topo .sub {
  display: block; font-family: var(--font-heading); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted-dark); font-weight: 500;
}

/* --- marca --------------------------------------------------------------- */

.marca { display: flex; align-items: center; gap: .65rem; }
.marca-simbolo {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--gradient-hero);
  box-shadow: inset 0 0 0 1px rgba(245, 236, 215, .3), var(--shadow-amber);
  position: relative;
}
.marca-simbolo::after {
  content: ''; position: absolute; inset: 30%;
  border-radius: 50%; border: 1.5px solid rgba(245, 236, 215, .75);
}
.marca-nome { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.12; color: var(--cream); }
.marca-nome small { display: block; font-size: .58rem; color: var(--amber); margin-top: .18rem; }

/* --- barra inferior ------------------------------------------------------ */

.barra {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(36, 36, 36, .93);
  backdrop-filter: saturate(150%) blur(16px);
  border-top: 1px solid var(--linha);
  padding-bottom: env(safe-area-inset-bottom);
}
.barra button {
  background: none; border: 0; padding: .55rem .2rem .6rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  font-family: var(--font-heading); font-size: .6rem; color: var(--text-muted-dark);
  min-height: 60px; position: relative;
}
.barra button svg { width: 21px; height: 21px; }
.barra button[aria-current="page"] { color: var(--amber); }
.barra button[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; border-radius: 0 0 2px 2px; background: var(--gradient-golden);
}

/* --- botões -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .85rem 1.5rem;
  border-radius: var(--radius); border: 1px solid transparent;
  background: var(--gradient-golden); color: var(--charcoal);
  font-family: var(--font-heading); font-size: .8rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: var(--shadow-amber);
  transition: transform .14s ease, box-shadow .2s ease, opacity .2s ease, background .2s ease;
}
.btn:hover { box-shadow: 0 6px 26px rgba(201, 145, 61, .42); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.bloco { width: 100%; }

.btn.fantasma {
  background: var(--vidro); color: var(--cream);
  border-color: var(--linha-forte); box-shadow: none;
}
.btn.fantasma:hover { background: rgba(245, 236, 215, .1); border-color: rgba(201, 145, 61, .5); }

.btn.discreto {
  background: transparent; color: var(--text-muted-dark); box-shadow: none;
  min-height: 44px; padding: .5rem 1rem; letter-spacing: .1em; font-weight: 600;
}
.btn.discreto:hover { background: var(--vidro); color: var(--cream); }

.btn.perigo {
  background: transparent; color: var(--status-error); box-shadow: none;
  border-color: rgba(201, 107, 107, .42);
}
.btn.perigo:hover { background: rgba(201, 107, 107, .12); }

.btn.pequeno { min-height: 40px; padding: .45rem .95rem; font-size: .7rem; }

.acoes { display: flex; gap: .65rem; flex-wrap: wrap; }
.acoes.empilhado { flex-direction: column; }

/* --- formulário ---------------------------------------------------------- */

label {
  display: block; font-family: var(--font-heading); font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber);
  margin: 0 0 .5rem;
}

input[type="text"], input[type="tel"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; padding: .9rem 1rem;
  border: 1px solid var(--linha); border-radius: var(--radius);
  background: var(--vidro); color: var(--cream);
  font-family: var(--font-heading); font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: rgba(184, 176, 160, .55); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--amber);
  background: rgba(245, 236, 215, .09);
  box-shadow: 0 0 0 3px rgba(201, 145, 61, .2);
}
textarea { min-height: 112px; resize: vertical; line-height: 1.55; font-family: var(--font-body); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.6rem;
}
.campo { margin-bottom: 1.2rem; }

.codigo-entrada {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  letter-spacing: .44em; text-align: center; padding-left: .44em; color: var(--amber-light);
}

/* --- cartões ------------------------------------------------------------- */

.cartao {
  background: linear-gradient(160deg, rgba(245, 236, 215, .05), rgba(245, 236, 215, .02));
  border: 1px solid var(--linha);
  border-radius: var(--radius-lg); padding: 1.3rem;
  box-shadow: var(--shadow-md); margin-bottom: 1.1rem;
}
.cartao.plano { background: var(--bg-dark-card); box-shadow: none; }
.cartao h2, .cartao h3 { margin-top: 0; }

.lista-linhas { border-top: 1px solid var(--linha); }
.linha { display: flex; align-items: center; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--linha); }
.linha .cresce { flex: 1; min-width: 0; }
.linha strong { display: block; font-family: var(--font-heading); font-weight: 600; font-size: .95rem; color: var(--cream); }
.linha small { display: block; font-family: var(--font-body); color: var(--text-muted-dark); font-size: .84rem; }

.selo {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .62rem; padding: .28rem .7rem; border-radius: var(--radius-full);
  background: rgba(245, 236, 215, .1); color: var(--text-muted-dark);
  border: 1px solid var(--linha);
}
.selo.ok { background: rgba(74, 143, 110, .18); color: #7fc7a1; border-color: rgba(74, 143, 110, .4); }
.selo.alerta { background: rgba(212, 168, 67, .16); color: var(--status-warning); border-color: rgba(212, 168, 67, .4); }
.selo.erro { background: rgba(201, 107, 107, .16); color: #e29a9a; border-color: rgba(201, 107, 107, .42); }

.aviso {
  padding: .95rem 1.1rem; border-radius: var(--radius);
  background: rgba(201, 145, 61, .1);
  border: 1px solid rgba(201, 145, 61, .32);
  border-left-width: 3px;
  margin-bottom: 1.1rem;
}
.aviso p { margin-bottom: .5em; color: var(--cream); }
.aviso p:last-child { margin-bottom: 0; }
.aviso.erro { background: rgba(201, 107, 107, .12); border-color: rgba(201, 107, 107, .42); }
.aviso.erro p { color: #efb9b9; }
.aviso.neutro { background: var(--vidro); border-color: var(--linha-forte); }
.aviso ul { font-family: var(--font-body); color: var(--text-muted-dark); font-size: .92rem; }

/* --- sugestões ----------------------------------------------------------- */

.sugestoes {
  display: flex; gap: .6rem; overflow-x: auto;
  margin: 0 -1.15rem; padding: .25rem 1.15rem .9rem;
  scroll-snap-type: x proximity;
}
.sugestoes::-webkit-scrollbar { height: 0; }
.chip {
  flex: none; scroll-snap-align: start; max-width: 78vw;
  padding: .75rem 1.15rem; border: 1px solid var(--linha);
  border-radius: var(--radius-full); background: var(--vidro);
  color: var(--text-muted-dark);
  font-family: var(--font-body); font-size: .9rem; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.chip:hover { border-color: var(--amber); color: var(--cream); background: rgba(201, 145, 61, .1); }

/* --- imagens ------------------------------------------------------------- */

.grade { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 620px) { .grade { grid-template-columns: repeat(3, 1fr); } }

.foto {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-dark-card);
  border: 1px solid var(--linha); cursor: pointer; padding: 0;
  transition: border-color .2s ease, transform .16s ease;
}
.foto:hover { border-color: rgba(201, 145, 61, .55); transform: translateY(-2px); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .marca-aprovada {
  position: absolute; top: .5rem; right: .5rem;
  background: var(--gradient-golden); color: var(--charcoal);
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem;
  box-shadow: var(--shadow-sm);
}

.referencias { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .6rem; }
.referencia { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--linha); }
.referencia img { width: 100%; height: 100%; object-fit: cover; }
.referencia button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border: 0; border-radius: 50%; background: rgba(26, 26, 26, .78); color: var(--cream);
  cursor: pointer; font-size: .78rem; line-height: 1; display: grid; place-items: center;
}
.referencia button:hover { background: var(--status-error); }

.solta {
  border: 1.5px dashed var(--linha-forte); border-radius: var(--radius-lg);
  padding: 1.8rem 1.15rem; text-align: center; background: var(--vidro);
  cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.solta:hover, .solta.sobre { border-color: var(--amber); background: rgba(201, 145, 61, .1); }
.solta p:first-child { color: var(--cream); font-family: var(--font-heading); }

/* --- progresso ----------------------------------------------------------- */

.progresso { height: 5px; border-radius: var(--radius-full); background: rgba(245, 236, 215, .1); overflow: hidden; margin: .9rem 0; }
.progresso i { display: block; height: 100%; background: var(--gradient-golden); transition: width .5s ease; box-shadow: var(--shadow-amber); }

.esqueleto {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(245, 236, 215, .04) 30%, rgba(201, 145, 61, .12) 50%, rgba(245, 236, 215, .04) 70%);
  background-size: 220% 100%; animation: brilho 1.6s ease-in-out infinite;
  border: 1px solid var(--linha);
}
@keyframes brilho { to { background-position: -120% 0; } }

.girando { animation: girar .9s linear infinite; display: inline-block; color: var(--amber); }
@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- avisos flutuantes --------------------------------------------------- */

.avisos {
  position: fixed; left: 50%; bottom: calc(var(--barra-altura) + .9rem); transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: .5rem;
  width: min(94vw, 460px); pointer-events: none;
}
.torrada {
  background: var(--bg-dark-card); color: var(--cream);
  border: 1px solid var(--linha-forte); border-left: 3px solid var(--amber);
  padding: .85rem 1.1rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .92rem;
  box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: sobe .3s ease; transition: opacity .3s ease;
}
.torrada.erro { border-left-color: var(--status-error); }
.torrada.ok { border-left-color: var(--status-success); }
@keyframes sobe { from { opacity: 0; transform: translateY(10px); } }

/* --- modal --------------------------------------------------------------- */

.modal { border: 0; padding: 0; background: transparent; max-width: min(96vw, 620px); width: 100%; max-height: 92dvh; }
.modal::backdrop { background: rgba(14, 12, 10, .78); backdrop-filter: blur(4px); }
.modal-conteudo {
  background: var(--bg-dark-card); border: 1px solid var(--linha-forte);
  border-radius: var(--radius-xl); padding: 1.4rem;
  max-height: 92dvh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-conteudo img.grande { width: 100%; border-radius: var(--radius); display: block; margin-bottom: 1.1rem; }

/* --- diversos ------------------------------------------------------------ */

.carregando-inicial { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 1.1rem; }
.carregando-inicial p { font-family: var(--font-body); color: var(--text-muted-dark); }
.carregando-inicial .marca-simbolo { width: 52px; height: 52px; animation: pulsar 2.4s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .55; transform: scale(.95); } }

.vazio { text-align: center; padding: 2.8rem 1rem; }
.vazio .marca-simbolo { width: 50px; height: 50px; margin: 0 auto 1.2rem; opacity: .65; }
.centro { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt { margin-top: 1.15rem; }
.mb0 { margin-bottom: 0; }
.linha-dupla { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

.opcoes { display: flex; flex-wrap: wrap; gap: .55rem; }
.opcao {
  padding: .65rem 1.1rem; border: 1px solid var(--linha); border-radius: var(--radius-full);
  background: var(--vidro); font-family: var(--font-heading); font-size: .86rem;
  cursor: pointer; color: var(--cream); text-decoration: none; transition: all .18s ease;
}
.opcao:hover { border-color: var(--amber); background: rgba(201, 145, 61, .12); }
.opcao[aria-pressed="true"] { background: var(--gradient-golden); color: var(--charcoal); border-color: transparent; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-family: var(--font-heading); font-size: .86rem; }
th, td { text-align: left; padding: .6rem .55rem; border-bottom: 1px solid var(--linha); }
th { font-size: .64rem; color: var(--amber); }
td { color: var(--text-on-dark); }
.rolagem { overflow-x: auto; }

.numero { font-family: var(--font-display); font-weight: 700; font-size: 1.95rem; line-height: 1.1; display: block; color: var(--amber-light); }
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: .75rem; }
.metrica { background: var(--vidro); border: 1px solid var(--linha); border-radius: var(--radius); padding: .95rem; }
.metrica small {
  font-family: var(--font-heading); color: var(--text-muted-dark); font-size: .66rem;
  text-transform: uppercase; letter-spacing: .1em;
}

input[type="checkbox"] { accent-color: var(--amber); }
::selection { background: rgba(201, 145, 61, .34); color: var(--cream); }
