/* Protocole Masculin – área de membros
   Mobile primeiro. Visual escuro e dourado, um único look (sem tema claro, por escolha). */
:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --line: #2a2a2e;
  --fg: #f4f1ea;
  --muted: #9a9aa2;
  --gold: #d7b614;
  --gold-soft: #f0d86a;
  --gold-deep: #8a6d07;
  --ok: #7fd08a;
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.wrap {
  max-width: 880px; margin: 0 auto; padding-block: 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h2 { font-size: 1.2rem; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.muted { color: var(--muted); font-size: .9rem; }

/* Cabeçalho */
.top { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; }
.top img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.top .who { flex: 1; min-width: 0; }
.top h1 { font-size: 1.25rem; line-height: 1.2; }

/* Botões e campos */
button { font: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
  color: #141100; font-weight: 700; border: 0; border-radius: 12px;
  padding: 13px 18px; min-height: 46px; width: 100%;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { width: auto; min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btn.ghost { background: none; color: var(--gold); border: 1px solid var(--line); font-weight: 600; }
.link { background: none; border: 0; color: var(--gold); padding: 8px 0; font-weight: 600; width: auto; }
input[type="email"] {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-height: 48px;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Login */
.login { min-height: calc(100dvh - 80px); display: grid; place-items: center; }
.login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 22px; text-align: center; display: grid; gap: 14px;
}
.login-card img { width: 112px; height: 112px; margin: 0 auto; border-radius: 24px; }
.login-card h1 { font-size: 1.7rem; }
.login-card form { display: grid; gap: 10px; text-align: left; }
#login-msg { min-height: 1.4em; margin: 0; }

/* Continuer */
.resume {
  display: grid; gap: 14px; padding: 18px; border-radius: 18px;
  background: radial-gradient(120% 140% at 0% 0%, #2b2406 0%, var(--surface) 60%);
  border: 1px solid #3a3210;
}
.resume h2 { font-size: 1.35rem; }
.resume .btn { width: auto; justify-self: start; }

/* Progresso */
.progress { margin-top: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); }
.progress-row strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.bar { height: 8px; margin-top: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-soft)); transition: width .4s ease; }

/* Lições */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
#modules { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.module.done { border-color: #254b2c; }
.module-head {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: none; border: 0; color: inherit; text-align: left; padding: 14px 16px; min-height: 64px;
}
.num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums;
}
.module.done .num { background: #17301b; color: var(--ok); }
.module-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pill { font-size: .72rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.module.done .pill { color: var(--ok); border-color: #254b2c; }
.module-body { padding: 0 16px 16px; display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.module-body p { margin: 0; color: var(--muted); white-space: pre-line; }
.module-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.module-actions .btn { flex: 1 1 180px; }

/* Rodapé e instalação */
.footer { margin-top: 32px; display: grid; gap: 12px; }
.install { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; }
.install p { margin: 0; }

/* Telas largas */
@media (min-width: 720px) {
  .wrap { padding-block: 28px 64px; }
  .resume { grid-template-columns: 1fr auto; align-items: center; padding: 24px 28px; }
  .resume .btn { justify-self: end; }
  #modules { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== Vitrine de produtos ===== */
.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.pcard { width: 100%; height: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; color: inherit; display: grid; gap: 10px; align-content: start; }
.pcard:hover { border-color: #3a3210; }
.pcard .cover { aspect-ratio: 3 / 4; background: #000; border-radius: 10px; overflow: hidden; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.pcard .cover.fit img { object-fit: contain; }
.pcard h3 { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; padding: 0 4px; }
.pcard .info { padding: 0 4px 4px; }
.pcard .meta { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .bar { margin-top: 6px; height: 6px; }
.pcard .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 99px; }

/* ===== Página do produto ===== */
.back { margin-bottom: 8px; }
.phead { display: grid; gap: 4px; margin-bottom: 14px; }
.phead h2 { font-size: 1.5rem; }
.phead .row { display: flex; gap: 14px; align-items: center; }
.phead .pcover { width: 72px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #000; flex: none; }
.phead .pcover img { width: 100%; height: 100%; object-fit: cover; }
.mthumb { width: 56px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #000; flex: none; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; }
.mcount { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.clist { list-style: none; margin: 0; padding: 0; display: grid; }
.crow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.crow .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-size: .72rem; font-weight: 700; }
.crow.done .ico { background: #17301b; color: var(--ok); }
.crow .ctitle { min-width: 0; overflow-wrap: anywhere; background: none; border: 0; color: inherit; text-align: left; padding: 0; }
.crow .soon { display: block; font-size: .75rem; color: var(--muted); }
.crow .tick { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 6px 12px; min-height: 36px; font-size: .8rem; white-space: nowrap; }
.crow.done .tick { color: var(--ok); border-color: #254b2c; }

/* ===== Player dentro do app ===== */
.player { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.player-inner { max-width: 520px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.player-bar h2 { font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.frame { position: relative; margin: 0 auto; aspect-ratio: 9 / 16; width: min(100%, 360px, calc(78dvh * 9 / 16)); background: #000; border-radius: 14px; overflow: hidden; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player-nav .btn { width: 100%; }
@media (min-width: 720px) { .shelf { grid-template-columns: repeat(3, 1fr); } }

/* ===== Leitor de PDF dentro do app ===== */
.doc-inner { max-width: 780px; }
.doc-pages { display: grid; gap: 12px; }
.doc-pages .page { width: 100%; background: var(--surface); border-radius: 8px; overflow: hidden; aspect-ratio: 210 / 297; }
.doc-pages .page.ready { aspect-ratio: auto; background: #fff; }
.doc-pages canvas { display: block; width: 100%; height: auto; }
.doc-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }


/* ===== Fluxo de aulas: cartão "continuar", ação fixa, tela de fim ===== */
.resume { grid-template-columns: auto 1fr; align-items: center; }
.resume-cover { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #000; }
.resume-info { min-width: 0; }
.resume-info h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.resume-info .muted { margin: 4px 0 0; }
.resume .btn { grid-column: 1 / -1; width: 100%; }
@media (min-width: 720px) {
  .resume { grid-template-columns: auto 1fr auto; }
  .resume .btn { grid-column: auto; width: auto; }
}
.crow.next { background: rgba(215, 182, 20, .07); }
.crow.next .ico { box-shadow: 0 0 0 2px var(--gold); color: var(--gold-soft); }
.crow .state { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.crow.next .state { color: var(--gold); font-weight: 600; }
.crow.done .state { color: var(--ok); }
.crow .ctitle { cursor: pointer; }
.crow .ctitle:hover { color: var(--gold-soft); }

.player-head { min-width: 0; }
.player-head .eyebrow { margin-bottom: 2px; }
.actions {
  position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}
.actions .btn { min-height: 52px; }
.actions .btn.ghost { padding-inline: 18px; }
.actions .btn:only-child { grid-column: 1 / -1; }
#doc-done.ready { animation: nudge 1.6s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: scale(1.03); } }

.after { display: grid; place-items: center; min-height: 60dvh; }
.after-card { width: 100%; max-width: 420px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.after-card h3 { font-size: 1.5rem; }
.after-card .check {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700;
  color: #141100; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); animation: pop .35s ease-out;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.next-item {
  width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit;
}
.next-item .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-size: .75rem; font-weight: 700; }
.next-txt { display: grid; min-width: 0; }
.next-txt strong { overflow-wrap: anywhere; }
.next-txt small { color: var(--muted); overflow-wrap: anywhere; }
.after-actions { width: 100%; display: grid; gap: 10px; }
.countdown { margin: 0; color: var(--gold-soft); font-variant-numeric: tabular-nums; font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .after-card .check, #doc-done.ready { animation: none; } }

/* ===== Avatar, busca, progresso geral ===== */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; padding: 0;
  display: grid; place-items: center; background: var(--surface-2); color: var(--gold);
  border: 1px solid var(--line); font-weight: 700; font-size: 1.05rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 96px; height: 96px; font-size: 2rem; border: 2px solid var(--gold); }
.global { margin-top: 14px; }
.search { position: relative; margin: 2px 0 14px; }
.search input {
  width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 44px 12px 18px; min-height: 48px; -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--fg); border: 0; font-size: 1.2rem; line-height: 1; }
.results { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.result { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; }
.result:hover { border-color: #3a3210; }
.result .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-size: .72rem; font-weight: 700; }
.result .rt { display: grid; min-width: 0; }
.result .rt strong { overflow-wrap: anywhere; }
.result .rt small { color: var(--muted); overflow-wrap: anywhere; }
.result .rs { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.result.is-done .rs { color: var(--ok); }
.no-results { color: var(--muted); text-align: center; padding: 18px 0; }
.searching #home, .searching #product { display: none; }
.link.inline { padding: 0; }

/* ===== Suporte flutuante e popups ===== */
.fab {
  position: fixed; z-index: 20; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  display: inline-flex; gap: 8px; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; font-weight: 700;
  color: #141100; background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep)); box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.fab span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #141100; color: var(--gold); font-size: .8rem; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); overflow-y: auto; }
.modal-card { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { font-size: 1.3rem; }
.modal-actions { display: grid; gap: 10px; }
.modal-card .muted { margin: 0; }
.support-mail { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px dashed #3a3210; color: var(--gold-soft); font-weight: 600; overflow-wrap: anywhere; user-select: all; text-align: center; }
a.btn { text-decoration: none; }
.avatar-edit { display: grid; justify-items: center; gap: 8px; }
.field { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.field input, .field select {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
.field input:disabled { opacity: .6; }
.phone { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px; }
.phone select { padding-inline: 10px; text-overflow: ellipsis; }
input[type="tel"], input[type="text"], input[type="date"] { color-scheme: dark; }
