/* TukalClass — дизайн-система сайта репетитора.
   Аудитория: сельские жители, часто пожилые, мобильный интернет.
   Принципы: крупный шрифт, большие кнопки, высокий контраст, только системные шрифты. */

:root {
  --tc-bg: #FBF8F3;
  --tc-surface: #FFFFFF;
  --tc-surface-2: #F3EEE5;
  --tc-ink: #1E1B16;
  --tc-ink-2: #5B5348;
  --tc-line: #E2DACD;
  --tc-primary: #176B5B;
  --tc-primary-ink: #FFFFFF;
  --tc-primary-soft: #E6F1EE;
  --tc-accent: #B8801F;
  --tc-accent-soft: #FBF0DC;
  --tc-danger: #A8342A;
  --tc-danger-soft: #FAEAE8;
  --tc-ok: #2C6B3F;
  --tc-ok-soft: #E7F2EA;
  --tc-radius: 12px;
  --tc-radius-sm: 8px;
  --tc-shadow: 0 1px 2px rgba(30, 27, 22, .06), 0 8px 24px rgba(30, 27, 22, .06);
  --tc-max: 1080px;
  --tc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
a { color: var(--tc-primary); }

.tc-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--tc-primary); color: var(--tc-primary-ink);
  padding: 12px 18px; border-radius: 0 0 var(--tc-radius-sm) 0;
}
.tc-skip:focus { left: 0; }

/* ---------------------------------------------------------- каркас */

.tc-container {
  width: 100%;
  max-width: var(--tc-max);
  margin: 0 auto;
  padding: 0 16px;
}

.tc-main { padding: 24px 0 48px; min-height: 60vh; }

.tc-header {
  background: var(--tc-surface);
  border-bottom: 1px solid var(--tc-line);
  position: relative;
}
.tc-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.tc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--tc-ink);
  margin-right: auto;
}
.tc-brand__logo {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  display: grid; place-items: center;
  background: var(--tc-primary);
  color: var(--tc-primary-ink);
  border-radius: var(--tc-radius-sm);
  font-weight: 700; font-size: 16px; letter-spacing: .5px;
}
.tc-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.tc-brand__text strong { font-size: 19px; }
.tc-brand__sub { font-size: 14px; color: var(--tc-ink-2); }

.tc-nav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--tc-line);
  margin-top: 4px;
}
.tc-nav.is-open { display: flex; }
.tc-nav__link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--tc-radius-sm);
  color: var(--tc-ink);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
}
.tc-nav__link:hover { background: var(--tc-surface-2); }
.tc-nav__link--active { background: var(--tc-primary-soft); color: var(--tc-primary); }
.tc-nav__form { margin-top: 4px; }
.tc-nav__form .tc-btn { width: 100%; }

.tc-copied { color: var(--tc-ok); }

.tc-header__toggle { display: inline-flex; }

.tc-footer {
  background: var(--tc-surface);
  border-top: 1px solid var(--tc-line);
  padding: 32px 0;
  margin-top: 40px;
}

/* ---------------------------------------------------------- сетка */

.tc-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tc-grid--2, .tc-grid--3, .tc-grid--4 { grid-template-columns: 1fr; }

/* ---------------------------------------------------------- текст */

.tc-h1 { font-size: 30px; }
.tc-h2 { font-size: 25px; }
.tc-h3 { font-size: 21px; }
.tc-h4 { font-size: 19px; }
.tc-lead { font-size: 19px; color: var(--tc-ink-2); }
.tc-muted { color: var(--tc-ink-2); }
.tc-small { font-size: 15px; }
.tc-big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.tc-meta { font-size: 15px; color: var(--tc-ink-2); margin: 0 0 .5em; }

.tc-divider { height: 1px; background: var(--tc-line); border: 0; margin: 24px 0; }
.tc-section { margin: 40px 0; }
.tc-section__head { margin-bottom: 18px; }

/* ---------------------------------------------------------- кнопки */

