/* Student login + My courses (students.html only). Builds on styles.css. */

.sp {
  --focus: var(--sky);
  min-height: 100vh; display: flex; flex-direction: column;
  color: var(--white);
  background: var(--slate-950) radial-gradient(120% 70vh at 80% 0%, #2A3E4A 0%, var(--slate-900) 55%, var(--slate-950) 100%) no-repeat;
}
.sp a:not(.btn) { color: var(--sky); }

/* Top bar */
.sp-top { position: relative; z-index: 2; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.sp-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sp-top__brand { display: block; padding: 4px 0; }
.sp-top__brand img { width: 108px; height: auto; }
.sp-top__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--white) !important; text-decoration: none; font-size: .9375rem; font-weight: 500; }
.sp-top__back:hover { color: var(--sky) !important; }
.sp-top__back svg, .sp-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Layout */
.sp-main { position: relative; isolation: isolate; overflow: hidden; flex: 1; padding: 28px 0 64px; }
.sp-main .shapes, .sp-main .grid-lines { z-index: -1; }
.sp-wrap { max-width: 1040px; }
.sp-preview { max-width: 560px; margin: 0 auto 20px; padding: 12px 14px; border: 1px dashed rgba(255,217,168,.6); border-radius: 12px; font-size: .875rem; color: var(--on-dark-2); }

/* Login card */
.sp-card { max-width: 560px; margin: 0 auto; padding: 28px 22px; border-radius: 24px; }
@media (min-width: 560px) { .sp-card { padding: 36px 36px 32px; } }
.sp-card__icon { width: 34px; height: 34px; margin-bottom: 16px; fill: none; stroke: var(--sky); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sp-h1 { color: var(--white); font-size: clamp(1.75rem, 5vw, 2.4rem); font-weight: 600; letter-spacing: -0.03em; margin-bottom: 10px; }
.sp-h1:focus { outline: none; }
.sp-h2 { color: var(--white); font-size: 1.1875rem; font-weight: 600; margin: 10px 0 8px; letter-spacing: -0.01em; }
.sp-lead { color: var(--on-dark-2); margin-bottom: 22px; }
.sp-lead strong { color: var(--white); }
.sp-small { margin: 18px 0 0; font-size: .875rem; color: var(--on-dark-2); }
.sp-muted { color: var(--on-dark-2); }

/* Phone / Email switch: real radio buttons, styled as a segmented control */
.sp-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 20px; padding: 4px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(12,20,24,.4); }
.sp-switch label { position: relative; }
.sp-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sp-switch span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 10px;
  font-weight: 600; font-size: .9375rem; color: var(--on-dark-2); transition: background-color .2s, color .2s;
}
.sp-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-switch input:checked + span { background: var(--sky); color: var(--sky-ink); }
.sp-switch input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Fields */
.sp-field { margin-bottom: 18px; }
.sp-field[hidden] { display: none; }
.sp-field > label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; color: var(--white); }
.sp-field input[type=tel], .sp-field input[type=email], .sp-code {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  font: 400 1.0625rem/1.3 var(--font); color: var(--white);
  background: rgba(12,20,24,.45); border: 1px solid rgba(255,255,255,.45);
}
.sp-field input::placeholder { color: #9FB0B9; opacity: 1; }
.sp-field input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 2px var(--sky); }
.sp-field input[aria-invalid="true"] { border-color: #FF9B8F; box-shadow: 0 0 0 1px #FF9B8F; }
.sp-code { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.sp-hint { margin: 6px 0 0; font-size: .8125rem; color: var(--on-dark-2); }
.sp-err { margin: 8px 0 0; font-size: .875rem; font-weight: 600; color: #FFB4AB; }
.sp-via { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; margin: 12px 0 0; padding: 0; border: 0; font-size: .9375rem; }
.sp-via legend { float: left; width: 100%; margin: 0; font-size: .875rem; color: var(--on-dark-2); }
.sp-via label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.sp-via input { width: 20px; height: 20px; margin: 0; accent-color: var(--sky); }
.sp-btn { width: 100%; }

.sp-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px 0 8px; padding: 0; border: 0; background: none; color: var(--sky); font: 600 .9375rem/1.2 var(--font); cursor: pointer; }
.sp-link:hover { text-decoration: underline; }
.sp-link--inline { margin: 0; vertical-align: middle; }

/* Dashboard */
.sp-dash__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sp-dash__head .sp-lead { margin: 0; }
.sp-courses { display: grid; gap: 18px; }
@media (min-width: 760px) { .sp-courses { grid-template-columns: repeat(3, 1fr); } }
.sp-course { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; }
.sp-video {
  position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; text-align: center; font-size: .8125rem; color: var(--on-dark-2);
  background: linear-gradient(150deg, var(--slate-800), var(--slate-950));
}
.sp-video svg { width: 44px; height: 44px; padding: 11px; border-radius: 50%; fill: var(--sky-ink); stroke: none; background: var(--sky); }
.sp-video--locked svg { fill: none; stroke: var(--white); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; background: rgba(255,255,255,.12); }
.sp-course__body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 18px 18px 20px; }
.sp-course__body p { color: var(--on-dark-2); font-size: .9375rem; }
.sp-course__body .btn { margin-top: auto; }
.sp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--white); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.sp-badge--paid { color: var(--sky-ink); background: var(--sky); border-color: var(--sky); }
.sp-pay { display: grid; gap: 8px; width: 100%; margin-top: auto; }
.sp-pay .btn { width: 100%; }
.sp-status { max-width: 640px; margin: 22px auto 0; padding: 14px 16px; border-radius: 12px; border-left: 4px solid var(--sky); background: rgba(12,20,24,.6); color: var(--white); }
.sp-status:focus { outline: none; }

