/* Smart Online Trainer — Public Styles
   Palette: --sot-primary from Settings (default #6c63ff)
   WCAG 2.1 AA compliant contrast ratios throughout
*/

/* ── Reset & tokens ───────────────────────────────────────── */
.sot-public *,
.sot-public *::before,
.sot-public *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sot-primary:   #6c63ff;
  --sot-primary-d: #5a52d5;
  --sot-green:     #059669;
  --sot-red:       #dc2626;
  --sot-amber:     #d97706;
  --sot-navy:      #0f172a;
  --sot-surface:   #f8fafc;
  --sot-border:    #e5e7eb;
  --sot-muted:     #6b7280;
  --sot-text:      #111827;
  --sot-white:     #ffffff;
  --sot-radius:    10px;
  --sot-shadow:    0 2px 12px rgba(0,0,0,.08);
}

/* ── Registration Form ─────────────────────────────────────── */
.sot-reg-wrap {
  max-width: 480px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--sot-text);
}

.sot-form__group { margin-bottom: 18px; }

.sot-form__label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--sot-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.sot-form__input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--sot-border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--sot-text);
  background: var(--sot-white);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.sot-form__input:focus {
  outline: none;
  border-color: var(--sot-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.18);
}
.sot-form__input:invalid:not(:placeholder-shown) {
  border-color: var(--sot-red);
}

.sot-form__submit {
  width: 100%;
  padding: 13px;
  background: var(--sot-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  font-family: inherit;
}
.sot-form__submit:hover  { background: var(--sot-primary-d); }
.sot-form__submit:disabled { opacity: .6; cursor: not-allowed; }
.sot-form__submit:focus-visible {
  outline: 3px solid var(--sot-primary);
  outline-offset: 3px;
}

/* ── Session Room ──────────────────────────────────────────── */
.sot-room {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  color: var(--sot-text);
}

.sot-room__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--sot-navy);
  color: #fff;
  border-radius: var(--sot-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.sot-room__title  { font-size: 1.2rem; font-weight: 800; margin: 0; }
.sot-room__meta   { font-size: .82rem; opacity: .7; margin-top: 4px; display: block; }

/* Break banner */
.sot-break-banner {
  background: #fef3c7;
  border: 2px solid #d97706;
  border-radius: var(--sot-radius);
  padding: 16px 20px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 16px;
  animation: sot-pulse 1.5s ease-in-out infinite;
}
@keyframes sot-pulse { 0%,100%{opacity:1} 50%{opacity:.8} }

/* Flash question banner */
.sot-flash-banner {
  background: #1e1b4b;
  border: 2px solid var(--sot-primary);
  border-radius: var(--sot-radius);
  padding: 20px;
  margin-bottom: 16px;
}
.sot-flash-banner__label {
  color: #a78bfa;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}
.sot-flash-banner__question {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Cards */
.sot-card {
  background: var(--sot-white);
  border: 1px solid var(--sot-border);
  border-radius: var(--sot-radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--sot-shadow);
}
.sot-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--sot-navy);
}
.sot-card--tool { border-left: 4px solid var(--sot-primary); }

/* Trainer tools grid */
.sot-trainer-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sot-trainer-tools .sot-card:last-child { grid-column: 1 / -1; }

/* Buttons */
.sot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
  text-decoration: none;
}
.sot-btn:focus-visible { outline: 3px solid var(--sot-primary); outline-offset: 2px; }
.sot-btn:disabled      { opacity: .5; cursor: not-allowed; }

.sot-btn--primary { background: #2563eb; color: #fff; }
.sot-btn--primary:hover { background: #1d4ed8; }

.sot-btn--purple  { background: #7c3aed; color: #fff; }
.sot-btn--purple:hover { background: #6d28d9; }

.sot-btn--warning { background: #d97706; color: #fff; }
.sot-btn--warning:hover { background: #b45309; }

.sot-btn--success { background: var(--sot-green); color: #fff; }
.sot-btn--success:hover { background: #047857; }

.sot-btn--outline {
  background: transparent;
  border: 1.5px solid var(--sot-border);
  color: var(--sot-text);
}
.sot-btn--outline:hover { border-color: var(--sot-primary); color: var(--sot-primary); }

/* Picked student card */
.sot-picked-card {
  background: linear-gradient(135deg, #6c63ff, #3b82f6);
  color: #fff;
  border-radius: var(--sot-radius);
  padding: 20px;
  text-align: center;
}
.sot-picked-card__name  { font-size: 1.5rem; font-weight: 800; }
.sot-picked-card__email { font-size: .9rem; opacity: .8; margin-top: 4px; }

/* Metrics */
.sot-metric       { font-size: 2rem; font-weight: 900; color: var(--sot-navy); font-variant-numeric: tabular-nums; }
.sot-metric-label { font-size: .78rem; color: var(--sot-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* Flash answer items */
.sot-answer-item {
  background: var(--sot-surface);
  border: 1px solid var(--sot-border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .88rem;
}
.sot-answer-item strong { color: var(--sot-navy); }

/* ── Trainee Dashboard ─────────────────────────────────────── */
.sot-dashboard {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}

.sot-dashboard__header {
  background: linear-gradient(135deg, var(--sot-navy) 0%, #1e3a5f 100%);
  border-radius: var(--sot-radius);
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 20px;
}
.sot-dashboard__header h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 4px; }
.sot-dashboard__header p  { font-size: .9rem; opacity: .75; margin: 0; }

/* Session cards */
.sot-session-card {
  background: var(--sot-white);
  border: 1px solid var(--sot-border);
  border-radius: var(--sot-radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  box-shadow: var(--sot-shadow);
  transition: border-color .15s;
}
.sot-session-card:hover         { border-color: var(--sot-primary); }
.sot-session-card--today        { border-left: 4px solid var(--sot-green); }
.sot-session-card__title        { font-size: 1rem; font-weight: 700; color: var(--sot-navy); }
.sot-session-card__meta         { font-size: .82rem; color: var(--sot-muted); margin-top: 4px; }

/* Status badges */
.sot-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.sot-badge--approved, .sot-badge--present  { background: #d1fae5; color: #065f46; }
.sot-badge--pending                         { background: #fef3c7; color: #92400e; }
.sot-badge--absent                          { background: #fee2e2; color: #991b1b; }
.sot-badge--late                            { background: #fef3c7; color: #92400e; }

/* Progress bar */
.sot-progress {
  height: 8px;
  background: var(--sot-border);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.sot-progress__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--sot-primary);
  transition: width .4s ease;
}
.sot-progress__fill--green  { background: var(--sot-green); }
.sot-progress__fill--amber  { background: var(--sot-amber); }
.sot-progress__fill--red    { background: var(--sot-red); }

/* Empty state */
.sot-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--sot-muted);
}
.sot-empty-state__icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sot-trainer-tools { grid-template-columns: 1fr; }
  .sot-trainer-tools .sot-card:last-child { grid-column: auto; }
  .sot-room__header { flex-direction: column; align-items: flex-start; }
  .sot-session-card { flex-direction: column; align-items: flex-start; }
}

/* ── Focus management (WCAG 2.1 AA) ───────────────────────── */
.sot-public :focus-visible {
  outline: 3px solid var(--sot-primary);
  outline-offset: 3px;
}
