/* Avatar studio — identidade Lucas Redecker
   Azul campanha + amarelo + faixa RS. Superfícies arredondadas e translúcidas
   sobre um fundo em degradê: a página do estúdio é uma ferramenta, não um cartaz. */

@font-face {
  font-family: 'Effra';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Effra_Trial_Lt.ttf') format('truetype');
}
@font-face {
  font-family: 'Effra';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Effra_Trial_Bd.ttf') format('truetype');
}
@font-face {
  font-family: 'Effra';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Effra_Trial_XBd.ttf') format('truetype');
}

:root {
  --av-navy: #003281;
  --av-ink: #001f54;
  --av-yellow: #FFCB20;
  --av-white: #FFFFFF;
  --av-green: #008F65;
  --av-red: #EA1D36;
  --av-wa: #12A150;

  --av-muted: rgba(255, 255, 255, 0.66);
  --av-line: rgba(255, 255, 255, 0.14);
  --av-line-soft: rgba(255, 255, 255, 0.09);
  --av-surface: rgba(255, 255, 255, 0.055);
  --av-surface-2: rgba(255, 255, 255, 0.09);

  --av-r-xl: 28px;
  --av-r-lg: 20px;
  --av-r-md: 14px;
  --av-r-sm: 10px;
  --av-r-pill: 999px;

  --av-font-display: 'Effra', 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --av-font-body: 'Roboto', 'Segoe UI', system-ui, sans-serif;
  --av-pad: 20px;
  --av-max: 1040px;
  --av-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  :root { --av-pad: 40px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--av-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--av-white);
  background: var(--av-ink);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--av-yellow); text-decoration: none; }
a:hover { filter: brightness(1.08); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--av-yellow);
  outline-offset: 3px;
  border-radius: var(--av-r-sm);
}

.av-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.av-page__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 82% -5%, rgba(255, 203, 32, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 40% at 8% 105%, rgba(0, 143, 101, 0.16), transparent 55%),
    linear-gradient(168deg, #00398f 0%, #002a6d 48%, #001b49 100%);
}

.av-watermark {
  position: absolute;
  right: -3%;
  bottom: 4%;
  font-family: var(--av-font-display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(120px, 24vw, 260px);
  line-height: 0.8;
  color: var(--av-yellow);
  opacity: 0.055;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

/* Faixa RS — DNA do logo */
.av-rs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(180px, 45%);
  margin-bottom: 18px;
}
.av-rs span { display: block; height: 4px; border-radius: var(--av-r-pill); }
.av-rs span:nth-child(1) { background: linear-gradient(90deg, var(--av-green), transparent); }
.av-rs span:nth-child(2) { background: linear-gradient(90deg, var(--av-yellow), transparent); }
.av-rs span:nth-child(3) { background: linear-gradient(90deg, var(--av-red), transparent); }

.av-rs--foot {
  width: 132px;
  margin: 0 auto 16px;
}
.av-rs--foot span {
  height: 3px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}
.av-rs--foot span:nth-child(1) { color: var(--av-green); }
.av-rs--foot span:nth-child(2) { color: var(--av-yellow); }
.av-rs--foot span:nth-child(3) { color: var(--av-red); }

/* --- Cabeçalho ----------------------------------------------------------- */
.av-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--av-max);
  margin: 0 auto;
  padding: 18px var(--av-pad);
}

.av-brand { display: block; }

.av-brand__logo {
  width: auto;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 768px) {
  .av-brand__logo { height: 54px; }
}

.av-back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--av-r-pill);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  cursor: pointer;
  font-family: var(--av-font-body);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.av-back:hover {
  border-color: rgba(255, 203, 32, 0.6);
  color: var(--av-yellow);
  background: rgba(255, 203, 32, 0.1);
}

/* --- Corpo --------------------------------------------------------------- */
.av-main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: var(--av-max);
  margin: 0 auto;
  padding: 12px var(--av-pad) 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.av-intro {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  animation: av-rise 0.5s var(--av-ease) both;
}

.av-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--av-yellow);
  background: rgba(255, 203, 32, 0.14);
  border: 1px solid rgba(255, 203, 32, 0.32);
  border-radius: var(--av-r-pill);
  padding: 7px 16px;
  font-weight: 700;
  margin-bottom: 18px;
}

.av-title {
  font-family: var(--av-font-display);
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 12px;
  color: var(--av-white);
}

.av-title span {
  font-weight: 300;
  color: var(--av-yellow);
}

