/* SCORE MORE members portal — modern dark theme (AFM navy/red/gold). */
:root {
  --navy-900: #0a1424;
  --navy-800: #0f1d33;
  --navy-700: #16273f;
  --navy-600: #1d3252;
  --line: #25364f;
  --ink: #eef3fb;
  --ink-dim: #9fb0c9;
  --ink-faint: #6c7f9c;
  --red: #c8102e;
  --red-bright: #e4203f;
  --gold: #e8b84b;
  --gold-soft: #f1cd78;
  --ok: #36b37e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 600px at 70% -10%, #122546 0%, transparent 60%), var(--navy-900);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }
button { font-family: inherit; }
img { max-width: 100%; }

.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); }
.btn-gold { background: var(--gold); color: #2a1c00; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-block { width: 100%; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  font-weight: 900; letter-spacing: .5px; font-size: 20px; line-height: 1;
  text-transform: uppercase;
}
.brand .mark .score { color: #fff; }
.brand .mark .more { color: var(--red-bright); }
.brand .tag { font-size: 11px; color: var(--ink-faint); letter-spacing: 2px; text-transform: uppercase; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 410px; background: linear-gradient(180deg, var(--navy-800), var(--navy-700));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 30px;
}
.login-card .brand { justify-content: center; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.login-card .brand .mark { font-size: 30px; }
.login-card h1 { font-size: 17px; font-weight: 600; text-align: center; margin: 18px 0 4px; }
.login-card .sub { text-align: center; color: var(--ink-dim); font-size: 13.5px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--ink);
  background: var(--navy-900); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.field input:focus { outline: none; border-color: var(--gold); }
.form-msg { font-size: 13.5px; margin: 4px 0 14px; min-height: 18px; }
.form-msg.error { color: #ff8b9b; }
.form-msg.ok { color: var(--gold-soft); }
.login-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-faint); }

/* ---------- App shell ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 36, 0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .who { display: flex; align-items: center; gap: 14px; color: var(--ink-dim); font-size: 13.5px; }
.topbar .who .badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ok); border: 1px solid rgba(54,179,126,.4); border-radius: 999px; padding: 3px 9px;
}

.layout { display: grid; grid-template-columns: 280px 1fr; flex: 1; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto;
  background: rgba(15, 29, 51, 0.4);
}
.search { position: relative; margin-bottom: 18px; }
.search input {
  width: 100%; padding: 11px 12px 11px 36px; font-size: 14px; color: var(--ink);
  background: var(--navy-900); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.search input:focus { outline: none; border-color: var(--gold); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); opacity: .5; }

.side-title { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-faint); margin: 18px 6px 8px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  color: var(--ink-dim); padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px;
}
.nav-item:hover { background: var(--navy-700); color: var(--ink); }
.nav-item.active { background: var(--navy-600); color: #fff; }
.nav-item .ico { display: inline-flex; width: 18px; justify-content: center; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--ink-faint); background: rgba(0,0,0,.25); border-radius: 999px; padding: 1px 8px; }
.nav-item.active .count { color: var(--gold-soft); }

/* ---------- Main / content ---------- */
.main { padding: 22px 26px 60px; overflow-y: auto; }
.main-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.main-head h2 { font-size: 20px; margin: 0; }
.main-head .meta { color: var(--ink-faint); font-size: 13px; }

.group { margin-top: 26px; }
.group-title { font-size: 13px; color: var(--gold-soft); font-weight: 600; letter-spacing: .3px;
  border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 14px; }
.group-title .crumb { color: var(--ink-faint); font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  text-align: left; background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start;
  transition: border-color .15s ease, transform .06s ease, background .15s ease;
}
.card:hover { border-color: var(--gold); background: var(--navy-700); }
.card:active { transform: translateY(1px); }
.card .thumb {
  flex: 0 0 46px; height: 46px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--navy-600); color: var(--ink);
}
.card .thumb.video { background: rgba(200,16,46,.18); color: #ff9aa8; }
.card .thumb.pdf { background: rgba(232,72,72,.16); color: #ff9a9a; }
.card .thumb.slides { background: rgba(232,184,75,.16); color: var(--gold-soft); }
.card .thumb.doc { background: rgba(75,140,232,.16); color: #9cc0ff; }
.card .thumb.sheet { background: rgba(54,179,126,.16); color: #79e3b6; }
.card .c-body { min-width: 0; flex: 1; }
.card .c-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .c-sub { margin-top: 6px; font-size: 12px; color: var(--ink-faint); display: flex; gap: 8px; align-items: center; }
.type-badge { text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--ink-dim); }

.empty { text-align: center; color: var(--ink-faint); padding: 70px 20px; }
.empty svg { opacity: .4; margin-bottom: 12px; }

/* ---------- Viewer modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(4, 9, 18, 0.78); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal {
  width: 100%; max-width: 960px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .crumb { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.modal-close { background: transparent; border: none; color: var(--ink-dim); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 0; overflow: auto; background: #000; }
.modal-body.pad { padding: 30px; background: var(--navy-800); }
.modal-body video { width: 100%; max-height: 70vh; display: block; background: #000; }
.modal-body iframe { width: 100%; height: 74vh; border: 0; background: #fff; }
.download-pane { text-align: center; padding: 20px; color: var(--ink-dim); }
.download-pane .big-ico { margin-bottom: 14px; }
.download-pane p { margin: 6px 0 20px; }

.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Denied (logged in, no purchase) ---------- */
.denied-wrap { display: grid; place-items: center; padding: 40px 24px; flex: 1; }
.denied-card { max-width: 480px; text-align: center; background: var(--navy-800);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 30px; box-shadow: var(--shadow); }
.denied-card .lock { color: var(--gold); margin-bottom: 14px; }
.denied-card h2 { margin: 0 0 10px; font-size: 22px; }
.denied-card p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; margin: 0 0 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); max-height: 42vh; }
  .topbar .tag { display: none; }
}