.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--tc-radius-sm);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--tc-surface-2);
  color: var(--tc-ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.tc-btn--primary { background: var(--tc-primary); color: var(--tc-primary-ink); }
.tc-btn--primary:hover { background: #105648; color: var(--tc-primary-ink); }
.tc-btn--ghost { background: var(--tc-surface); border-color: var(--tc-line); color: var(--tc-ink); }
.tc-btn--ghost:hover { background: var(--tc-surface-2); color: var(--tc-ink); }
.tc-btn--danger { background: var(--tc-danger-soft); color: var(--tc-danger); border-color: #EFCFCB; }
.tc-btn--danger:hover { background: #F5DCD9; color: var(--tc-danger); }
.tc-btn--sm { min-height: 38px; padding: 8px 14px; font-size: 15px; }
.tc-btn--block { display: flex; width: 100%; }
.tc-btn[disabled], .tc-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.tc-link { color: var(--tc-accent); text-decoration: underline; text-underline-offset: 2px; }
.tc-link:hover { color: #8F6114; }
.tc-link--quiet { color: var(--tc-ink); text-decoration: none; }
.tc-link--quiet:hover { color: var(--tc-primary); text-decoration: underline; }

/* ---------------------------------------------------------- формы */

.tc-form { display: flex; flex-direction: column; gap: 14px; }
.tc-field { display: flex; flex-direction: column; gap: 6px; }
.tc-label { font-weight: 600; font-size: 16px; }

.tc-input, .tc-textarea, .tc-select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius-sm);
  background: var(--tc-surface-2);
  color: var(--tc-ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.4;
}
.tc-textarea { min-height: 100px; resize: vertical; }
.tc-select { appearance: none; background-image: none; padding-right: 14px; }
.tc-input:focus, .tc-textarea:focus, .tc-select:focus {
  outline: 3px solid var(--tc-primary);
  outline-offset: 1px;
  border-color: var(--tc-primary);
  background: var(--tc-surface);
}
.tc-help { font-size: 15px; color: var(--tc-ink-2); margin: 0; }
.tc-error { font-size: 15px; color: var(--tc-danger); margin: 0; }
.tc-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 17px;
  cursor: pointer;
}
.tc-checkbox input { width: 22px; height: 22px; accent-color: var(--tc-primary); flex: 0 0 22px; }

/* ---------------------------------------------------------- карточки */

.tc-card {
  background: var(--tc-surface);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius);
  padding: 20px;
  box-shadow: var(--tc-shadow);
}
.tc-card--flat { box-shadow: none; }
.tc-card__title { font-size: 20px; margin: 0 0 6px; font-weight: 700; }
.tc-card__meta { font-size: 15px; color: var(--tc-ink-2); margin: 0 0 10px; }

.tc-panel {
  background: var(--tc-surface-2);
  border-radius: var(--tc-radius);
  padding: 16px;
}

.tc-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--tc-ink-2);
  border: 1px dashed var(--tc-line);
  border-radius: var(--tc-radius);
  background: var(--tc-surface);
}

/* ---------------------------------------------------------- таблицы */

.tc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--tc-surface);
  border-radius: var(--tc-radius);
  overflow: hidden;
}
.tc-table th, .tc-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--tc-line);
  text-align: left;
  vertical-align: top;
  font-size: 16px;
}
.tc-table th { background: var(--tc-surface-2); font-weight: 700; white-space: nowrap; }
.tc-table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- бейджи */

.tc-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--tc-surface-2);
  color: var(--tc-ink-2);
  white-space: nowrap;
}
.tc-badge--ok { background: var(--tc-ok-soft); color: var(--tc-ok); }
.tc-badge--warn { background: var(--tc-accent-soft); color: var(--tc-accent); }
.tc-badge--err { background: var(--tc-danger-soft); color: var(--tc-danger); }
.tc-badge--info { background: var(--tc-primary-soft); color: var(--tc-primary); }

/* ---------------------------------------------------------- алерты */

