@font-face { font-family: Anton; src: url('fonts/anton.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url('fonts/dm-mono-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url('fonts/dm-mono-500.ttf') format('truetype'); font-weight: 500 900; font-display: swap; }

:root {
  --ink: #f7f3e8;
  --muted: #aaa79f;
  --panel: #17171a;
  --line: rgba(255,255,255,.13);
  --gold: #f4c430;
  --gold-light: #fff0a3;
  --gold-dark: #c28b00;
  --green: #15a856;
  --green-bright: #2ed87b;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; background: #08080a; color: var(--ink); }

body {
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(244,196,48,.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(244,196,48,.05), transparent 60%),
    #08080a;
}

button { font: inherit; }

.light-shell {
  width: min(100%, 31rem);
  min-height: 100dvh;
  margin: auto;
  padding: max(1.1rem, env(safe-area-inset-top)) 1rem max(1.2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: Anton, Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: .16em;
  user-select: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  padding: .22rem .7rem;
  font-size: 1.15rem;
  line-height: 1.05;
  font-weight: 900;
  color: #0d0d0f;
  background: linear-gradient(135deg, #FFF0A3 0%, #F4C430 45%, #C28B00 100%);
  border-radius: .3rem;
  border: 1px solid rgba(255, 240, 163, 0.4);
  letter-spacing: .03em;
  transform: skew(-8deg);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 4px 16px rgba(244, 196, 48, 0.28),
    0 1px 3px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand-text, .brand > span:last-child:not(.brand-mark) {
  font-size: 1.05rem;
  letter-spacing: .22em;
  color: var(--ink);
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  opacity: .96;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 1.4rem 0;
  text-align: center;
}

.screen.is-active { display: flex; }
.screen[aria-hidden="true"] { visibility: hidden; }
.screen-preview { justify-content: flex-start; padding-top: 1rem; }

h1 {
  margin: .3rem 0 .9rem;
  font-family: Anton, Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.55rem, 12vw, 4rem);
  line-height: .94;
  letter-spacing: .015em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.eyebrow {
  margin: .5rem 0;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(244, 196, 48, 0.35);
}

.subline {
  max-width: 23rem;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: .95rem;
}

.status {
  min-height: 1.35rem;
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.4;
}
.status.is-error { color: #ff8b80; }
.status.is-good { color: #74de9b; }
.status.is-syncing {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--gold);
}
.status.is-syncing::before {
  content: "";
  display: inline-block;
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: status-sync-pulse 1.4s ease-in-out infinite;
}
@keyframes status-sync-pulse {
  0%, 100% { transform: scale(.85); opacity: .55; }
  50% { transform: scale(1.15); opacity: 1; }
}

.install-card {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: .45rem .75rem;
  align-items: center;
  margin-top: 1.15rem;
  padding: .85rem;
  text-align: left;
  border: 1px solid rgba(244,196,48,.24);
  border-radius: .75rem;
  background: rgba(23,23,26,.82);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.install-card[hidden] { display: none; }
.install-icon { width: 3rem; height: 3rem; border-radius: .75rem; }
.install-copy { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.install-copy strong { font-family: Anton, Impact, sans-serif; letter-spacing: .08em; color: var(--gold); }
.install-copy span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.install-button {
  grid-column: 1 / -1;
  min-height: 2.75rem;
  padding: .65rem 1rem;
  border: 1px solid rgba(255,240,163,.35);
  border-radius: .55rem;
  color: #100f08;
  background: var(--gold);
  font-weight: 900;
  letter-spacing: .045em;
  cursor: pointer;
}
.install-button:disabled { opacity: .6; cursor: wait; }
.install-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ios-install-help {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .7rem;
  border-radius: .5rem;
  color: var(--ink);
  background: rgba(255,255,255,.06);
  font-size: .78rem;
  line-height: 1.45;
}
.ios-install-help[hidden] { display: none; }
.install-status { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.install-status:empty { display: none; }
.install-status.is-good { color: #74de9b; }
.install-status.is-error { color: #ff8b80; }

.camera-orbit {
  width: 7.8rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-self: center;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(244,196,48,.45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(244,196,48,0.14) 0%, rgba(20,20,24,0.75) 70%, rgba(13,13,15,0.92) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 1px rgba(255,240,163,0.35),
    inset 0 0 16px rgba(244,196,48,0.12),
    0 0 0 6px rgba(244,196,48,0.06),
    0 0 0 14px rgba(244,196,48,0.03),
    0 0 26px rgba(244,196,48,0.22),
    0 8px 30px rgba(0,0,0,0.6);
  animation: orbit-pulse 3.6s ease-in-out infinite alternate;
}

.camera-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(244,196,48,0.35));
}

@keyframes orbit-pulse {
  0% {
    box-shadow:
      inset 0 1px 1px rgba(255,240,163,0.35),
      inset 0 0 14px rgba(244,196,48,0.1),
      0 0 0 5px rgba(244,196,48,0.05),
      0 0 0 12px rgba(244,196,48,0.025),
      0 0 20px rgba(244,196,48,0.18),
      0 8px 26px rgba(0,0,0,0.6);
    transform: scale(1);
  }
  100% {
    box-shadow:
      inset 0 1px 2px rgba(255,240,163,0.5),
      inset 0 0 22px rgba(244,196,48,0.2),
      0 0 0 7px rgba(244,196,48,0.08),
      0 0 0 16px rgba(244,196,48,0.04),
      0 0 32px rgba(244,196,48,0.32),
      0 10px 34px rgba(0,0,0,0.7);
    transform: scale(1.02);
  }
}

.button {
  width: 100%;
  min-height: 3.75rem;
  margin-top: .75rem;
  padding: .85rem 1.2rem;
  border: 0;
  border-radius: .6rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.button[hidden] { display: none; }

.button:disabled {
  cursor: wait;
  opacity: .55;
  filter: grayscale(30%);
  transform: none !important;
  box-shadow: none !important;
}

.button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.button:active:not(:disabled) {
  transform: scale(0.98) translateY(2px);
}

.button-primary {
  color: #100f08;
  background: linear-gradient(180deg, #FFE885 0%, #F4C430 35%, #DAA520 85%, #B8860B 100%);
  border: 1px solid rgba(255, 240, 163, 0.4);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(139, 90, 0, 0.35),
    0 4px 0 #946900,
    0 8px 20px rgba(244, 196, 48, 0.32),
    0 2px 4px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.button-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 4px rgba(139, 90, 0, 0.35),
    0 4px 0 #946900,
    0 10px 24px rgba(244, 196, 48, 0.42),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

.button-primary:active:not(:disabled) {
  transform: scale(0.98) translateY(2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 2px 4px rgba(139, 90, 0, 0.4),
    0 2px 0 #946900,
    0 4px 10px rgba(244, 196, 48, 0.25);
}

.button-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(180deg, #2ED87B 0%, #15A856 70%, #0E7F3F 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 70, 30, 0.4),
    0 4px 0 #09592c,
    0 8px 22px rgba(37, 211, 102, 0.32),
    0 2px 4px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.button-whatsapp:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 70, 30, 0.4),
    0 4px 0 #09592c,
    0 10px 26px rgba(37, 211, 102, 0.42),
    0 2px 4px rgba(0, 0, 0, 0.5);
}

.button-whatsapp:active:not(:disabled) {
  transform: scale(0.98) translateY(2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 2px 4px rgba(0, 70, 30, 0.45),
    0 2px 0 #09592c,
    0 4px 10px rgba(37, 211, 102, 0.25);
}

.button-whatsapp > span:first-child { font-size: 1.45rem; line-height: 1; }
.button-whatsapp small { display: block; margin-top: .2rem; font-size: .78rem; font-weight: 700; letter-spacing: .01em; opacity: .95; text-transform: none; }

.button-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.button-secondary:active:not(:disabled) {
  transform: scale(0.98) translateY(2px);
  background: rgba(255, 255, 255, 0.02);
}

.preview-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: .25rem 0 .45rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: .75rem;
  background: radial-gradient(circle at 50% 50%, #1c1c22 0%, #111114 100%);
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.5),
    0 4px 20px rgba(0,0,0,0.4);
}

.preview-frame img { display: block; max-width: 100%; max-height: calc(100dvh - 16.5rem); object-fit: contain; }

.spinner {
  width: 3.4rem;
  aspect-ratio: 1;
  align-self: center;
  margin-bottom: 1.6rem;
  border: .25rem solid rgba(255,255,255,.1);
  border-top: .25rem solid var(--gold);
  border-right: .25rem solid rgba(244,196,48,.4);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(244,196,48,0.25);
  animation: spin .8s linear infinite;
}

.done-check {
  width: 6rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-self: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: #092413;
  background: linear-gradient(135deg, #6DF0A0 0%, #2ED87B 60%, #15A856 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.6),
    0 0 24px rgba(46,216,123,0.35),
    0 8px 24px rgba(0,0,0,0.5);
  font-size: 3rem;
  font-weight: 900;
}
.done-check.is-error {
  color: #fff;
  background: linear-gradient(135deg, #FF6B6B 0%, #D32F2F 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.5),
    0 0 24px rgba(211,47,47,0.35),
    0 8px 24px rgba(0,0,0,0.5);
}

.visually-hidden { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@keyframes spin { to { transform: rotate(1turn); } }

@media (max-height: 650px) {
  .camera-orbit { width: 5.3rem; margin-bottom: .7rem; }
  .camera-icon { width: 2.3rem; height: 2.3rem; }
  .screen { justify-content: flex-start; padding-top: 1rem; }
  h1 { font-size: 2.55rem; }
  .preview-frame img { max-height: calc(100dvh - 14rem); }
}

@media (orientation: landscape) and (max-height: 650px) {
  .light-shell { width: min(100%, 48rem); min-height: 100dvh; padding-top: .65rem; padding-bottom: .65rem; }
  .screen { overflow: auto; padding-top: .45rem; padding-bottom: .45rem; }
  .preview-frame img { max-height: calc(100dvh - 11rem); }
  .done-check { width: 4.25rem; margin-bottom: .45rem; font-size: 2.2rem; }
  .subline { margin-bottom: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .camera-orbit { animation: none; transform: none; }
  .spinner { animation: none; }
  .status.is-syncing::before { animation: none; }
  .button { transition: none; }
}