/* ---------- Dashboard page (dashboard.html) ---------- */
.sp-signout { border: 0; background: none; cursor: pointer; font-family: var(--font); }
.sp-preview--wide { max-width: none; margin: 0 0 28px; }
.db-tabs { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.db-tabs::-webkit-scrollbar { display: none; }
.db-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--on-dark-2) !important; text-decoration: none; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.db-tabs a:hover { color: var(--white) !important; background: rgba(255,255,255,.08); }
.db-section { margin-bottom: 44px; scroll-margin-top: 16px; }
.db-h2 { color: var(--white); font-size: clamp(1.375rem, 3vw, 1.75rem); font-weight: 600; margin-bottom: 16px; }

.db-stats { display: grid; gap: 12px; }
@media (min-width: 640px) { .db-stats { grid-template-columns: repeat(3, 1fr); } }
.db-stats li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 14px; padding: 16px 18px; border-radius: 18px; box-shadow: none; }
.db-stats svg { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; fill: none; stroke: var(--sky); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; background: rgba(143,195,224,.12); }
.db-stats__n { font-size: 1.375rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.db-stats__l { font-size: .875rem; color: var(--on-dark-2); }

.db-player { display: grid; border-radius: 22px; overflow: hidden; }
@media (min-width: 900px) { .db-player { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.db-player__video { aspect-ratio: 16 / 9; }
.db-player__video svg { width: 60px; height: 60px; padding: 16px; }
.db-player__side { padding: 18px 18px 20px; }
.db-player__course { margin: 0 0 4px; font-weight: 600; color: var(--white); }
.db-player__now { margin: 0 0 14px; font-size: .9375rem; color: var(--on-dark-2); }
.db-player__now strong { color: var(--white); }
.db-progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.db-progress span { display: block; height: 100%; border-radius: inherit; background: var(--sky); }
.db-progress__txt { margin: 6px 0 14px; font-size: .8125rem; color: var(--on-dark-2); }
.db-lessons { display: grid; gap: 4px; }
.db-lessons button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--white); font: 500 .9375rem/1.3 var(--font); text-align: left; cursor: pointer;
}
.db-lessons button:hover { background: rgba(255,255,255,.07); }
.db-lessons button[aria-current] { background: rgba(143,195,224,.14); border-color: rgba(143,195,224,.5); }
.db-lessons svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--on-dark-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.db-lessons .is-done svg { stroke: var(--sky); }
.db-lessons button[aria-current] svg { fill: var(--sky); stroke: none; }
.db-lessons button > span:first-of-type { flex: 1; }
.db-more { margin: 8px 0 0 10px; font-size: .8125rem; color: var(--on-dark-2); }

.db-table { border-radius: 18px; overflow: hidden; box-shadow: none; }
.db-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.db-table th { padding: 12px 16px; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-2); border-bottom: 1px solid rgba(255,255,255,.14); }
.db-table td { padding: 12px 16px; color: var(--white); vertical-align: middle; }
@media (max-width: 639px) {
  .db-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .db-table tr { display: grid; gap: 4px; padding: 14px 16px; }
  .db-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
  .db-table td[data-label]::before { content: attr(data-label); color: var(--on-dark-2); font-size: .875rem; }
  .db-table td:last-child { padding-top: 8px; }
}

.db-acct { display: grid; gap: 14px; }
@media (min-width: 900px) { .db-acct { grid-template-columns: repeat(3, 1fr); } }
.db-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px; border-radius: 18px; box-shadow: none; }
.db-panel .sp-h2 { margin-top: 0; }
.db-panel p { margin: 0 0 10px; color: var(--white); font-size: .9375rem; }
.db-panel .btn { margin-top: auto; }
.db-prefs { margin: 0 0 12px; padding: 0; border: 0; }
.db-prefs legend { padding: 0; margin-bottom: 4px; }
.db-prefs label { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--white); cursor: pointer; }
.db-prefs input { width: 20px; height: 20px; margin: 0; accent-color: var(--sky); }
.db-help-link { margin-top: 8px; }
.db-toast { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: 16px; margin: 0 auto; max-width: 560px; box-shadow: 0 16px 40px rgba(0,0,0,.45); background: var(--slate-900); }

/* Footer */
.sp-foot { padding: 22px 0 28px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8125rem; color: var(--on-dark-2); background: var(--slate-950); }
.sp-foot p { margin: 0 0 6px; }

[data-step][hidden] { display: none; }
