/* Pic Moments — tokens e componentes do redesign (prompt §3–§5).
   Base de todas as telas novas: convidado (6.1), painel e login (6.2), onboarding (6.3),
   landing (6.4). As páginas antigas (recordação, admin) continuam em styles.css/admin.css.
   Valores exatamente como no design; não ajustar cor "a olho" aqui. */

:root {
  /* neutros */
  --ink: #16121D;
  --ink-70: #4B4553;
  --ink-50: #8C8695;
  --line: #ECE6DE;
  --line-2: #DDD5CA;
  --paper: #FAF6F0;
  --paper-2: #F3EEE6;
  --white: #FFFFFF;

  /* marca */
  --flash: #FF5A2C;
  --flash-dark: #E3461A;
  --flash-soft: #FFE5DA;
  --lilac: #BBA8FF;  --lilac-soft: #EEE8FF;
  --lime: #D8F35A;   --lime-soft: #F4FCD3;
  --sky: #96D3FF;    --sky-soft: #E3F3FF;
  --pink: #FFB3D6;   --pink-soft: #FFE8F2;

  /* apoio */
  --gold: #F2C14E; --navy: #1B2557; --green: #0E3B2E; --champagne: #E9D8B4;
  --ok: #1F9D55;
  --ok-text: #17803D;
  --live: #22C55E;
  --live-bg: #E6F6EC; --live-text: #17663A;
  --rec: #FF3B30;
  --chart-video: #7C5CFF;
  --erro: #C2261A;

  /* pares ícone/fundo dos cards de recurso, métricas e tipos */
  --ic-flash: #E3461A;
  --ic-lilac: #5B3FD6;
  --ic-lime: #4F6B00;
  --ic-sky: #1D6FA8;
  --ic-pink: #B23A78;
  --green-soft: #E4EFE9;

  /* tipografia */
  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  /* raios */
  --r-pill: 999px;
  --r-input: 14px;
  --r-card: 26px;
  --r-thumb: 14px;

  /* sombras (base rgb(23 18 28)) */
  --sh-sm: 0 1px 2px rgb(23 18 28 / 6%), 0 4px 12px rgb(23 18 28 / 5%);
  --sh-md: 0 2px 6px rgb(23 18 28 / 5%), 0 12px 32px rgb(23 18 28 / 8%);
  --sh-lg: 0 8px 24px rgb(23 18 28 / 10%), 0 30px 80px rgb(23 18 28 / 18%);
  --sh-xl: 0 20px 40px rgb(23 18 28 / 12%), 0 50px 120px rgb(23 18 28 / 22%);

  /* foco: anel Flash de 2 px */
  --focus: 0 0 0 2px var(--white), 0 0 0 4px var(--flash);

  --t-fast: 140ms;
  --t-med: 220ms;
  --t-slow: 260ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

img,
video,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden,
[hidden] {
  display: none !important;
}

.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-visible {
  outline: none;
  box-shadow: var(--focus);
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.01em;
  color: var(--flash);
}

/* ------------------------------------------------------------ Logo */

.logo {
  --logo-h: 30px;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--logo-h) * .3);
  color: var(--ink);
  text-decoration: none;
}

.logo-marca {
  width: var(--logo-h);
  height: var(--logo-h);
  flex: none;
}

.logo-texto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(var(--logo-h) * .7);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo--escuro {
  color: var(--white);
}

/* ------------------------------------------------------------ Button */

.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast);
  user-select: none;
  -webkit-user-select: none;
}

.btn .ic {
  width: 19px;
  height: 19px;
  flex: none;
}

.btn:active:not(:disabled) {
  transform: scale(.98);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .4;
  cursor: not-allowed;
}

.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: 13px; }
.btn-sm .ic { width: 17px; height: 17px; }
.btn-lg { --btn-h: 58px; padding: 0 28px; font-size: 17px; }
.btn-lg .ic { width: 21px; height: 21px; }

.btn-bloco { width: 100%; }

.btn-primary { background: var(--flash); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--flash-dark); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-ghost { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); }
.btn-soft { background: var(--flash-soft); color: var(--flash-dark); }
.btn-white { background: var(--white); color: var(--ink); }
.btn-glass {
  background: rgb(255 255 255 / 18%);
  color: var(--white);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.btn-glass:hover:not(:disabled) { background: rgb(255 255 255 / 26%); }
.btn-text { background: transparent; color: var(--ink-70); padding: 0 12px; }

.btn-ghost:focus-visible { box-shadow: inset 0 0 0 1px var(--line-2), var(--focus); }

/* Só ícone: quadrado (círculo) com a mesma altura. Área de toque mínima de 44 px. */
.btn-icone {
  width: var(--btn-h);
  padding: 0;
}

.btn-icone.btn-sm::after,
.btn-icone.btn-alvo::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.btn-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--flash-dark);
  text-decoration: none;
  cursor: pointer;
}

/* ------------------------------------------------------------ Chip */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.chip .ic {
  width: 15px;
  height: 15px;
  flex: none;
}

.chip-ponto::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ------------------------------------------------------------ Input */

.campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campo-label {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-70);
}

.campo-caixa {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r-input);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow var(--t-fast);
}

.campo-caixa:focus-within {
  box-shadow: inset 0 0 0 2px var(--flash);
}

.campo-caixa > .ic {
  width: 18px;
  height: 18px;
  color: var(--ink-50);
  flex: none;
}

