/* Личный кабинет — оформление в фирменной палитре сайта академии */

:root {
  --red: #e3062c;
  --red-dark: #b4001f;
  --ink: #171820;
  --ink-2: #4a4b57;
  --muted: #7a7b88;
  --line: rgba(23, 24, 32, .1);
  --line-2: rgba(23, 24, 32, .18);
  --ground: #f5f2f3;
  --surface: #fff;
  --soft: #fff0f2;
  --ok-bg: #e8f5ee;
  --ok-ink: #1d6b42;
  --warn-bg: #fdf1e0;
  --warn-ink: #8a5a10;
  --radius: 20px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ── общие элементы ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card + .card { margin-top: 16px; }

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 19px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -.005em; }
h3 { font-size: 16px; margin: 0 0 6px; }

.hint { color: var(--muted); font-size: 14.5px; margin: 0 0 20px; }
.hint.small { font-size: 13px; margin: 16px 0 0; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 6, 44, .12); }
textarea { resize: vertical; }
.ro input { background: var(--ground); color: var(--muted); }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  cursor: pointer;
  justify-self: start;
}
.btn:hover { background: var(--red-dark); }
.btn:focus-visible { outline: 3px solid rgba(227, 6, 44, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-quiet { background: var(--ink); }
.btn-quiet:hover { background: #000; }

.link {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; font-weight: 600; color: var(--red); cursor: pointer;
}
.link:hover { text-decoration: underline; }

.error, .ok {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.error { background: var(--soft); color: var(--red-dark); }
.ok { background: var(--ok-bg); color: var(--ok-ink); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid .full, .grid .btn, .grid .error, .grid .ok { grid-column: 1 / -1; }

/* ── экран входа ────────────────────────────────────────────── */
.screen-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card-login { width: 100%; max-width: 420px; }
.card-login .btn { width: 100%; text-align: center; justify-self: stretch; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand img { border-radius: 8px; object-fit: contain; }
.brand b { display: block; font-size: 13px; letter-spacing: .04em; }
.brand span { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.brand-sm { margin: 0; }

/* ── каркас кабинета ────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.who { font-size: 14px; font-weight: 600; color: var(--ink-2); }

.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: none;
  padding: 9px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.tabs button:hover { background: rgba(23, 24, 32, .05); }
.tabs button.active { background: var(--ink); color: #fff; }

.content { max-width: 940px; margin: 0 auto; padding: 20px 24px 60px; }
.panel { display: none; }
.panel.active { display: block; }

/* ── карточка ребёнка ───────────────────────────────────────── */
.child-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 18px;
}
.child-head h2 { margin: 0; }
.child-group { font-size: 14px; color: var(--muted); font-weight: 600; }

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.meter {
  background: var(--ground);
  border-radius: 14px;
  padding: 14px 16px;
}
.meter b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.none { background: var(--soft); color: var(--red-dark); }

.slots { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.slots li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 11px 14px;
  background: var(--ground);
  border-radius: 12px;
  font-size: 14.5px;
}
.slots .day { font-weight: 700; min-width: 130px; text-transform: capitalize; }
.slots .time { font-variant-numeric: tabular-nums; font-weight: 600; }
.slots .place { color: var(--muted); }

.att { display: flex; flex-wrap: wrap; gap: 6px; }
.att i {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.att i.present { background: var(--ok-bg); color: var(--ok-ink); }
.att i.absent { background: var(--soft); color: var(--red-dark); }
.att i.excused { background: var(--warn-bg); color: var(--warn-ink); }

.empty {
  margin: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
}

.note {
  margin: 0;
  padding: 16px 18px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
}

.app-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 12px;
}
.app-item .row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 6px; }
.app-item .date { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.app-item p { margin: 0; font-size: 15px; }
.app-item .answer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .content, .tabs, .topbar { padding-left: 16px; padding-right: 16px; }
  .card { padding: 20px; border-radius: 16px; }
  .who { display: none; }
}

/* ── карточка ребёнка: редактирование ───────────────────────── */
.child-edit { margin-left: auto; font-size: 14px; }
.child-form { margin-top: 4px; }
.form-actions { display: flex; align-items: center; gap: 18px; }
.child-form .note { margin-bottom: 14px; }

/* ── вкладка «Оплата» ────────────────────────────────────────── */
/* Кнопки выбора ребёнка и кнопки оплаты идут в потоке карточки,
   поэтому им нужен размер поменьше основного. */
.btn.small {
  padding: 9px 18px;
  font-size: 14.5px;
  justify-self: auto;
}
.btn.small:not(.primary) {
  background: rgba(23, 24, 32, .06);
  color: var(--ink);
}
.btn.small:not(.primary):hover { background: rgba(23, 24, 32, .11); }

.pay-children {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px;
}

.error-text {
  margin: 0 0 12px;
  color: var(--red-dark);
  font-weight: 700;
  font-size: 14.5px;
}
