/* Paragon Windows training portal. Brand values taken from goparagonwindows.com */
:root {
  --navy: #010d3b;
  --navy-2: #0a1a55;
  --cyan: #00dfdf;
  --teal: #00bfbf;
  --blue: #009cfe;
  --ink: #0a0c1a;
  --muted: #4d5566;
  --soft: #8a93a6;
  --bg: #f7fbfd;
  --bg-2: #f4f5fa;
  --line: #e3e8ef;
  --white: #fff;
  --green: #0f9d6b;
  --amber: #c27a00;
  --red: #d43c3c;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(1, 13, 59, 0.06), 0 8px 24px rgba(1, 13, 59, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--navy); margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border-radius: var(--radius); border: 1px solid transparent;
  padding: 10px 18px; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--cyan); color: #000; }
.btn-accent:hover { background: #2ee9e9; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c9c9; }
.btn-danger:hover { background: #fdf3f3; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 13px 18px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: var(--radius);
  width: 30px; height: 30px; cursor: pointer; font-size: 14px; line-height: 1;
}
.icon-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Forms */
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input[type='text'], input[type='email'], input[type='password'], input[type='url'], input[type='search'], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 156, 254, 0.15); }
.field { margin-bottom: 16px; }
.field-hint { font-size: 12px; color: var(--soft); margin-top: 5px; }
.alert { border-radius: var(--radius); padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fdf0f0; color: #a02020; border: 1px solid #f3cccc; }
.alert-ok { background: #e9fbf4; color: #0a6b49; border: 1px solid #bfeedd; }
.alert-info { background: #eef7ff; color: #0b4f86; border: 1px solid #cfe6fb; }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { height: 40px; display: block; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: 0.04em; color: var(--navy); }
.logo-text span { color: var(--teal); }
.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  display: flex; align-items: center; padding: 0 14px; font-weight: 600; color: var(--muted);
  border: 0; border-bottom: 3px solid transparent; border-top: 3px solid transparent; background: none; cursor: pointer; font: inherit; font-weight: 600;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--cyan); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* Cards, pills, bars */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-done { background: #e3f8ef; color: #0a6b49; }
.pill-progress { background: #e6f4ff; color: #0b5ea3; }
.pill-new { background: var(--bg-2); color: var(--muted); }
.pill-warn { background: #fff4de; color: #8a5600; }
.pill-off { background: #f3e5e5; color: #8f2c2c; }
.pill-admin { background: var(--navy); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 3px rgba(15, 157, 107, 0.18); }
.bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--cyan)); transition: width 0.4s; }
.bar.done > i { background: var(--green); }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-brand {
  background: radial-gradient(1200px 600px at -10% -10%, rgba(0, 223, 223, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0, 156, 254, 0.25), transparent 60%), var(--navy);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-brand h1 { color: #fff; font-size: 44px; letter-spacing: -0.01em; max-width: 480px; }
.auth-brand h1 em { font-style: normal; color: var(--cyan); }
.auth-brand p.lead { color: rgba(247, 251, 253, 0.8); font-size: 17px; max-width: 440px; margin-top: 16px; }
.auth-steps { display: grid; gap: 14px; margin-top: 36px; max-width: 440px; }
.auth-step { display: flex; gap: 14px; align-items: flex-start; }
.auth-step b {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--cyan); color: var(--cyan);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.auth-step span { color: rgba(247, 251, 253, 0.92); padding-top: 4px; }
.auth-panes { position: absolute; right: -60px; bottom: -60px; width: 300px; height: 300px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; opacity: 0.14; transform: rotate(8deg); }
.auth-panes i { border: 2px solid #fff; border-radius: 8px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .logo { height: 52px; margin-bottom: 36px; }
.auth-box h2 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.auth-foot { margin-top: 22px; font-size: 14px; color: var(--muted); text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--blue); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* ---------- Rep: training home ---------- */
.hero { background: var(--navy); color: #fff; padding: 36px 0 84px; }
.hero h1 { color: #fff; font-size: 32px; }
.hero p { color: rgba(247, 251, 253, 0.78); margin-top: 6px; }
.hero-card { margin-top: -56px; padding: 22px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring::before { content: ''; grid-area: 1 / 1; width: 60px; height: 60px; border-radius: 50%; background: #fff; }
.ring b { grid-area: 1 / 1; z-index: 1; font-size: 17px; color: var(--navy); }
.module { margin-top: 32px; }
.module-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.module-num { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.lesson {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 120px 24px; align-items: center; gap: 16px;
  padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none !important; cursor: pointer;
}
.lesson:first-child { border-top: 0; }
.lesson:hover { background: var(--bg); }
.lesson-idx { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); color: var(--navy); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.lesson.done .lesson-idx { background: var(--green); color: #fff; }
.lesson-title { font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--soft); font-size: 18px; }
@media (max-width: 760px) {
  .lesson { grid-template-columns: 40px minmax(0, 1fr) 24px; }
  .lesson .lesson-bar, .lesson .lesson-status { display: none; }
}

/* ---------- Rep: player ---------- */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding: 24px 0 60px; align-items: start; }
.player-frame { background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.player-frame video, .player-frame iframe, .player-frame > div { width: 100%; height: 100%; display: block; border: 0; }
.player-meta { padding: 20px 4px 0; }
.player-progress { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; }
.player-progress .bar { flex: 1; }
.playlist { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow: auto; }
.playlist-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.playlist-mod { padding: 12px 18px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.pl-item { display: flex; gap: 12px; align-items: center; padding: 10px 18px; cursor: pointer; border-left: 3px solid transparent; color: inherit; text-decoration: none !important; }
.pl-item:hover { background: var(--bg); }
.pl-item.current { background: #eefcfc; border-left-color: var(--cyan); }
.pl-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.pl-item.done .pl-check { background: var(--green); border-color: var(--green); }
.pl-item.partial .pl-check { border-color: var(--teal); }
.pl-title { font-size: 14px; font-weight: 600; color: var(--navy); line-height: 1.3; }
@media (max-width: 980px) {
  .player-layout { grid-template-columns: 1fr; }
  .playlist { position: static; max-height: none; }
}

/* ---------- Admin ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 20px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 30px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.accent { background: var(--navy); border-color: var(--navy); }
.stat.accent b { color: var(--cyan); }
.stat.accent span { color: rgba(247, 251, 253, 0.8); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toolbar { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.toolbar input[type='search'] { max-width: 280px; padding: 8px 12px; }
.toolbar select { width: auto; padding: 8px 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.who b { display: block; color: var(--navy); font-weight: 600; }
.who small { color: var(--muted); }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.progress-cell .bar { flex: 1; }
.progress-cell b { width: 40px; text-align: right; font-size: 14px; color: var(--navy); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

.mod-card { margin-bottom: 18px; }
.mod-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.vid-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) 90px 190px 150px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.vid-row:last-child { border-bottom: 0; }
.src { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg-2); padding: 3px 8px; border-radius: 4px; }
@media (max-width: 900px) { .vid-row { grid-template-columns: 66px minmax(0, 1fr) 150px; } .vid-row .hide-sm { display: none; } }

/* Drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(1, 13, 59, 0.45); z-index: 50; display: flex; }
.drawer { margin-left: auto; width: min(560px, 100%); height: 100%; background: #fff; overflow: auto; box-shadow: -10px 0 40px rgba(1, 13, 59, 0.2); animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 22px 24px; background: var(--navy); color: #fff; }
.drawer-head h2 { color: #fff; }
.drawer-head .muted { color: rgba(247, 251, 253, 0.75); }
.drawer-body { padding: 22px 24px 40px; }
.drawer-section { margin-top: 26px; }
.drawer-section h3 { margin-bottom: 10px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.mini-stats b { display: block; font-size: 22px; color: var(--navy); }
.mini-stats span { font-size: 12px; color: var(--muted); }
.vprog { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.vprog b { text-align: right; color: var(--navy); }
.modal { margin: auto; width: min(520px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: 0 30px 80px rgba(1, 13, 59, 0.35); }
.modal h2 { margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.seg button { border: 0; background: #fff; padding: 8px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--navy); color: #fff; }
.copybox { display: flex; gap: 8px; margin-top: 8px; }
.copybox input { font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; z-index: 100; box-shadow: var(--shadow); }
.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ink); }

/* Small-screen polish */
.auth-box .logo-text { margin-bottom: 30px; font-size: 22px; }
.logo-text { white-space: nowrap; }
.hero-card > .grow { flex-basis: 220px; }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { gap: 10px; }
  .topbar .logo { height: 32px; }
  .topbar .logo-text { font-size: 15px; }
  .topbar a.btn-ghost { display: none; }
  .hero-card .btn { width: 100%; }
  h1 { font-size: 24px; }
  .mini-stats { grid-template-columns: 1fr; }
}
