/* VITALIS — fluid mobile-first layout */
:root {
  --bg: #07080a;
  --bg-2: #0c0e12;
  --card: #14161c;
  --line: rgba(212, 177, 90, 0.16);
  --gold: #d4b15a;
  --gold-2: #f0d78c;
  --text: #f6f1e6;
  --muted: #9b9488;
  --soft: #cfc6b6;
  --ok: #7dcaa0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: clamp(16px, 3vw, 22px);
  --safe-b: env(safe-area-inset-bottom, 16px);
  --safe-t: env(safe-area-inset-top, 12px);
  --nav-h: calc(72px + env(safe-area-inset-bottom, 10px));
  --pad: clamp(16px, 4vw, 28px);
  --max: 1080px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(16px, 2.4vw, 18px);
  line-height: 1.45;
}
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }
button { cursor: pointer; border: 0; }
h1, h2, h3, h4 { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -0.02em; margin: 0; }

#app {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(212,177,90,.14), transparent 55%),
    var(--bg);
}

.screen {
  display: none;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 8px) var(--pad) 28px;
}
.screen.active { display: block; animation: fade .28s ease; }
.screen.has-nav { padding-bottom: calc(var(--nav-h) + 20px); }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(14px, 3vw, 22px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(160deg, #1a1c22, #0b0c10);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--gold-2); font-family: Fraunces, serif; font-size: 22px; font-weight: 600;
}
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.brand b { font-size: 16px; font-weight: 600; }

.lang-switch {
  display: flex; gap: 4px; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px;
}
.lang-switch button {
  background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 700;
}
.lang-switch button.on { background: rgba(212,177,90,.16); color: var(--gold-2); }

.icon-btn {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--card); color: var(--gold-2);
  display: grid; place-items: center; font-size: 20px;
  border: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  gap: 12px;
}
.hero-card {
  position: relative; border-radius: 26px; overflow: hidden;
  min-height: 160px; margin-bottom: 16px; box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(7,8,10,.15), rgba(7,8,10,.82)),
    radial-gradient(circle at 30% 20%, rgba(212,177,90,.28), transparent 50%),
    #12141a;
}
.hero-card .overlay { padding: 18px 16px 16px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 160px; }
.kicker {
  color: var(--gold); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600; margin-bottom: 6px;
}
.hero-card h2 { font-size: clamp(22px, 5vw, 28px); line-height: 1.15; }

