:root {
  --blue-900: #0a2a66;
  --blue-700: #1347b8;
  --blue-600: #1a5cff;
  --blue-500: #3b7bff;
  --blue-100: #e6efff;
  --blue-50: #f3f7ff;
  --white: #ffffff;
  --text: #14213d;
  --muted: #6b7a99;
  --line: #e2e9f5;
  --danger: #e5484d;
  --ok: #18a957;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(26, 92, 255, .10);
  --shadow-lg: 0 20px 50px rgba(26, 92, 255, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 15px; transition: .2s ease; white-space: nowrap;
}
.btn--primary { background: var(--blue-600); color: #fff; box-shadow: 0 8px 20px rgba(26, 92, 255, .3); }
.btn--primary:hover { background: var(--blue-700); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--blue-600); border-color: var(--blue-100); }
.btn--ghost:hover { background: var(--blue-50); border-color: var(--blue-500); }
.btn--light { background: var(--blue-50); color: var(--blue-600); }
.btn--light:hover { background: var(--blue-100); }
.btn--lg { padding: 15px 30px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: .2s;
}
.header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(10, 42, 102, .05); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 22px; color: var(--blue-900); }
.logo b { color: var(--blue-600); font-weight: 800; }
.logo__icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); color: #fff;
}
.logo--light { color: #fff; }
.logo--light b { color: #9fc0ff; }
.logo--light .logo__icon { background: rgba(255, 255, 255, .15); }

.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); transition: .2s; }
.nav a:hover { color: var(--blue-600); background: var(--blue-50); }
.header__actions { display: flex; align-items: center; gap: 10px; }

.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--blue-50); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--blue-600); border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(59, 123, 255, .18), transparent 60%),
    linear-gradient(180deg, var(--blue-50), #fff);
  padding: 70px 0 90px;
}
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.badge { display: inline-block; padding: 7px 16px; background: var(--blue-100); color: var(--blue-600); border-radius: 999px; font-weight: 700; font-size: 14px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.1; font-weight: 800; color: var(--blue-900); letter-spacing: -1px; }
.accent { color: var(--blue-600); }
.hero p { margin: 20px 0 30px; font-size: 18px; color: var(--muted); max-width: 520px; }
.hero__buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats { list-style: none; display: flex; gap: 36px; margin-top: 44px; flex-wrap: wrap; }
.hero__stats b { display: block; font-size: 28px; font-weight: 800; color: var(--blue-700); line-height: 1.2; }
.hero__stats span { font-size: 14px; color: var(--muted); }

.hero__visual { position: relative; height: 420px; }
.hero__card { position: absolute; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.hero__card--main {
  inset: 20px 40px 20px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(145deg, var(--blue-500), var(--blue-700)); color: #fff; border-radius: 36px;
}
.hero__card--main strong { font-size: 28px; margin-top: 10px; }
.hero__card--main span { opacity: .85; }
.hero__sparkle { position: absolute; top: 24px; right: 30px; font-size: 28px; opacity: .8; }
.hero__card--float1, .hero__card--float2 { padding: 12px 18px; font-weight: 700; font-size: 14px; color: var(--blue-900); animation: float 5s ease-in-out infinite; }
.hero__card--float1 { top: 40px; left: -10px; }
.hero__card--float2 { bottom: 50px; right: -6px; animation-delay: -2.5s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Секции ---------- */
.section { padding: 90px 0; }
.section--tint { background: var(--blue-50); }
.section__head { text-align: center; max-width: 620px; margin: 0 auto 50px; }
.section__head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--blue-900); letter-spacing: -.5px; }
.section__head p { color: var(--muted); margin-top: 10px; font-size: 17px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: .25s; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--blue-500); }
.card__icon { width: 56px; height: 56px; display: grid; place-items: center; font-size: 28px; background: var(--blue-100); border-radius: 18px; }
.card h3 { font-size: 20px; color: var(--blue-900); }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card__price { font-weight: 800; color: var(--blue-600); font-size: 18px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px; }
.step { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.step span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-600); color: #fff; font-weight: 800; margin-bottom: 16px; }
.step h3 { font-size: 18px; color: var(--blue-900); margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Запись ---------- */
.booking { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 30px; box-shadow: var(--shadow); }
.panel__title { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: var(--blue-900); margin-bottom: 22px; }
.num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-600); color: #fff; font-size: 15px; }

