:root {
  --bg-from: #15151C;
  --bg-to: #312E81;
  --header: #a80f42;
  --nav: #c15a7c;
  --name: #bf5e7d;
  --button: #1A73E8;
  --card: #1f1f29;
  --card-2: #262633;
  --text: #f3f1f6;
  --muted: #a5a2b3;
  --line: rgba(255,255,255,.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #15151C;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
img { display: block; max-width: 100%; }
.boot { min-height: 100vh; background: linear-gradient(160deg, var(--bg-from), var(--bg-to)); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-bottom));
  background: linear-gradient(160deg, var(--bg-from), var(--bg-to));
}
.login-card {
  width: 100%; max-width: 380px; padding: 28px 24px;
  background: rgba(30, 30, 40, .78); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(10px); text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.install-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  background: var(--button); color: #fff; border-radius: 10px; font-weight: 600; font-size: 15px;
}
.install-btn svg { width: 18px; height: 18px; }
.login-logo { width: 92px; height: 92px; border-radius: 20px; margin: 22px auto 14px; object-fit: cover; }
.login h1 { margin: 0; font-size: 22px; }
.login p.sub { margin: 8px 0 22px; color: var(--muted); font-size: 15px; }
.field {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px;
}
.field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; }
.field input::placeholder { color: var(--muted); }
.primary {
  width: 100%; height: 50px; margin-top: 14px; border-radius: 12px;
  background: var(--button); color: #fff; font-weight: 700; font-size: 16px;
}
.primary:disabled { opacity: .6; }
.error { margin: 12px 0 0; color: #ff8fa8; font-size: 14px; line-height: 1.4; }
.help { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.help a { color: var(--text); }

/* ---------- casca do app ---------- */
.shell { min-height: 100vh; background: linear-gradient(160deg, var(--bg-from), var(--bg-to)) fixed; padding-bottom: calc(76px + var(--safe-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: var(--header);
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
}
.topbar img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255,255,255,.16); position: relative;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.page { padding: 16px; max-width: 760px; margin: 0 auto; }

/* banners */
.banners { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--card); }
.banner-track { display: flex; height: 100%; transition: transform .45s ease; }
.banner-track > * { flex: 0 0 100%; height: 100%; }
.banner-track img { width: 100%; height: 100%; object-fit: cover; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.4); display: grid; place-items: center;
}
.banner-arrow.l { left: 8px; } .banner-arrow.r { right: 8px; }
.banner-arrow svg { width: 18px; height: 18px; }
.banner-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.banner-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); }
.banner-dots i.on { background: #fff; width: 18px; border-radius: 4px; }

.section-title { margin: 22px 2px 12px; font-size: 19px; font-weight: 700; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cinema { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.cinema .card { flex: 0 0 44%; scroll-snap-align: start; }
.card {
  position: relative; display: block; width: 100%; text-align: left; border-radius: 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
}
.card .cover { position: relative; aspect-ratio: 1; background: var(--card-2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 10px 12px; min-height: 52px; }
.card .label span { color: var(--name); font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .label b { flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.card .label b svg { width: 12px; height: 12px; }
.lock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,8,14,.55); }
.lock svg { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.lock small { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 600; }

.back { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 20px; background: rgba(255,255,255,.08); font-size: 14px; font-weight: 600; }
.back svg { width: 16px; height: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 18px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; width: 100%; }
.row .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--nav); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* conteúdo */
.reader { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #15151C; }
.reader-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 12px 10px; background: var(--header); }
.reader-bar h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader iframe { flex: 1; width: 100%; border: 0; background: #15151C; }
.reader .link-box { padding: 24px 16px; text-align: center; }

/* feed */
.post { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.post img { width: 100%; }
.post .in { padding: 14px; }
.post h3 { margin: 0 0 6px; font-size: 16px; }
.post p { margin: 0; color: #d9d6e2; line-height: 1.5; white-space: pre-wrap; font-size: 15px; }
.post time { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.post a.more { display: inline-block; margin-top: 12px; padding: 9px 14px; border-radius: 10px; background: var(--nav); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; line-height: 1.5; }

/* perfil */
.profile-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; }
.profile-card .avatar { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--nav); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.profile-card .mail { color: var(--muted); font-size: 14px; word-break: break-all; }
.menu { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; text-align: left; color: var(--text); text-decoration: none; font-size: 15px; }
.menu > * + * { border-top: 1px solid var(--line); }
.menu svg { width: 20px; height: 20px; color: var(--name); flex: none; }
.menu .grow { flex: 1; }
.menu .state { font-size: 13px; color: var(--muted); }

/* navegação inferior */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-bottom)); background: rgba(22,22,30,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 80px; font-size: 11px; color: var(--muted); }
.bottom-nav .ic { width: 44px; height: 32px; display: grid; place-items: center; border-radius: 16px; }
.bottom-nav svg { width: 21px; height: 21px; }
.bottom-nav .on { color: var(--text); }
.bottom-nav .on .ic { background: var(--nav); color: #fff; }

.fab {
  position: fixed; right: 16px; bottom: calc(86px + var(--safe-bottom)); z-index: 25; width: 52px; height: 52px; border-radius: 50%;
  background: var(--nav); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.4);
}
.fab svg { width: 22px; height: 22px; }

/* modal de instalação */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 600px) { .overlay { align-items: center; } }
.sheet {
  width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; background: #fff; color: #1b1b24;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom));
}
@media (min-width: 600px) { .sheet { border-radius: 20px; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.sheet .x { width: 32px; height: 32px; border-radius: 50%; background: #f0eef3; display: grid; place-items: center; flex: none; }
.sheet .x svg { width: 16px; height: 16px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; font-size: 15px; line-height: 1.45; }
.steps li > b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #eef3fe; color: var(--button); display: grid; place-items: center; font-size: 13px; }
.steps li.help-step > b { background: #fde8ef; color: #a80f42; }
.steps .ill { margin-top: 10px; border-radius: 14px; overflow: hidden; background: #f4f2f7; }
.steps .ill svg { display: block; width: 100%; height: auto; }
.steps a { color: #a80f42; font-weight: 700; overflow-wrap: anywhere; }
.note { margin-top: 14px; padding: 12px; border-radius: 12px; background: #fff6e6; color: #6b4a00; font-size: 14px; line-height: 1.45; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); z-index: 70; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #2b2b38; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.spinner { width: 30px; height: 30px; margin: 60px auto; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--nav); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