.av-lead {
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.6;
  color: var(--av-muted);
  max-width: 44ch;
}

.av-privacy {
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  background: var(--av-surface);
  border: 1px solid var(--av-line-soft);
  border-radius: var(--av-r-pill);
  padding: 9px 18px;
}

/* --- Passos -------------------------------------------------------------- */
.av-steps {
  animation: av-rise 0.55s var(--av-ease) 0.05s both;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.av-steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.av-steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  opacity: 0.42;
  transition: opacity 0.25s;
}
.av-steps__item.is-active,
.av-steps__item.is-done { opacity: 1; }

.av-steps__num {
  width: 38px;
  height: 38px;
  border-radius: var(--av-r-pill);
  display: grid;
  place-items: center;
  font-family: var(--av-font-display);
  font-weight: 800;
  font-size: 15px;
  background: var(--av-surface-2);
  border: 1px solid var(--av-line);
  color: #fff;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s var(--av-ease),
    box-shadow 0.25s;
}

.av-steps__item.is-active .av-steps__num {
  background: var(--av-yellow);
  border-color: var(--av-yellow);
  color: var(--av-navy);
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(255, 203, 32, 0.16);
}

.av-steps__item.is-done .av-steps__num {
  background: var(--av-green);
  border-color: var(--av-green);
  color: #fff;
}

.av-steps__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 480px) {
  .av-steps__label { font-size: 10px; letter-spacing: 0.03em; }
  .av-steps__num { width: 34px; height: 34px; font-size: 13px; }
}

.av-steps__bar {
  margin-top: 16px;
  height: 4px;
  border-radius: var(--av-r-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.av-steps__fill {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: var(--av-r-pill);
  background: linear-gradient(90deg, var(--av-green), var(--av-yellow));
  transition: width 0.45s var(--av-ease);
}

/* --- Cartão único que abriga as etapas ----------------------------------- */
.av-panel {
  animation: av-rise 0.6s var(--av-ease) 0.08s both;
  background: var(--av-surface);
  border: 1px solid var(--av-line-soft);
  border-radius: var(--av-r-xl);
  padding: clamp(16px, 3vw, 26px);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 70px rgba(0, 12, 40, 0.4);
}

.av-step-panel[hidden] { display: none !important; }
.av-step-panel.is-active { animation: av-soft 0.35s var(--av-ease) both; }

/* --- Etapa 1: envio -------------------------------------------------------*/
.av-drop {
  position: relative;
  border: 2px dashed rgba(255, 203, 32, 0.42);
  border-radius: var(--av-r-lg);
  background: rgba(0, 31, 84, 0.28);
  padding: clamp(36px, 7vw, 64px) 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--av-ease), box-shadow 0.25s;
  touch-action: manipulation;
}
.av-drop:hover,
.av-drop.is-dragover {
  border-color: var(--av-yellow);
  background: rgba(255, 203, 32, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(255, 203, 32, 0.1);
}

.av-drop__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  border-radius: var(--av-r-pill);
  background: var(--av-yellow);
  color: var(--av-navy);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 8px rgba(255, 203, 32, 0.12);
}

.av-drop__title {
  font-family: var(--av-font-display);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.av-drop__hint {
  margin: 0 0 26px;
  font-size: 15px;
  color: var(--av-muted);
}

.av-drop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --- Botões -------------------------------------------------------------- */
.av-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--av-font-body);
  font-size: 15px;
  font-weight: 700;
  min-height: 50px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--av-r-pill);
  transition: filter 0.15s, background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s,
    box-shadow 0.2s;
  touch-action: manipulation;
}
.av-btn:active:not(:disabled) { transform: translateY(1px); }
.av-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.av-btn--primary {
  background: var(--av-yellow);
  color: var(--av-navy);
  box-shadow: 0 10px 26px rgba(255, 203, 32, 0.22);
}
.av-btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 14px 32px rgba(255, 203, 32, 0.3);
}
.av-btn--ghost {
  background: var(--av-surface);
  color: #fff;
  border: 1px solid var(--av-line);
}
.av-btn--ghost:hover:not(:disabled) {
  border-color: rgba(255, 203, 32, 0.55);
  color: var(--av-yellow);
  background: rgba(255, 203, 32, 0.08);
}
.av-btn--block { width: 100%; }
/* `display:inline-flex` do .av-btn vence o `[hidden]` do user agent — reforçar aqui. */
.av-btn[hidden] { display: none; }
.av-btn.is-success {
  background: var(--av-green);
  color: #fff;
  box-shadow: none;
}

