/* CBMG 2027 — página da moldura (moldura.html)
   Público com mais idade: textos grandes, botões grandes, alto contraste e poucos passos. */

.page-moldura [hidden] { display: none !important; }
.mold { position: relative; z-index: 1; padding: calc(var(--header-h) + clamp(1.2rem, 4vh, 2.5rem)) var(--gutter) clamp(3rem, 8vh, 5rem); max-width: 1440px; margin: 0 auto; }
.mold__intro { grid-area: intro; max-width: 40rem; }
.mold__intro .kicker { margin-bottom: .7rem; font-size: .95rem; }
.mold__title { margin: 0 0 .8rem; font-weight: 900; font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.04; letter-spacing: -.02em; }
.mold__lead { margin: 0; font-size: clamp(1.1rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--text-soft); }

/* desktop: à esquerda título, foto e rosto; à direita as molduras prontas */
.mold__app {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1rem, 2.2vw, 1.6rem) clamp(1.2rem, 3vw, 3rem);
  grid-template-areas: "intro share" "photo share" "focus share" ". share";
  align-items: start;
}
.step--photo { grid-area: photo; }
.step--focus { grid-area: focus; }
.step--share { grid-area: share; position: sticky; top: calc(var(--header-h) + 1rem); }

/* ---------- passos ---------- */
.step { padding: clamp(1.2rem, 2.4vw, 1.8rem); border-radius: 24px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="light"] .step { box-shadow: inset 0 0 0 1px var(--line), 0 14px 40px -26px rgba(2, 17, 58, .35); }
.step__title { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.2; }
.step__n { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--amarelo); color: var(--azul); font-weight: 900; font-size: 1.2rem; }
.step__actions { display: grid; gap: .8rem; }
.step__note { margin: 0 0 1rem; font-size: 1.05rem; line-height: 1.5; color: var(--text-soft); }
.step__actions + .step__note { margin: .9rem 0 0; }
.step__error { margin: .9rem 0 0; padding: .8rem 1rem; border-radius: 14px; font-size: 1.05rem; font-weight: 600; background: rgba(184, 11, 75, .14); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(184, 11, 75, .5); }

.btn--xl { min-height: 64px; padding: 1.1rem 2rem; font-size: 1.15rem; font-weight: 700; white-space: normal; text-align: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn:disabled::after { display: none; }

html.is-mouse .only-touch, html.is-touch .only-mouse { display: none; }

/* ---------- foco: a foto inteira com o ponto no rosto (como no admin do site do Baleia) ---------- */
.focus { position: relative; margin: 0 auto 1rem; width: fit-content; max-width: 100%; border-radius: 16px; overflow: hidden; background: #02113A; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.focus__img { display: block; max-width: 100%; max-height: 52vh; width: auto; height: auto; pointer-events: none; }
.focus__dot {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(255, 181, 4, .3); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--amarelo), 0 6px 18px rgba(0, 0, 0, .45);
  cursor: grab; transition: transform .25s var(--ease-spring);
  animation: dotPulse 2.4s var(--ease-out) infinite;
}
.focus.is-drag .focus__dot { transform: scale(1.2); cursor: grabbing; animation: none; }
.focus__dot:focus-visible { outline: 3px solid var(--turquesa); outline-offset: 4px; }
@keyframes dotPulse { 0%, 60%, 100% { box-shadow: 0 0 0 3px var(--amarelo), 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 0 rgba(255, 181, 4, .6); } 30% { box-shadow: 0 0 0 3px var(--amarelo), 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 16px rgba(255, 181, 4, 0); } }

.adjust__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.adjust__btn {
  min-height: 52px; padding: .7rem 1.2rem; border-radius: 999px; font-size: 1.05rem; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(var(--ink-rgb), .35); transition: background-color .3s, transform .4s var(--ease-spring);
}
.adjust__btn:hover { background: rgba(var(--ink-rgb), .08); }
.adjust__btn:active { transform: scale(.94); }
.adjust__btn span { font-size: 1.35rem; line-height: 0; margin-right: .2rem; }

/* ---------- molduras prontas ---------- */
/* lado a lado com a mesma altura: cada cartão cresce na proporção do seu formato (--grow = largura/altura) */
.cards { display: flex; gap: clamp(.8rem, 1.6vw, 1.2rem); align-items: flex-end; }
.card { flex: var(--grow) 1 0; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.card__frame { aspect-ratio: var(--ratio); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line); background: #02113A; }
.card__frame canvas { display: block; width: 100%; height: 100%; }
.card__name { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.card__name small { display: block; font-size: .92rem; font-weight: 500; color: var(--text-soft); }
.card__btn { min-height: 58px; padding: .9rem 1rem; }

/* soltar a foto em qualquer lugar da página (computador) */
.mold__drop {
  position: fixed; inset: 0; z-index: 70; margin: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #fff;
  background: rgba(2, 17, 58, .8); box-shadow: inset 0 0 0 6px var(--amarelo); opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.is-drop .mold__drop { opacity: 1; }

/* ---------- concluído ---------- */
.done { margin-top: 1.2rem; padding: 1.1rem 1.2rem; border-radius: 18px; background: rgba(1, 180, 211, .14); box-shadow: inset 0 0 0 1.5px rgba(1, 180, 211, .45); font-size: 1.1rem; line-height: 1.5; }
.done p { margin: 0; }
.done__title { font-size: 1.35rem; font-weight: 800; margin-bottom: .3rem !important; }

/* ---------- tabbar: item da página atual ---------- */
.tabbar__item.is-current { color: var(--ink); background: rgba(var(--ink-rgb), .08); }

/* ---------- tablet/celular: uma coluna, na ordem de uso; molduras uma embaixo da outra ---------- */
@media (max-width: 1024px) {
  .mold__app { grid-template-columns: 1fr; grid-template-areas: "intro" "photo" "focus" "share"; }
  .step--share { position: relative; top: 0; }
  .step--focus { scroll-margin-top: calc(var(--header-h) + .8rem); }
  .cards { flex-direction: column; align-items: center; gap: 1.6rem; }
  .card { flex: none; width: 100%; max-width: 460px; }
  .card__frame { width: min(100%, 62vh * var(--grow)); margin: 0 auto; }
}
@media (max-width: 767px) {
  .mold { padding-bottom: calc(7rem + env(safe-area-inset-bottom)); }
  .focus__img { max-height: 46vh; }
}
