:root {
  --blue-deep: #0b3d91;
  --blue: #2563eb;
  --blue-light: #eaf2ff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --amber: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #eaf2ff 0%, #ffffff 55%);
  color: var(--ink);
  min-height: 100vh;
}

/* ---- Auth pages (login/register/forgot/reset) ---- */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 56px 20px 80px; }
.auth-logo { text-align: center; font-weight: 800; font-size: 20px; color: var(--blue-deep); margin-bottom: 28px; }
.auth-logo a { color: inherit; text-decoration: none; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 32px; box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 10px 30px -12px rgba(37,99,235,.12);
}
.card h1 { font-size: 20px; margin: 0 0 4px; }
.card .subtitle { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; width: 100%;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }
.alert.error { background: var(--red-light); color: #991b1b; }
.alert.success { background: var(--green-light); color: #166534; }

.auth-links { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-links a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ---- Dashboard shell ---- */
.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--border);
}
.app-nav .brand { font-weight: 800; color: var(--blue-deep); text-decoration: none; font-size: 16px; }
.app-nav .links { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.app-nav .links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.app-nav .links a.active, .app-nav .links a:hover { color: var(--blue); }
.app-nav form.inline { display: inline; }
.app-nav button.link-btn {
  background: none; border: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 0;
}
.app-nav button.link-btn:hover { color: var(--red); }

.app-body { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }
.app-body h1 { font-size: 22px; margin: 0 0 4px; }
.app-body .muted { color: var(--muted); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 24px 0; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-card .value { font-size: 24px; font-weight: 800; margin-top: 6px; }

.avatar-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: #eaf2ff; }

/* ---- Video player ---- */
.player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player-notice { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #cbd5e1; gap: 8px; text-align: center; padding: 20px; }
.player-notice .icon { font-size: 32px; }
.player-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.player-error { background: rgba(0,0,0,.75); color: #fff; flex-direction: column; gap: 8px; pointer-events: auto; }
.player-error .icon { font-size: 28px; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: sh-spin 0.8s linear infinite; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
.player-center-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
}
.player-controls { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.75)); padding: 16px 12px 10px; }
.pc-progress { height: 5px; background: rgba(255,255,255,.25); border-radius: 999px; cursor: pointer; margin-bottom: 10px; }
.pc-progress-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 999px; }
.pc-row { display: flex; align-items: center; gap: 10px; }
.pc-btn { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.pc-time { color: #e2e8f0; font-size: 12px; font-variant-numeric: tabular-nums; }
.pc-spacer { flex: 1; }
.pc-volume { width: 70px; accent-color: var(--blue); }
.pc-speed { background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 6px; font-size: 12px; padding: 3px 4px; }
.pc-speed option { color: #000; }

/* ---- Ad slots ---- */
.ad-slot { text-align: center; }
.ad-slot:empty { display: none; }

/* ---- Pagination (shared across Video Saya, Wallet, etc.) ---- */
.pagination { display:flex; justify-content:center; gap:8px; margin-top:28px; font-size:13px; }
.pagination a, .pagination span { padding:6px 12px; border-radius:8px; text-decoration:none; color:var(--ink); }
.pagination a { border:1px solid var(--border); }
.pagination span.current { background:var(--blue); color:#fff; }
