/* Окно записи на созвон. Палитра и шрифт — как у naimiai.ru (Inter, розовый naimi). */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --bg: #ffffff;
  --soft: #f5f6fa;
  /* pink-deep / pink-dark / pink-wash из tailwind-конфига сайта: белый текст на --accent — 4.7:1 */
  --accent: #d42e7e;
  --accent-hover: #b92a6d;
  --accent-wash: #fbe9f3;
  --accent-wash-hover: #f6d5e6;
  --accent-ring: rgba(212, 46, 126, 0.16);
  --danger: #b42318;
  --danger-wash: #fef3f2;
  --danger-line: #fecdca;
  --gradient: linear-gradient(135deg, #ff7f50 0%, #e84393 50%, #8e44ad 100%);
  --radius: 12px;
  --radius-sm: 10px;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

p,
h1,
h2 {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

:where(button, a, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bk {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Шапка ─────────────────────────────────────────────── */

.head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.who-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.who-title:not(:empty)::before {
  content: '·';
  margin: 0 6px;
  color: var(--faint);
}

.who-title {
  color: var(--muted);
  font-weight: 500;
}

.who-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip svg {
  width: 15px;
  height: 15px;
}

.intro {
  margin-top: 20px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lead {
  margin-top: 6px;
  color: var(--ink-2);
}

/* ?compact=1 — без заголовка: когда окно стоит в модалке со своим заголовком.
   После записи заголовок тоже не нужен — на экране только подтверждение. */
.is-compact .intro,
.is-done .intro {
  display: none;
}

.is-compact .bk {
  padding-top: 16px;
}

.step {
  margin-top: 24px;
}

.step.enter {
  animation: enter 0.22s ease-out;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.step-title {
  font-size: 16px;
  font-weight: 600;
}

/* ── Выбор дня и времени ───────────────────────────────── */

.picker,
.skeleton {
  display: grid;
  gap: 22px;
  margin-top: 14px;
}

@media (min-width: 600px) {
  .picker,
  .skeleton {
    grid-template-columns: 292px 1fr;
    gap: 28px;
  }
}

.cal-month,
.times-day {
  margin-bottom: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-week span {
  padding-bottom: 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.day {
  position: relative;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.day:disabled {
  color: #c4c7ce;
  cursor: default;
}

.day.has {
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 600;
}

.day.has:hover {
  background: var(--accent-wash-hover);
}

.day.has[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

.day.today::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
}

.times-grid,
.sk-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  align-content: start;
  gap: 8px;
}

.time {
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background-color 0.15s;
}

.time:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.time:active {
  background: var(--accent-wash);
}

.tz {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.tz svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

/* ── Загрузка, ошибки, пусто ───────────────────────────── */

.sk {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #eff0f4 0%, #f7f8fa 50%, #eff0f4 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-cal {
  height: 232px;
}

.sk-times .sk {
  height: 44px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.notice,
.form-error {
  padding: 12px 14px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 14px;
}

.notice {
  margin-top: 12px;
}

.state {
  margin-top: 14px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--soft);
}

.state-text {
  color: var(--ink-2);
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ── Кнопки ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  padding: 0 8px;
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.btn-block {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius);
  font-size: 16px;
}

.btn[disabled] {
  opacity: 0.8;
  cursor: progress;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.is-busy .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Форма ─────────────────────────────────────────────── */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -6px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.back:hover {
  color: var(--ink);
}

.chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-wash);
}

.chosen svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.chosen-date {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.chosen-time {
  color: var(--ink-2);
  font-size: 14px;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.opt {
  margin-left: 4px;
  color: var(--faint);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  line-height: 1.4;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field input[readonly] {
  background: var(--soft);
  color: var(--ink-2);
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.consent {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.consent a {
  color: var(--accent);
  text-decoration: none;
}

.consent a:hover {
  text-decoration: underline;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Готово ────────────────────────────────────────────── */

.done {
  padding: 8px 0 4px;
  text-align: center;
}

.done-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 8px 24px rgba(232, 67, 147, 0.25);
  color: #fff;
}

.done-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
}

.done-title {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 700;
}

.done-title:focus {
  outline: none;
}

.done-when {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
}

.done-zone {
  color: var(--muted);
  font-size: 14px;
}

.done-text {
  max-width: 420px;
  margin: 14px auto 0;
  color: var(--ink-2);
}

.done .btn {
  margin-top: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .bk {
    padding: 20px 16px;
  }

  .title {
    font-size: 20px;
  }
}

/* На узком экране должность — отдельной строкой. */
@media (max-width: 400px) {
  .who-title {
    display: block;
    font-size: 13.5px;
  }

  .who-title:not(:empty)::before {
    content: none;
  }
}

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