/* Личный кабинет Usti Team.
   Тёмная тема под фирменный стиль клуба: почти чёрный фон, белый жирный
   шрифт, красный акцент. Всё своё — ни одного внешнего шрифта или скрипта,
   чтобы страница открывалась быстро и не зависела от чужих серверов
   (у части клиентов интернет с ограничениями). */

/* Цвета — из фирменного набора клуба (media/brand.css), взяты из самих
   файлов логотипа. Не подбирать на глаз: на странице, где знак лежит на
   фоне того же цвета, расхождение заметно. */
:root {
  --bg: #221F20;          /* usti-ink */
  --surface: #2E2A2B;     /* usti-ink-soft */
  --surface-2: #3A3536;   /* usti-ink-line, он же фон полей */
  --border: #3A3536;
  --text: #E4E7E9;        /* usti-paper */
  --muted: #928C8D;       /* usti-muted */
  --accent: #A60F1D;      /* usti-red */
  --accent-dim: #7A0B15;
  --ok: #35c26a;
  --warn: #e8a13a;
  --radius: 14px;
  --pad: 16px;
  --maxw: 560px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }
.pad-b { padding-bottom: 10px; }

/* ------------------------------------------------------------- логотип */
/* Настоящий знак клуба картинкой: шрифт в оригинале переведён в кривые,
   повторить его вёрсткой нельзя. */
.wordmark { display: inline-flex; text-decoration: none; }
.wordmark img { display: block; height: 17px; width: auto; }
.wordmark.big img { height: 30px; }

/* ------------------------------------------------------------- каркас */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(21, 21, 21, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.logout-form { margin: 0; display: flex; }
.logout {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin: -8px -8px -8px 0;
  border: 0; border-radius: 12px;
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.logout:hover, .logout:focus-visible { color: var(--text); background: var(--surface-2); }
.logout svg { width: 21px; height: 21px; }

svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad) 108px;
}

.page-title { font-size: 25px; margin-bottom: 16px; }

/* ------------------------------------------------------------- карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card:last-child { margin-bottom: 0; }
.card-title { font-size: 16px; margin-bottom: 8px; }

.empty { text-align: center; padding: 30px 20px; }
.empty-title { font-weight: 600; margin-bottom: 6px; }

.alert {
  background: rgba(232, 35, 42, 0.1);
  border: 1px solid rgba(232, 35, 42, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 15px;
}

.note {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(232, 161, 58, 0.11);
  border-left: 3px solid var(--warn);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}

/* ------------------------------------------------------------- абонемент */
.pass-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.pass-name { font-size: 18px; line-height: 1.3; }

.pill {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}
.pill-active { background: rgba(53, 194, 106, 0.15); color: var(--ok); }
.pill-frozen { background: rgba(90, 160, 230, 0.15); color: #6fb0ea; }
.pill-expired, .pill-revoked { background: rgba(232, 35, 42, 0.14); color: #f2666b; }

.counter { display: flex; align-items: baseline; gap: 10px; }
.counter-num {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.counter-cap { color: var(--muted); font-size: 14px; }

.bar {
  height: 6px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

.rows { margin: 18px 0 0; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.row dt { color: var(--muted); flex: none; }
.row dd { margin: 0; text-align: right; }

/* ------------------------------------------------------------- расписание */
.day { margin-bottom: 22px; }
.day:last-child { margin-bottom: 0; }
.day-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 9px;
  padding-left: 2px;
}

.list { padding: 0; overflow: hidden; }

.lesson, .visit {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.lesson:first-child, .visit:first-child { border-top: 0; }

.lesson-time {
  flex: none;
  width: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lesson-title { font-weight: 500; }

/* ------------------------------------------------------------- посещения */
.visit { align-items: baseline; }
.visit-date { flex: none; width: 108px; display: flex; flex-direction: column; }
.visit-day { font-weight: 600; }
.visit-title { color: var(--muted); }

/* ------------------------------------------------------------- дети */
.kid { margin-bottom: 24px; }
.kid:last-child { margin-bottom: 0; }
.kid-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 2px;
}
.kid { padding-bottom: 6px; }
.kid + .kid {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.sub-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 18px 0 9px;
  padding-left: 2px;
}

/* ------------------------------------------------------------- нижнее меню */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: rgba(21, 21, 21, 0.94);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1 1 0;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10.5px;
  text-align: center;
  transition: color 0.15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--text); }
.tab.on svg { color: var(--accent); }
.tab:active { background: var(--surface-2); }

/* ------------------------------------------------------------- вход */
/* На входе — фирменный кадр с фигурой. Затемняющая подложка обязательна:
   без неё белый текст местами теряется на светлых участках снимка. */
.login-body {
  display: flex;
  align-items: center;
  min-height: 100dvh;
  background-image:
    linear-gradient(180deg, rgba(34, 31, 32, 0.82) 0%, rgba(34, 31, 32, 0.94) 55%, var(--bg) 100%),
    url("brand/hero-mobile-1080x1350.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: scroll;
}
@media (min-width: 720px) {
  .login-body {
    background-image:
      linear-gradient(90deg, rgba(34, 31, 32, 0.96) 0%, rgba(34, 31, 32, 0.86) 55%, rgba(34, 31, 32, 0.7) 100%),
      url("brand/hero-desktop-1920x800.jpg");
    background-position: center;
  }
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 32px var(--pad) calc(32px + env(safe-area-inset-bottom));
}
.login-head { text-align: center; margin-bottom: 26px; }
.login-head h1 { font-size: 26px; margin: 20px 0 6px; }
.login-head .sub { color: var(--muted); font-size: 14px; }

.form { padding: 20px; }
.field { display: block; margin-bottom: 16px; }
.field .label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--muted);
}
input[type="tel"], input[type="date"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* меньше 16px — iOS зумит страницу при фокусе */
  appearance: none;
}
input:focus-visible, .btn:focus-visible, .tab:focus-visible, .logout:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input::placeholder { color: #6a6a6a; }

.btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dim); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  margin-top: 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  appearance: none;
}

.back-link { margin-top: 18px; text-align: center; font-size: 14px; }
.back-link a { color: var(--muted); text-decoration: none; }
.back-link a:hover { color: var(--text); }

.add-child { margin-top: 20px; }

/* кнопка-ссылка выглядит как кнопка */
a.btn { display: block; text-align: center; text-decoration: none; }

@media (min-width: 620px) {
  .content { padding-top: 28px; }
  .page-title { font-size: 28px; }
}
