/* ============================================================
   KARATE AMERICA STUDENT PORTAL — Tablet-First Design System
   Primary breakpoint: 768px (tablet)
   ============================================================ */

:root {
  --red:    #CC1F1F;
  --blue:   #1A3A9A;
  --white:  #FFFFFF;
  --light:  #F4F6FA;
  --gray:   #6B7280;
  --border: #D1D5DB;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --radius: 14px;
  --font:   'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--light);
  color: #1F2937;
}

/* ── LOGIN PAGE ─────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1A3A9A 0%, #0f2264 55%, #CC1F1F 100%);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.login-logo {
  width: 140px;
  height: auto;
}

.login-title {
  text-align: center;
  line-height: 1.2;
}

.login-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
}

.login-title p {
  font-size: 0.95rem;
  color: var(--gray);
  margin-top: 4px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field-group input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.field-group input:focus {
  border-color: var(--blue);
}

.field-group input::placeholder {
  color: #9CA3AF;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -6px;
}

.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.remember-row label {
  font-size: 0.85rem;
  color: var(--gray);
  cursor: pointer;
  user-select: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-login {
  padding: 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}

.btn-login:hover  { background: #b01a1a; }
.btn-login:active { transform: scale(0.98); }

.login-help {
  font-size: 0.82rem;
  color: var(--gray);
  text-align: center;
}

.login-help a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.login-footer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

/* ── ERROR STATE ────────────────────────────────────────── */

.error-msg {
  display: none;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
}

.error-msg.visible { display: block; }

/* ── DASHBOARD PAGE ─────────────────────────────────────── */

.dashboard-page {
  min-height: 100vh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dashboard-page::before {
  content: '';
  position: fixed;
  inset: 140px 30px 30px;
  background: url('assets/Jaquie Kicking Right.jpg') top center / contain no-repeat;
  z-index: 0;
}

.dashboard-page > * {
  position: relative;
  z-index: 1;
}

.dash-sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Header bar — full-width blue, content grouped center */
.dash-header {
  background: var(--blue);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.dash-header-inner {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 460px;
}

.dash-header-logo {
  height: 42px;
  width: auto;
}

.dash-student-info {
  text-align: center;
}

.dash-student-info .student-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.dash-student-info .student-level {
  font-size: 0.78rem;
  opacity: 0.8;
  margin-top: 2px;
}

.btn-logout {
  background: #FFD140;
  border: none;
  color: #1a1a1a;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-logout:hover { background: #d9ae00; }

/* Sub-header: progress centered below name */
.dash-progress-bar {
  background: var(--red);
  color: var(--white);
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.progress-track {
  width: min(400px, 80%);
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 99px;
  margin: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--white);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Main content */
.dash-content {
  flex: 1;
  padding: 20px 16px 40px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.week-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  margin: 24px 0 10px;
}

.week-label:first-child { margin-top: 8px; }

/* Class cards grid — 2 per week row */
.week-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.class-card {
  background: var(--white);
  border-radius: 10px;
  border: 2px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

/* Completed */
.class-card.completed {
  border-color: #16A34A;
  background: #F0FDF4;
}

.class-card.completed .card-icon { color: #16A34A; }

/* Current / unlocked */
.class-card.current {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,31,31,0.15);
  cursor: pointer;
}

.class-card.current .card-icon { color: var(--red); }

.class-card.current:hover {
  box-shadow: 0 0 0 4px rgba(204,31,31,0.25);
}

/* Locked */
.class-card.locked {
  opacity: 0.45;
  background: #F9FAFB;
}

.class-card.locked .card-icon { color: var(--border); }

/* Card internals */
.card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}

.card-text .card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1F2937;
  line-height: 1.2;
}

.card-text .card-sub {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 3px;
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 99px;
}

.class-card.current  .card-badge { background: var(--red);  color: var(--white); }
.class-card.completed .card-badge { background: #16A34A; color: var(--white); }

/* ── TABLET ADJUSTMENTS (≥768px) ────────────────────────── */

@media (min-width: 768px) {
  .login-card {
    padding: 56px 56px 48px;
  }

  .login-logo {
    width: 160px;
  }

  .login-title h1 {
    font-size: 1.75rem;
  }

  .field-group input {
    font-size: 1.1rem;
    padding: 16px 18px;
  }

  .btn-login {
    font-size: 1.1rem;
    padding: 18px;
  }
}

@media (min-width: 768px) {
  .dash-header { padding: 18px 32px; }
  .dash-header-logo { height: 52px; }
  .dash-student-info .student-name { font-size: 1.1rem; }
  .dash-progress-bar { padding: 12px 32px; font-size: 0.92rem; }
  .dash-content { padding: 24px 32px 48px; }
  .week-row { gap: 16px; }
  .class-card { padding: 20px; gap: 16px; }
  .card-text .card-title { font-size: 1rem; }
  .card-text .card-sub { font-size: 0.82rem; }
  .dashboard-page::before { inset: 165px 30px 30px; }
}
