@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --button-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #fef3c7 50%, #fce7f3 100%);
  --card-bg: rgba(255, 255, 255, 0.96);
  --text-main: #0f172a;
  --text-muted: #64748b;
}

* { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text-main);
}

.app-card {
  width: 100%;
  max-width: 860px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 26px;
  padding: 2.2rem;
  box-shadow: 0 20px 45px -10px rgba(30, 58, 138, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8);
}

/* School Branding Header */
.school-branding {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px dashed #e2e8f0;
}

.school-logo {
  height: 85px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.school-name {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #1e3a8a;
  text-transform: uppercase;
}

.school-subtitle {
  margin: 0.35rem 0 0;
  color: #475569;
  font-size: 1.05rem;
  font-weight: 700;
}

/* Form Styles */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 480px;
  margin: 0 auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.form-group label {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e3a8a;
}

input, select {
  font-family: 'Nunito', sans-serif;
  padding: 0.9rem 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

button {
  font-family: 'Nunito', sans-serif;
  padding: 0.9rem 1.8rem;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active { transform: translateY(2px) scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--button-gradient); color: #ffffff; box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35); }
.btn-success { background: var(--success-gradient); color: #ffffff; box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35); }
.btn-danger { background: var(--danger-gradient); color: #ffffff; box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35); }
.btn-text { background: #f1f5f9; color: #475569; font-size: 0.95rem; padding: 0.45rem 1rem; border-radius: 10px; }

/* User Strip */
.user-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.65rem 1.2rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
}
.user-strip strong { color: #1e3a8a; }

/* Story Teleprompter */
.story-title { font-size: 1.5rem; font-weight: 800; color: #1e3a8a; margin: 0 0 1rem; text-align: center; }

.reading-teleprompter {
  background: #ffffff;
  border: 3px solid #e0e7ff;
  padding: 2rem;
  border-radius: 20px;
  font-size: 1.65rem;
  line-height: 2.3;
  min-height: 160px;
  font-weight: 700;
}

.word { padding: 3px 6px; border-radius: 8px; display: inline-block; transition: all 0.2s; }
.word.pending { color: #94a3b8; }
.word.active { background: #fef08a; color: #854d0e; outline: 3px solid #facc15; transform: scale(1.08); }
.word.correct { color: #059669; background: #d1fae5; transform: scale(1.02); }
.word.stumbled { color: #e11d48; background: #ffe4e6; text-decoration: underline wavy #f43f5e; }

.control-bar { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.8rem; }
.instruction-note { text-align: center; color: var(--text-muted); font-size: 0.95rem; font-weight: 600; margin-top: 0.8rem; }

/* Scorecard */
.score-header { text-align: center; }
.stars { font-size: 3rem; margin: 0; letter-spacing: 6px; }
.score-headline { font-size: 1.8rem; font-weight: 900; margin: 0.4rem 0 1rem; color: #1e3a8a; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 1.5rem 0; }
.metric-box { background: #f8fafc; border: 2px solid #e2e8f0; padding: 1.2rem; text-align: center; border-radius: 18px; }
.metric-box .label { display: block; font-size: 0.9rem; font-weight: 800; color: #2563eb; text-transform: uppercase; }
.metric-box .val { font-size: 2.2rem; font-weight: 900; color: #0f172a; margin-top: 0.2rem; display: block; }

/* Phonics Clinic */
.clinic-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px dashed #f59e0b;
  padding: 1.5rem;
  border-radius: 20px;
  margin-top: 1.8rem;
}
.clinic-box h4 { margin: 0; font-size: 1.3rem; font-weight: 900; color: #92400e; }
.clinic-subtitle { font-size: 0.95rem; color: #b45309; font-weight: 600; margin: 0.3rem 0 1rem; }
.clinic-list { display: flex; flex-direction: column; gap: 0.8rem; }
.clinic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  border: 2px solid #fef3c7;
}
.clinic-card strong { font-size: 1.3rem; color: #991b1b; }
.clinic-card.mastered { border-color: #a7f3d0; background: #ecfdf5; }
.clinic-card.mastered strong { color: #065f46; }

.action-footer { margin-top: 2rem; text-align: center; }
.hidden { display: none !important; }