/* --- Etapas 2 a 4: oficina ------------------------------------------------*/
.av-workspace {
  display: grid;
  gap: 22px;
}
@media (min-width: 900px) {
  .av-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(288px, 0.82fr);
    align-items: center;
    gap: 32px;
  }
}

.av-preview-wrap {
  position: relative;
  width: min(100%, 440px);
  margin: 0 auto;
  aspect-ratio: 1;
  touch-action: none;
  user-select: none;
  overflow: hidden;
  border-radius: var(--av-r-lg);
  background: var(--av-ink);
  box-shadow: 0 26px 60px rgba(0, 12, 40, 0.5);
}

.av-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.av-canvas.is-dragging { cursor: grabbing; }
.av-canvas.is-locked { cursor: default; }

.av-hint-drag {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--av-navy);
  background: var(--av-yellow);
  border-radius: var(--av-r-pill);
  padding: 8px 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.av-preview-wrap.is-fresh .av-hint-drag { opacity: 1; }

.av-step-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  font-family: var(--av-font-display);
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 20, 56, 0.55);
  backdrop-filter: blur(6px);
  border-radius: var(--av-r-pill);
  padding: 6px 12px;
}

.av-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.av-block[hidden] { display: none !important; }

.av-control-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--av-yellow);
  margin-bottom: 14px;
}

.av-tip {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--av-muted);
}

.av-zoom {
  display: flex;
  align-items: center;
  gap: 14px;
}
.av-zoom input[type="range"] {
  flex: 1;
  accent-color: var(--av-yellow);
  height: 5px;
  cursor: pointer;
}
.av-zoom__val {
  min-width: 48px;
  text-align: right;
  font-family: var(--av-font-display);
  font-weight: 800;
  font-style: italic;
  color: var(--av-yellow);
}

.av-frames {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.av-frame-btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: var(--av-r-md);
  background: var(--av-surface-2);
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--av-ease), box-shadow 0.2s;
  touch-action: manipulation;
}
.av-frame-btn img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
/* Rótulo fora da miniatura: em cima da imagem ele briga com a própria tarja da moldura. */
.av-frame-btn span {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}
.av-frame-btn:hover { transform: translateY(-3px); }
.av-frame-btn.is-active {
  border-color: var(--av-yellow);
  box-shadow: 0 0 0 4px rgba(255, 203, 32, 0.14);
}
.av-frame-btn.is-active span { color: var(--av-yellow); }

.av-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.av-nav.is-finish { grid-template-columns: 1fr; }
.av-nav .av-btn--block,
.av-nav .av-share-row { grid-column: 1 / -1; }
.av-nav.is-finish #av-prev { order: 6; }

.av-share-row[hidden] { display: none !important; }
.av-share-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.av-share-apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.av-share-app {
  appearance: none;
  border: 1px solid var(--av-line);
  border-radius: var(--av-r-md);
  background: var(--av-surface);
  color: #fff;
  font-family: var(--av-font-body);
  font-size: 12px;
  font-weight: 700;
  min-height: 46px;
  padding: 0 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  touch-action: manipulation;
}
.av-share-app::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--av-yellow);
}
.av-share-app#av-share-wa::before { background: var(--av-wa); }
.av-share-app#av-share-ig::before {
  background: linear-gradient(90deg, #f58529, #dd2a7b 55%, #8134af);
}
.av-share-app#av-share-fb::before { background: #1877F2; }
.av-share-app:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: var(--av-surface-2);
}

.av-share-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--av-muted);
  text-align: center;
}

.av-block--done { text-align: center; }

.av-done-burst {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: var(--av-r-pill);
  background: var(--av-green);
  position: relative;
  box-shadow: 0 0 0 8px rgba(0, 143, 101, 0.16);
}
.av-done-burst::before {
  content: '';
  position: absolute;
  inset: 19px 16px 23px;
  border: solid #fff;
  border-width: 0 0 3px 3px;
  transform: rotate(-45deg);
}

.av-done-title {
  font-family: var(--av-font-display);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--av-white);
  letter-spacing: -0.02em;
}

.av-done-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--av-muted);
}

/* --- Rodapé -------------------------------------------------------------- */
.av-foot {
  position: relative;
  z-index: 2;
  padding: 26px var(--av-pad) 34px;
  text-align: center;
}

.av-footer-note {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.4);
}

.av-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes av-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes av-soft {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

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