/* Стили страниц аккаунта. Дополняют css/style.css, переменные берутся оттуда. */

/* ===== Формы ===== */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-input,
.form-select {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder { color: var(--text-light); }
.form-help {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.form-help ul { margin: 4px 0 0; padding-left: 18px; }
.form-error {
  font-size: 13px;
  color: #c0392b;
  margin-top: 6px;
}
.form-row.has-error .form-input,
.form-row.has-error .form-select { border-color: #e08c85; }
.form-check { width: 16px; height: 16px; accent-color: var(--primary); }
.form-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.form-check-row label { margin: 0; font-weight: 400; }

/* Две колонки: класс + буква */
.form-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* ===== Карточка авторизации ===== */
.auth-section { padding: 56px 0 72px; background: var(--bg-section); min-height: 60vh; }
.auth-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
}
.auth-card.wide { max-width: 620px; }
.auth-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; color: var(--text); }
.auth-subtitle { color: var(--text-muted); margin: 0 0 28px; font-size: 15px; }
.auth-footer {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ===== Сообщения ===== */
.messages { margin: 0 0 24px; padding: 0; list-style: none; }
.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 10px;
  border-left: 3px solid;
}
.message-success { background: var(--green-light); border-color: var(--green-dark); color: #2f6b3c; }
.message-error   { background: #fdeceb; border-color: #d9534f; color: #8f2b28; }
.message-info    { background: var(--primary-light); border-color: var(--primary); color: #0b5a85; }
.message-warning { background: #fef6e7; border-color: #e0a02c; color: #7a5410; }

/* ===== Личный кабинет ===== */
.profile-section { padding: 48px 0 72px; background: var(--bg-section); }
.profile-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}
.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.panel + .panel { margin-top: 24px; }
.panel-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.panel-subtitle { font-size: 14px; color: var(--text-muted); margin: 0 0 22px; line-height: 1.5; }

.user-card { text-align: center; }
.user-avatar {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
}
.user-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.user-meta { font-size: 14px; color: var(--text-muted); }

.info-list { margin: 20px 0 0; padding: 0; list-style: none; text-align: left; }
.info-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
}
.info-list .key { color: var(--text-muted); }
.info-list .val { color: var(--text); font-weight: 600; text-align: right; }

/* Статус подключения Telegram */
.tg-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.tg-on  { background: var(--green-light); color: #2f6b3c; }
.tg-off { background: var(--bg-light); color: var(--text-muted); }
.tg-steps { margin: 16px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.tg-steps code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
}

/* Опасные действия */
.danger-zone { border-color: #f0d0cd; }
.danger-zone .panel-title { color: #c0392b; }
.btn-danger {
  background: #c0392b; color: #fff; border: 1px solid #c0392b;
}
.btn-danger:hover { background: #a53226; border-color: #a53226; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ===== Мои олимпиады и дедлайны ===== */
.deadline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
}
.deadline-row:first-of-type { border-top: none; }
.deadline-name { font-size: 15px; font-weight: 600; color: var(--text); }
.deadline-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.deadline-date { text-align: right; flex-shrink: 0; }
.deadline-day { font-size: 15px; font-weight: 700; color: var(--primary); }
.deadline-label { font-size: 12px; color: var(--text-muted); }

.sub-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.sub-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.sub-name:hover { color: var(--primary); }
.sub-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.sub-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sub-form .form-select { width: auto; flex: 1; min-width: 160px; padding: 7px 10px; font-size: 14px; }

/* Плитка предмета без своей иконки — эмодзи вместо картинки */
.subj-btn--emoji {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  text-decoration: none;
  padding: 8px;
}
.subj-btn--emoji:hover { background: var(--primary-light); border-color: var(--primary); }
.subj-btn-emoji { font-size: 40px; line-height: 1; }
.subj-btn-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

/* ===== Контент из Wagtail ===== */
.article-body { font-size: 16px; line-height: 1.75; color: var(--text); }
.article-h2 { font-size: 26px; font-weight: 800; margin: 40px 0 14px; color: var(--text); }
.article-h3 { font-size: 20px; font-weight: 700; margin: 32px 0 10px; color: var(--text); }
.article-body > *:first-child { margin-top: 0; }
.article-text p { margin: 0 0 16px; }
.article-text a { color: var(--primary); }
.article-list { margin: 0 0 20px; padding-left: 22px; }
.article-list li { margin-bottom: 8px; }

.article-figure { margin: 28px 0; }
.article-figure img,
.article-img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; }
.article-figure--wide { margin-left: calc(-1 * clamp(0px, 4vw, 80px)); margin-right: calc(-1 * clamp(0px, 4vw, 80px)); }
.article-figure figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.article-quote {
  margin: 28px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-quote p { margin: 0; font-size: 17px; font-style: italic; color: var(--text); }
.article-quote cite {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-style: normal;
  color: var(--text-muted);
}

.article-callout {
  display: flex;
  gap: 14px;
  margin: 28px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-light);
}
.article-callout--info { background: var(--primary-light); border-color: #bfe3f5; }
.article-callout--warning { background: #fef6e7; border-color: #f2dcae; }
.article-callout--success { background: var(--green-light); border-color: #c6e5cd; }
.article-callout-icon { font-size: 20px; line-height: 1.4; }
.article-callout-title { font-weight: 700; margin-bottom: 4px; }
.article-callout-text p:last-child { margin-bottom: 0; }

.article-video { margin: 28px 0; }
.article-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius);
}
.article-button { margin: 28px 0; }

/* ===== Дашборд ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.metric-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.metric-value { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--text); }
.metric-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
  align-items: start;
}

/* Полоски: без графических библиотек, обычные div */
.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.bar-label {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track { background: var(--bg-light); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; min-width: 2px; }
.bar-fill--accent { background: var(--accent); }
.bar-value { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.bar-extra { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }

.btn-green { background: var(--green-dark); color: #fff; border: 1px solid var(--green-dark); }
.btn-green:hover { background: #5aa869; border-color: #5aa869; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 14px;
}

@media (max-width: 720px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; }
}

/* ===== Списки для учителей ===== */
.student-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
/* Пункт «вся параллель» в фильтре — выделяем среди классов */
.option-parallel { font-weight: 700; color: var(--primary); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-light); }
.table-link { color: var(--text); font-weight: 600; text-decoration: none; }
.table-link:hover { color: var(--primary); }

/* ===== Страница «О нас» ===== */
.mission-icon--blue { background: var(--primary-light); }
.mission-icon--pink { background: var(--accent-light); }
.mission-icon--green { background: var(--green-light); }

.team-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* История: вертикальная лента с кружками */
.timeline { display: flex; flex-direction: column; }
.timeline-step { display: flex; gap: 20px; }
.timeline-marker { display: flex; flex-direction: column; align-items: center; }
.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
/* Номер шага считает сам браузер — при добавлении этапа нумерация не собьётся */
.timeline { counter-reset: timeline; }
.timeline-step { counter-increment: timeline; }
.timeline-dot::before { content: counter(timeline); }
.timeline-step:nth-child(2) .timeline-dot { background: var(--accent); }
.timeline-step:nth-child(3) .timeline-dot { background: var(--green-dark); }
.timeline-step:nth-child(4n) .timeline-dot { background: var(--dark); }
.timeline-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; }
.timeline-step:last-child .timeline-line { display: none; }
.timeline-body { padding-bottom: 28px; }
.timeline-step:last-child .timeline-body { padding-bottom: 0; }
.timeline-period { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.timeline-step:nth-child(2) .timeline-period { color: var(--accent); }
.timeline-step:nth-child(3) .timeline-period { color: var(--green-dark); }
.timeline-step:nth-child(4n) .timeline-period { color: var(--text-muted); }
.timeline-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.timeline-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Ценности */
.values-list { display: flex; flex-direction: column; gap: 20px; }
.value-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}
.value-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.value-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.value-card-icon--blue { background: var(--primary-light); }
.value-card-icon--pink { background: var(--accent-light); }
.value-card-icon--green { background: var(--green-light); }
.value-card-title { font-size: 16px; font-weight: 700; }
.value-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Тёмная плашка с призывом */
.promo-card {
  background: linear-gradient(135deg, var(--dark), #162242);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
}
.promo-emoji { font-size: 28px; margin-bottom: 12px; }
.promo-card h4 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.promo-card p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 16px;
}

.team-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 44px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .article-figure--wide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 560px) {
  .auth-card { padding: 26px 20px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