.card {
  background: linear-gradient(180deg, #171a21, #12141a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 20px);
  margin-bottom: 12px;
}
.card h3 { font-size: clamp(18px, 4vw, 22px); margin-bottom: 8px; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 160px; }

.btn {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 650;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-gold {
  background: linear-gradient(180deg, #f0d78c, #c49a3d);
  color: #1a1406;
  box-shadow: 0 10px 24px rgba(212,177,90,.28);
}
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-wa { background: #128c4a; color: #fff; }

.choice {
  width: 100%; text-align: left; background: var(--card);
  border: 1.5px solid var(--line); color: var(--text);
  border-radius: 18px; min-height: 60px; padding: 14px 16px;
  font-size: 17px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.choice.selected {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212,177,90,.12), rgba(212,177,90,.04));
}
.choice .tick { color: var(--gold-2); opacity: 0; }
.choice.selected .tick { opacity: 1; }

.field {
  width: 100%; min-height: 60px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--text); font-size: 20px; padding: 14px 16px; outline: none;
}
.field:focus { border-color: var(--gold); }

.progress-dots { display: flex; gap: 6px; margin: 6px 0 18px; }
.progress-dots span { height: 6px; flex: 1; border-radius: 99px; background: #2a2c33; }
.progress-dots span.on { background: var(--gold); }

.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(212,177,90,.15); color: var(--gold-2);
  font-weight: 700; flex-shrink: 0;
}

.ing {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.ing:last-child { border-bottom: 0; padding-bottom: 0; }
.ing span { color: var(--gold-2); font-weight: 650; white-space: nowrap; }

.mod {
  display: flex; gap: 14px; align-items: center;
  padding: 12px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
  margin-bottom: 10px; text-align: left; width: 100%; color: inherit;
}
.mod .thumb {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, rgba(212,177,90,.35), #1a1c22);
  display: grid; place-items: center; color: var(--gold-2); font-weight: 700;
}
.mod h4 { margin: 0 0 4px; font-size: 16px; font-family: Outfit, sans-serif; }
.mod p { margin: 0; color: var(--muted); font-size: 13.5px; }

.nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  width: min(100%, var(--max));
  bottom: 0; height: var(--nav-h);
  background: rgba(10,11,14,.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px var(--safe-b);
  z-index: 20;
}
.nav.show { display: grid; }
.nav button {
  background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
}
.nav button.on { color: var(--gold-2); }
.nav svg { width: 22px; height: 22px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(212,177,90,.12); color: var(--gold-2);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 650;
}
.chip {
  display: inline-block; background: #1f222b; border: 1px solid var(--line);
  color: var(--soft); border-radius: 999px; padding: 6px 10px; font-size: 13px; margin: 0 6px 6px 0;
}

.check-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.check-row input { width: 22px; height: 22px; margin-top: 3px; accent-color: #c49a3d; }
.article p { color: var(--soft); margin: 0 0 14px; }
.article h3 { font-size: 20px; margin: 18px 0 8px; }
.article ul { padding-left: 18px; color: var(--soft); }
.article li { margin: 0 0 8px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  aspect-ratio: 1; border-radius: 12px; background: #16181f;
  border: 1px solid rgba(255,255,255,.05);
  display: grid; place-items: center; font-size: 13px; color: var(--muted);
}
.cal-day.done { background: rgba(125,202,160,.16); color: var(--ok); border-color: transparent; }
.cal-day.today { border-color: var(--gold); color: var(--gold-2); }

.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(212,177,90,.22), transparent 42%),
    linear-gradient(180deg, #101218, #07080a);
  padding: 24px var(--pad) calc(28px + var(--safe-b));
}
.splash .logo-mark { width: 92px; height: 92px; border-radius: 24px; font-size: 42px; margin-bottom: 18px; }
.splash h1 { font-size: clamp(34px, 10vw, 44px); margin-bottom: 8px; }
.splash p { color: var(--soft); margin: 0 0 28px; }

.gen-wrap { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring {
  width: 86px; height: 86px; border-radius: 50%;
  border: 4px solid #2a2c33; border-top-color: var(--gold);
  animation: spin 1s linear infinite; margin-bottom: 22px;
}
.gen-line { color: var(--muted); min-height: 28px; animation: pulse 1.4s ease infinite; }

.warn-box {
  background: rgba(224,163,106,.08);
  border: 1px solid rgba(224,163,106,.28);
  color: #efd3b0; border-radius: 16px; padding: 14px; font-size: 14.5px; margin: 12px 0;
}

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 8px);
  max-width: 480px; margin: 0 auto;
  background: #22252e; color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; display: none; z-index: 40;
  text-align: center; box-shadow: var(--shadow);
}
#toast.show { display: block; animation: fade .2s ease; }

.back {
  background: none; color: var(--gold-2); font-size: 16px; font-weight: 650;
  padding: 8px 0 12px; display: inline-flex; align-items: center; gap: 6px;
}

.bar { height: 8px; background: #1a1d24; border-radius: 99px; overflow: hidden; margin: 0 0 16px; }
.bar > i { display: block; height: 8px; width: 0; background: linear-gradient(90deg,#f0d78c,#c49a3d); }

@media (min-width: 760px) {
  .screen.has-nav { padding: calc(var(--safe-t) + 16px) 28px calc(var(--nav-h) + 24px); }
  .grid-2 { grid-template-columns: 1.1fr .9fr; align-items: start; }
  .mods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mods-grid .mod { margin: 0; }
  .hero-card { min-height: 200px; }
  .hero-card .overlay { min-height: 200px; }
}

@media (min-width: 980px) {
  body { overflow: auto; }
  .nav { border-radius: 20px 20px 0 0; }
}