.tc-alert {
  padding: 14px 16px;
  border-radius: var(--tc-radius-sm);
  border: 1px solid var(--tc-line);
  background: var(--tc-surface);
  margin-bottom: 14px;
}
.tc-alert--ok { background: var(--tc-ok-soft); border-color: #C9E0D1; color: var(--tc-ok); }
.tc-alert--err { background: var(--tc-danger-soft); border-color: #EFCFCB; color: var(--tc-danger); }
.tc-alert--warn { background: var(--tc-accent-soft); border-color: #EFDCB6; color: #8F6114; }
.tc-alert--info { background: var(--tc-primary-soft); border-color: #C7E0D9; color: var(--tc-primary); }

/* ---------------------------------------------------------- слоты */

.tc-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tc-slot {
  display: block;
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius-sm);
  padding: 10px;
  text-align: center;
  background: var(--tc-surface);
  color: var(--tc-ink);
  text-decoration: none;
}
.tc-slot--free { border-color: var(--tc-primary); background: var(--tc-primary-soft); color: var(--tc-ink); }
.tc-slot--busy { background: var(--tc-surface-2); color: var(--tc-ink-2); opacity: .7; }
.tc-slot--mine { border-width: 2px; border-color: var(--tc-accent); }
.tc-slot__time { font-weight: 700; font-size: 17px; }
.tc-slot__date { font-size: 14px; color: var(--tc-ink-2); }

/* ---------------------------------------------------------- лента */

.tc-feed { display: flex; flex-direction: column; gap: 14px; }
.tc-feed__item { margin: 0; }
.tc-feed__meta { font-size: 15px; color: var(--tc-ink-2); margin: 0 0 8px; }
.tc-feed__title { font-size: 20px; margin: 0 0 4px; }

/* ---------------------------------------------------------- публичные блоки */

.tc-hero { padding: 28px 0 36px; }
.tc-hero__title { font-size: 34px; line-height: 1.15; margin-bottom: 12px; }
.tc-hero__text { font-size: 19px; color: var(--tc-ink-2); max-width: 62ch; margin-bottom: 20px; }
.tc-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.tc-subjects { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tc-subject { display: flex; flex-direction: column; }
.tc-subject__price { font-size: 30px; font-weight: 700; color: var(--tc-accent); margin: 8px 0; }

.tc-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: tc-step; }
.tc-step {
  background: var(--tc-surface);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius);
  padding: 18px;
  counter-increment: tc-step;
}
.tc-step::before {
  content: counter(tc-step);
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--tc-primary);
  color: var(--tc-primary-ink);
  font-weight: 700;
}

.tc-price-list { display: flex; flex-direction: column; gap: 8px; }
.tc-price-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--tc-line);
}
.tc-price-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------- табы */

.tc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--tc-line);
  margin-bottom: 20px;
  padding-bottom: 2px;
}
.tc-tab {
  padding: 10px 14px;
  border-radius: var(--tc-radius-sm);
  color: var(--tc-ink-2);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.tc-tab:hover { background: var(--tc-surface-2); color: var(--tc-ink); }
.tc-tab--active {
  background: var(--tc-surface);
  color: var(--tc-ink);
  box-shadow: inset 0 -3px 0 var(--tc-primary);
}

/* ---------------------------------------------------------- вход и кабинет */

.tc-auth { max-width: 460px; margin: 40px auto; }
.tc-auth__card { width: 100%; }
.tc-auth__hint { font-size: 15px; color: var(--tc-ink-2); margin-top: 16px; }

.tc-userbar {
  background: var(--tc-primary-soft);
  border-radius: var(--tc-radius);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ---------------------------------------------------------- утилиты */

.tc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tc-right { margin-left: auto; }
.tc-stack { display: flex; flex-direction: column; gap: 12px; }
.tc-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tc-icon { flex: 0 0 auto; vertical-align: middle; }

/* ---------------------------------------------------------- адаптив */

@media (min-width: 720px) {
  .tc-container { padding: 0 24px; }
  .tc-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tc-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tc-h1 { font-size: 36px; }
  .tc-hero__title { font-size: 42px; }
  .tc-big { font-size: 36px; }
}

@media (min-width: 900px) {
  .tc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tc-subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tc-header__toggle { display: none; }
  .tc-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    width: auto;
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
  }
  .tc-nav__link { padding: 8px 9px; font-size: 16px; }
  .tc-nav__form { margin-top: 0; margin-left: 4px; }
}

/* ---------------------------------------------------------- печать и доступность */

@media print {
  .tc-nav, .tc-btn, .tc-footer, .tc-header__toggle, .tc-tabs { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .tc-card { box-shadow: none; border-color: #999; }
  a { text-decoration: underline; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
