:root {
  --bg-page: #F4F6F8;
  --bg-card: #FFFFFF;
  --accent: #2F6FED;
  --accent-dark: #1E54C4;
  --text-primary: #1A1F2B;
  --text-secondary: #5B6472;
  --text-muted: #9AA3B0;
  --border: #D8DEE6;
  --field-bg: #FAFBFC;
  --error-bg: #FDECEC;
  --error-border: #F2B8B8;
  --error-text: #A23232;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-page);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 24px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.logo-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 26px;
}

.brand h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.brand p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.login-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-box label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-box input,
.login-box select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--field-bg);
  margin-bottom: 18px;
  font-family: inherit;
}

.login-box input:focus,
.login-box select:focus {
  outline: none;
  border-color: var(--accent);
}

.error-message {
  background: var(--error-bg);
  border: 1.5px solid var(--error-border);
  color: var(--error-text);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 18px;
}

.big-button {
  width: 100%;
  background: var(--accent);
  color: #FFFFFF;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.big-button:hover {
  background: var(--accent-dark);
}

.logout-row {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
}

.logout-row a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.logout-row a:hover {
  text-decoration: underline;
}

.welcome {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.dash-tile .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #E8F0FE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ai-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.ai-box textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--field-bg);
  font-family: inherit;
  min-height: 70px;
  margin-bottom: 10px;
  resize: vertical;
}

.ai-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ai-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.ai-answer {
  background: var(--field-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Lessons list */
.lesson-tile {
  justify-content: flex-start;
}

.lesson-tile-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lesson-tile-week {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.lesson-tile-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.lesson-status {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.lesson-status-ready {
  background: #E6F4EA;
  color: #1E7B34;
}

.lesson-status-soon {
  background: #EDEFF2;
  color: var(--text-muted);
}

.lesson-tile-locked {
  opacity: 0.6;
}

.lesson-tile-locked .lesson-tile-title,
.lesson-tile-locked .lesson-tile-week {
  color: var(--text-muted);
}

/* Lesson detail */
.lesson-header {
  text-align: center;
  margin-bottom: 20px;
}

.week-badge {
  display: inline-block;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 10px;
}

.lesson-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.lesson-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Dated lessons list */
.lesson-date {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  background: #E8F0FE;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  flex-shrink: 0;
}

.lesson-tile-now {
  border: 2px solid var(--accent);
}

.lesson-tile-quiz {
  border-left: 4px solid #E0A526;
}

.lesson-status-now {
  background: #E8F0FE;
  color: var(--accent-dark);
}

.lesson-status-now-soon {
  background: #EDEFF2;
  color: var(--accent-dark);
}

/* Lesson page extras */
.lesson-when {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.topic-box {
  display: flex;
  flex-direction: column;
  background: #E8F0FE;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.topic-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.topic-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-dark);
}

.quiz-frame {
  width: 100%;
  height: 640px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