.campo-caixa input,
.campo-caixa textarea {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px; /* 16 px: abaixo disso o iOS Safari dá zoom no foco */
  color: var(--ink);
}

.campo-caixa input::placeholder,
.campo-caixa textarea::placeholder {
  color: var(--ink-50);
  opacity: 1;
}

.campo-caixa input:focus-visible {
  box-shadow: none;
}

.campo--paper .campo-caixa {
  background: var(--paper);
}

.campo-hint {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-50);
}

.campo-hint.is-ok { color: var(--ok); font-weight: 600; }
.campo-hint.is-erro { color: var(--erro); font-weight: 600; }

/* ------------------------------------------------------------ Toggle */

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--line-2);
  cursor: pointer;
  transition: background-color var(--t-fast);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-med) var(--ease);
}

.toggle:checked { background: var(--flash); }
.toggle:checked::after { transform: translateX(18px); }

/* ------------------------------------------------------------ Tabs segmentadas */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
}

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-50);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tab .ic {
  width: 17px;
  height: 17px;
}

.tab.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--sh-sm);
}

.tab-badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--line);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-70);
  text-align: center;
}

.tab.is-active .tab-badge {
  background: var(--ink);
  color: var(--white);
}

/* ------------------------------------------------------------ Avatar */

.avatar {
  --av: 26px;
  display: inline-grid;
  place-items: center;
  width: var(--av);
  height: var(--av);
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--lilac);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--av) * .42);
  line-height: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatares {
  display: inline-flex;
}

.avatares .avatar {
  box-shadow: 0 0 0 2px var(--paper);
}

.avatares .avatar + .avatar {
  margin-left: -8px;
}

/* ------------------------------------------------------------ Story ring */

.story-anel {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--flash), var(--lilac));
  flex: none;
}

.story-anel.is-visto {
  background: var(--line-2);
}

.story-anel-foto {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--white);
  overflow: hidden;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--ink-50);
}

.story-anel-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------ Photo tile */

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper-2);
}

.tile > img,
.tile > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-video {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: rgb(22 18 29 / 55%);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.tile-video .ic {
  width: 11px;
  height: 11px;
}

.tile-autor {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: rgb(22 18 29 / 45%);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.tile-autor span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-autor .avatar {
  --av: 20px;
}

/* ------------------------------------------------------------ Caixa de ícone (pares do §3) */

.caixa-icone {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
}

.caixa-icone .ic {
  width: 17px;
  height: 17px;
}

.caixa-flash { background: var(--flash-soft); color: var(--ic-flash); }
.caixa-lilac { background: var(--lilac-soft); color: var(--ic-lilac); }
.caixa-sky { background: var(--sky-soft); color: var(--ic-sky); }
.caixa-lime { background: var(--lime-soft); color: var(--ic-lime); }
.caixa-pink { background: var(--pink-soft); color: var(--ic-pink); }
.caixa-paper { background: var(--paper-2); color: var(--ink); }
.caixa-green { background: var(--green-soft); color: var(--green); }

/* ------------------------------------------------------------ Card */

.card {
  background: var(--white);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
}

/* ------------------------------------------------------------ Bottom sheet */

.sheet-fundo {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(22 18 29 / 60%);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}

.sheet-fundo.is-open {
  opacity: 1;
}

.sheet {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 24px calc(34px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: var(--white);
  text-align: center;
  transform: translateY(24px);
  transition: transform var(--t-slow) var(--ease);
}

.sheet-fundo.is-open .sheet {
  transform: none;
}

.sheet-alca {
  width: 40px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--line-2);
}

.sheet-titulo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.sheet-texto {
  margin: -8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-70);
}

.sheet .campo {
  text-align: left;
}

/* ------------------------------------------------------------ Phone mockup */
/* Só para prévia (onboarding) e landing. A tela mostra a página do convidado de verdade
   (classes de convidado.css), em 390 px, escalada por --escala. */

/* Phone mockup: corpo #0E0B12 raio 46, tela raio 38, ilha dinâmica (§5). */
.celular {
  position: relative;
  width: 236px;
  height: 484px;
  padding: 8px;
  border-radius: 46px;
  background: #0E0B12;
  box-shadow: var(--sh-lg);
}

.celular::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 3;
  width: 70px;
  height: 20px;
  border-radius: 999px;
  background: #0E0B12;
  transform: translateX(-50%);
}

.celular-tela {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 38px;
  background: var(--paper);
}

/* A página do convidado de verdade (390 px), escalada para caber na tela do mockup. */
.celular-tela .pagina {
  width: 390px;
  min-height: 0;
  height: 800px;
  box-shadow: none;
  transform: scale(var(--escala, 0.5641));
  transform-origin: 0 0;
  pointer-events: none;
}

.celular-tela .capa {
  min-height: 260px;
  padding-top: 92px;
}

.celular-tela .capa-barra {
  top: 52px;
}

.celular-tela .fab {
  position: absolute;
  bottom: 40px;
}

.celular-tela .stories-bar {
  margin-top: 0;
  overflow: hidden;
}

.mock-grade {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mock-grade span {
  height: 150px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
}

.mock-grade span:nth-child(2) { height: 120px; }
.mock-grade span:nth-child(3) { height: 130px; }

/* ------------------------------------------------------------ Movimento reduzido */

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