.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal__month { font-weight: 800; font-size: 18px; text-transform: capitalize; color: var(--blue-900); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; color: var(--blue-600); transition: .2s; }
.icon-btn:hover:not(:disabled) { background: var(--blue-50); border-color: var(--blue-500); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__week span { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal__week .we { color: var(--blue-500); }
.day {
  aspect-ratio: 1; border-radius: 14px; border: 1px solid transparent; background: var(--blue-50);
  font-weight: 700; font-size: 15px; color: var(--blue-900); transition: .15s; position: relative;
}
.day:hover:not(:disabled) { background: var(--blue-100); border-color: var(--blue-500); }
.day:disabled { background: transparent; color: #b8c2d8; cursor: not-allowed; }
.day.is-full:disabled { background: #f6f7fb; text-decoration: line-through; }
.day.is-today { border-color: var(--blue-500); }
.day.is-selected { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(26, 92, 255, .35); }
.day--empty { visibility: hidden; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.dot--free { background: var(--blue-100); }
.dot--full { background: #e9ecf3; }
.dot--sel { background: var(--blue-600); }

.slots { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.slots__title { font-weight: 800; margin-bottom: 14px; color: var(--blue-900); }
.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.slot { padding: 11px 0; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; color: var(--blue-700); transition: .15s; }
.slot:hover:not(:disabled) { border-color: var(--blue-500); background: var(--blue-50); }
.slot:disabled { color: #b8c2d8; background: #f6f7fb; text-decoration: line-through; cursor: not-allowed; }
.slot.is-selected { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.slots__empty { color: var(--muted); font-size: 15px; grid-column: 1 / -1; }

/* ---------- Формы ---------- */
.field { margin-bottom: 16px; flex: 1; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; color: var(--blue-900); }
.field small { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--blue-50); font-size: 15px; color: var(--text); transition: .15s; outline: none; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px rgba(59, 123, 255, .15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: #fff6f6; }
.row { display: flex; gap: 14px; }

.summary { background: var(--blue-50); border-radius: var(--radius-sm); padding: 16px 18px; margin: 4px 0 18px; display: grid; gap: 8px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary span { color: var(--muted); }
.summary b { text-align: right; color: var(--blue-900); }
.summary__total { border-top: 1px dashed #c9d8f5; padding-top: 10px; font-size: 17px !important; }
.summary__total b { color: var(--blue-600); font-size: 20px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-bottom: 18px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue-600); flex-shrink: 0; }
.form-error { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 20px; margin-bottom: 8px; }
.muted { color: var(--muted); }

/* ---------- Модалки ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: .25s; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 42, 102, .45); backdrop-filter: blur(4px); }
.modal__box {
  position: relative; width: min(440px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 28px; padding: 32px;
  box-shadow: var(--shadow-lg); transform: translateY(20px) scale(.97); transition: .25s;
}
.modal.is-open .modal__box { transform: none; }
.modal__box--wide { width: min(560px, 100%); }
.modal__box--center { text-align: center; }
.modal__box h3 { font-size: 24px; font-weight: 800; color: var(--blue-900); margin-bottom: 18px; }
.modal__close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--blue-50); font-size: 24px; color: var(--blue-600); line-height: 1; }
.modal__close:hover { background: var(--blue-100); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--blue-50); padding: 5px; border-radius: 999px; margin-bottom: 22px; }
.tab { border: 0; background: transparent; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--muted); transition: .2s; }
.tab.is-active { background: #fff; color: var(--blue-600); box-shadow: 0 4px 12px rgba(26, 92, 255, .12); }

.success__icon { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); color: #fff; font-size: 38px; font-weight: 800; box-shadow: 0 12px 28px rgba(26, 92, 255, .35); }
.modal__box--center p { margin-bottom: 22px; }

.orders { display: grid; gap: 12px; margin: 16px 0 20px; max-height: 46vh; overflow-y: auto; }
.order { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--blue-50); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.order__info b { display: block; color: var(--blue-900); }
.order__info span { font-size: 13px; color: var(--muted); display: block; }
.order__price { font-weight: 800; color: var(--blue-600); margin-top: 4px; }
.order__cancel { border: 0; background: #fff; color: var(--danger); font-weight: 700; padding: 8px 14px; border-radius: 999px; font-size: 13px; border: 1px solid #f4cfd0; }
.order__cancel:hover { background: #fff3f3; }

/* ---------- Футер / тост ---------- */
.footer { background: var(--blue-900); color: #c4d4f5; padding: 34px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); z-index: 200;
  background: var(--blue-900); color: #fff; padding: 14px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  opacity: 0; visibility: hidden; transition: .3s; box-shadow: var(--shadow-lg); max-width: calc(100% - 40px); text-align: center;
}
.toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .hero__inner, .booking { grid-template-columns: 1fr; }
  .hero__visual { height: 320px; max-width: 420px; margin: 0 auto; width: 100%; }
  .burger { display: flex; }
  .header__cta { display: none; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 14px 20px 20px;
    border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px rgba(10, 42, 102, .08);
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .section { padding: 60px 0; }
  .panel { padding: 22px 18px; border-radius: 22px; }
  .row { flex-direction: column; gap: 0; }
  .hero { padding: 40px 0 60px; }
  .hero__stats { gap: 22px; }
  .cal__grid, .cal__week { gap: 4px; }
  .modal__box { padding: 26px 20px; }
}

/* ---------- Кнопки входа / регистрации в шапке ---------- */
.auth-guest { display: flex; gap: 10px; }
.btn .short { display: none; }
@media (max-width: 1100px) {
  .header__cta { display: none; }
}
@media (max-width: 560px) {
  .header .btn { padding: 8px 12px; font-size: 13px; }
  .btn .full { display: none; }
  .btn .short { display: inline; }
  .auth-guest { gap: 6px; }
  .header__actions { gap: 6px; }
  .header .logo { font-size: 18px; }
}
@media (max-width: 440px) {
  .header .logo__text { display: none; }
}

/* ---------- Состояния данных с сервера ---------- */
.services-error { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px; }
.day.is-loading { opacity: .55; }
.status { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--blue-100); color: var(--blue-700); vertical-align: middle; }
.status--completed { background: #dcf5e6; color: #11793f; }
.status--cancelled { background: #fde8e8; color: var(--danger); }
.status--in_progress { background: #fff1d6; color: #9a5b00; }
.link { color: var(--blue-600); font-weight: 700; text-decoration: underline; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
