﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --accent: #6D3DF5;
  --accent2: #8B5CF6;
  --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  --bg: #ffffff;
  --bg2: #F6F4FA;
  --bg3: #CFC9DC;
  --text: #171522;
  --text2: #625D70;
  --border: #ECE9F2;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Manrope', 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
  --lima: #D7FF64;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 45px rgba(0,0,0,0.04);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: fixed;
  inset: 0;
  bottom: var(--safe-b);
  top: var(--safe-t);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
.screen.active { display: flex; }
#screen-home.active { justify-content: center; }

/* ── HOME SCREEN ──────────────────────────────────────────── */
.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.home-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  animation: homeOrbFloat 20s infinite alternate ease-in-out;
}
.home-orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(37,99,235,0.5) 0%, transparent 70%);
  top: -15%; left: -15%;
}
.home-orb-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(124,58,237,0.45) 0%, transparent 70%);
  bottom: -10%; right: -10%;
  animation-delay: -8s;
}
@keyframes homeOrbFloat {
  0% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
  100% { transform: translate(-10px, 15px); }
}
.home-hero {
  position: relative; z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 1.5rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.app-logo {
  width: 80px; height: 80px;
  background: var(--accent-grad);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
  overflow: hidden;
}
.app-logo svg { width: 40px; height: 44px; stroke: white; }
.app-logo img { width: 80px; height: 80px; object-fit: contain; }

/* ── Hero icon — idêntico à landing page ─────────────────────────────── */
.hero-icon { margin-bottom: 36px; position: relative; display: inline-block; }
.hero-icon svg { filter: drop-shadow(0 0 28px rgba(124,58,237,0.5)); display: block; }
.scan-line { position: absolute; left: 14px; right: 14px; height: 2px; background: linear-gradient(90deg,transparent,rgba(124,58,237,0.9),transparent); top: 0; animation: scanDown 2.8s ease-in-out infinite; }
@keyframes scanDown { 0%,100% { top: 5%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 50% { top: 88%; } }
.pulse-ring { position: absolute; top: 50%; left: 50%; width: 130px; height: 130px; margin: -65px 0 0 -65px; border: 2px solid rgba(124,58,237,0.25); border-radius: 50%; animation: pulse 3s ease-out infinite; }
.pulse-ring:nth-child(2) { animation-delay: 1.2s; }
@keyframes pulse { 0% { transform: scale(0.75); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.hero-icon img, #app-logo { animation: logoPulse 2.4s ease-in-out infinite; }
@keyframes logoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.home-hero h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.home-hero p { color: var(--text2); margin-top: .75rem; font-size: .95rem; line-height: 1.6; font-weight: 400; }

.home-stats { position: relative; z-index: 1; display: flex; justify-content: center; padding: 0 2rem 1.5rem; }
.stat-pill { background: var(--bg2); border-radius: 50px; padding: .65rem 1.5rem; font-size: .88rem; color: var(--text2); font-weight: 600; border: 1.5px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-pill span { font-weight: 800; color: var(--accent); }

.btn-main {
  position: relative; z-index: 1;
  margin: 0 24px 16px;
  padding: 1.15rem 1.75rem;
  background: var(--accent-grad);
  color: white; border: none; border-radius: 18px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  -webkit-appearance: none;
  font-family: var(--font);
}
.btn-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
  filter: brightness(1.04);
}
.btn-main:active { transform: translateY(0) scale(.98); filter: brightness(.96); }
.btn-main svg { width: 22px; height: 22px; flex-shrink: 0; }
.home-hint { position: relative; z-index: 1; text-align: center; color: var(--text2); font-size: .8rem; padding: 0 2.5rem .75rem; font-weight: 400; }
.dev-credit { position: relative; z-index: 1; text-align: center; color: var(--text2); font-size: .72rem; font-weight: 400; opacity: .55; padding: .5rem 1.5rem 1rem; }
.dev-credit span { color: var(--accent2); font-weight: 500; }

.terms-link {
  position: relative; z-index: 1;
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: .8rem;
  text-decoration: none;
  font-weight: 500;
  padding: .5rem 2rem calc(2rem + var(--safe-b));
  font-family: inherit;
  transition: color .2s;
}
.terms-link:hover { color: var(--accent2); }

/* ── MODALS & OVERLAYS ────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal.hidden { display: none; }
.modal-inner {
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  width: 100%; max-height: 93vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .4s cubic-bezier(.16, 1, .3, 1);
}
.modal-inner.full {
  height: 100dvh; max-height: 100dvh;
  border-radius: 0;
  display: flex; flex-direction: column;
}
.modal-inner.dark { background: #000; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle { width: 44px; height: 5px; background: var(--border); border-radius: 100px; margin: 12px auto 4px; }
.modal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem 1.1rem;
  border-bottom: 1.5px solid var(--border);
}
.modal-topbar h3 { font-size: 1.1rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%; border: none;
  background: var(--bg2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all .2s;
}
.btn-icon:hover { background: var(--border); transform: scale(1.05); }
.btn-icon svg { width: 18px; height: 18px; }
.close-abs { position: absolute; top: calc(16px + var(--safe-t)); left: 16px; z-index: 10; }
.close-abs.white { background: rgba(255,255,255,.2); color: white; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.close-abs.white:hover { background: rgba(255,255,255,.3); }

/* ── CAMERA ───────────────────────────────────────────────── */
#modal-camera { background: #000; align-items: stretch; backdrop-filter: none; -webkit-backdrop-filter: none; }
.cam-area { position: relative; width: 100%; flex: 1; min-height: 0; background: #000; overflow: hidden; }
#selfie-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-oval { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index:2; }
.face-oval::after {
  content: '';
  width: 65%; aspect-ratio: .72;
  border: 2px dashed rgba(255,255,255,.75);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
}
.cam-bottom { position:absolute; bottom:0; left:0; right:0; padding: 2rem 2rem calc(2.5rem + var(--safe-b)); display: flex; align-items: center; justify-content: space-between; z-index:10; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); }
.cam-hint { color: rgba(255,255,255,.95); font-size: .88rem; font-weight:700; text-align: center; width: 80px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.shutter-btn { width: 86px; height: 86px; border-radius: 50%; border: 4px solid rgba(255,255,255,.8); background: rgba(255,255,255,0.25); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s cubic-bezier(.16, 1, .3, 1); }
.shutter-btn:hover { background: rgba(255,255,255,0.35); transform: scale(1.05); }
.shutter-btn:active { transform: scale(.93); }
.shutter-inner { width: 66px; height: 66px; border-radius: 50%; background: white; transition: transform .15s; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.shutter-btn:active .shutter-inner { transform: scale(.9); }

/* ── RESULTS ──────────────────────────────────────────────── */
.selfie-row { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1.5rem .75rem; }
.selfie-thumb { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent2); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2); }
.selfie-label { margin-top: .5rem; background: var(--accent-grad); color: white; font-size: .78rem; font-weight: 800; padding: .25rem .9rem; border-radius: 50px; box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15); }
.results-body { padding: 1rem 1.5rem 3rem; }
.results-empty { text-align: center; padding: 4.5rem 1.5rem; color: var(--text2); }
.results-empty svg { width: 48px; height: 48px; margin-bottom: 1.25rem; opacity: .25; display: block; margin-inline: auto; stroke: var(--text2); }
.results-empty p { font-weight: 600; font-size: .95rem; }

.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.res-card { border-radius: 20px; overflow: hidden; cursor: pointer; position: relative; box-shadow: var(--shadow-sm); border: 1.5px solid var(--border); transition: all .25s cubic-bezier(.16, 1, .3, 1); }
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent2); }
.res-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.conf-badge { position: absolute; bottom: 8px; left: 8px; right: 8px; background: rgba(15, 23, 42, 0.65); color: white; font-size: .75rem; font-weight: 800; padding: .3rem .6rem; border-radius: 10px; text-align: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ── PHOTO VIEWER ─────────────────────────────────────────── */
.photo-full { width: 100%; height: 100dvh; object-fit: contain; display: block; }
.photo-cap { position: fixed; bottom: 0; left: 0; right: 0; padding: 1.5rem 2rem calc(2rem + var(--safe-b)); background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%); color: white; font-size: .95rem; text-align: center; font-weight: 650; }

/* ── TERMS & CONDITIONS ────────────────────────────────────── */
.terms-modal-inner {
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  width: 100%; max-height: 90vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.terms-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1.5px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 2;
}
.terms-header-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--accent-grad);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(124,58,237,0.2);
}
.terms-modal-header h3 { font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.terms-modal-header p { font-size: .78rem; color: var(--text2); font-weight: 400; margin-top: .1rem; }
.terms-modal-header > div { flex: 1; }
.terms-close-btn { margin-left: auto; flex-shrink: 0; }
.terms-simple-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  position: sticky; top: 0; background: var(--bg); z-index: 2;
  border-bottom: 1.5px solid var(--border);
}
.terms-simple-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.terms-body { padding: 1.25rem 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.terms-section {
  padding: .25rem 0;
}
.terms-section-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.6; }
.terms-body h4 { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.terms-body p { font-size: .85rem; color: var(--text2); line-height: 1.6; font-weight: 400; }
.terms-body strong { color: var(--text); font-weight: 600; }
.terms-footer { padding: 1rem 1.5rem calc(1.5rem + var(--safe-b)); border-top: 1.5px solid var(--border); background: var(--bg); }
.terms-footer .btn-main { margin: 0; width: 100%; }

/* ── LOADING OVERLAY ──────────────────────────────────────── */
.loading-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 999; gap: 1.5rem; }
.loading-overlay.hidden { display: none; }
.loader-ring, .spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--accent2); border-radius: 50%; animation: spin .85s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p, .loading-box p { color: var(--text); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.loading-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; }

.hidden { display: none !important; }

/* Titulos em Manrope, interface em Inter — identidade v1.0 */
h1, h2, h3, h4, .wiz-title, .wiz-step-title,
.modal-topbar h3, .terms-modal-header h3, .terms-simple-header h3 {
  font-family: var(--font-display);
}
