/* ==========================================================================
   Запись на встречу — Анастасия Березюк · НОМЕР ДЕЛА
   Фирменный стиль: цвет #102B85 взят пиксельно из логотипа.
   Направление: светлый premium, юридическая строгость, много воздуха.
   ========================================================================== */

:root {
  /* Фирменный синий — точное значение из логотипа */
  --brand: #102B85;
  --brand-deep: #0a1f63;
  --brand-bright: #1d3fae;
  --brand-soft: #eef1fa;
  --brand-line: #ccd5ef;
  --brand-wash: #f6f8fd;

  /* Нейтральная светлая основа */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-muted: #fafbfd;

  --ink: #14161f;
  --ink-soft: #545a६b;
  --ink-soft: #545a6b;
  --ink-faint: #8b91a3;
  --line: #e4e7f0;
  --line-strong: #d2d7e6;

  --ok: #1d6b47;
  --ok-soft: #e8f4ee;
  --warn: #8a6018;
  --warn-soft: #fbf4e6;
  --err: #a32620;
  --err-soft: #fbeceb;

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(16, 43, 133, .05);
  --shadow: 0 1px 3px rgba(16, 43, 133, .05), 0 10px 30px rgba(16, 43, 133, .07);
  --shadow-lg: 0 3px 8px rgba(16, 43, 133, .06), 0 22px 54px rgba(16, 43, 133, .12);

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 8% -8%, #ffffff 0%, rgba(255,255,255,0) 62%),
    radial-gradient(900px 480px at 102% -2%, var(--brand-soft) 0%, rgba(238,241,250,0) 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Шапка с логотипом
   ========================================================================== */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.topbar__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: .95rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-logo { display: block; height: 44px; width: auto; }

.topbar__meta {
  font-size: .76rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  white-space: nowrap;
}

/* ==========================================================================
   Каркас
   ========================================================================== */

.shell { max-width: 1320px; margin: 0 auto; padding: 1.85rem 1.25rem 4rem; }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

@media (min-width: 900px)  { .layout { grid-template-columns: 318px minmax(0, 1fr); } }
@media (min-width: 1200px) { .layout { grid-template-columns: 340px minmax(0, 1fr) 372px; } }

/* ==========================================================================
   Зона 1 — персональная карточка
   ========================================================================== */

.profile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (min-width: 1200px) { .profile { position: sticky; top: 1.75rem; } }

/* Брендовая лента — геометрия из фирменного стиля, без имитации CRM */
.profile__ribbon {
  position: absolute;
  top: 19px;
  right: -46px;
  transform: rotate(38deg);
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 55%, var(--brand-deep) 100%);
  color: #fff;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: .42rem 3.4rem;
  box-shadow: 0 5px 16px rgba(16, 43, 133, .32);
  z-index: 2;
  white-space: nowrap;
}

/* Портрет вертикальный (2:3). Соотношение блока подобрано под него,
   чтобы кадр не обрезался по пояс и оставался «воздух» студийного фото. */
.profile__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-muted);
}

.profile__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.profile__body { padding: 1.3rem 1.4rem 1.5rem; }

.profile__name {
  font-size: 1.42rem;
  font-weight: 300;
  letter-spacing: .035em;
  line-height: 1.2;
  margin: 0 0 .5rem;
  color: var(--brand);
  text-transform: uppercase;
}

.profile__company {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.15rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--line);
}

.profile__company::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--brand);
  flex: none;
}

.profile__headline {
  font-size: 1.14rem;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: .005em;
  margin: 0 0 .55rem;
}

.profile__sub {
  font-size: .875rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}

.profile__schedule {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .72rem .9rem;
  background: var(--brand-wash);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  font-size: .86rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: .02em;
}

.profile__schedule svg { flex: none; }

/* ==========================================================================
   Панели
   ========================================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.15rem;
}

.panel:last-child { margin-bottom: 0; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel__title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

.panel__note { font-size: .8rem; color: var(--ink-faint); margin: .8rem 0 0; }

/* ==========================================================================
   Календарь
   ========================================================================== */

.cal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.05rem;
}

.cal__month {
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: capitalize;
  margin: 0;
  color: var(--ink);
}

.cal__nav { display: flex; gap: .4rem; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  color: var(--brand);
  transition: border-color .15s, background .15s, color .15s;
}

.icon-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; color: var(--ink-faint); }

.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }

.cal__dow {
  text-align: center;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: .25rem 0 .55rem;
}

.cal__dow--off { color: var(--line-strong); }

.cal__cell {
  aspect-ratio: 1 / 1;
  min-height: 42px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}

.cal__cell--empty { cursor: default; }

.cal__cell--available {
  background: var(--brand-wash);
  border-color: var(--brand-line);
  font-weight: 600;
  color: var(--brand);
}

.cal__cell--available:hover { border-color: var(--brand); background: var(--brand-soft); }

.cal__cell--selected,
.cal__cell--selected:hover {
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 60%, var(--brand-deep) 100%);
  border-color: var(--brand-deep);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 43, 133, .3);
}

.cal__cell--disabled {
  color: #c3c8d6;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
  font-weight: 400;
}

.cal__cell--today:not(.cal__cell--selected) { box-shadow: inset 0 0 0 1.5px var(--brand); }

.cal__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); opacity: .7; }
.cal__cell--selected .cal__dot { background: rgba(255,255,255,.92); opacity: 1; }
.cal__cell--disabled .cal__dot, .cal__cell--empty .cal__dot { visibility: hidden; }

.cal__legend {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-top: 1rem; padding-top: .85rem;
  border-top: 1px solid var(--line);
  font-size: .74rem; color: var(--ink-faint);
}

.cal__legend span { display: inline-flex; align-items: center; gap: .4rem; }

.legend-swatch {
  width: 12px; height: 12px; border-radius: 4px;
  border: 1px solid var(--brand-line); background: var(--brand-wash);
}
.legend-swatch--sel { background: var(--brand); border-color: var(--brand); }
.legend-swatch--off { background: transparent; border-color: transparent; }

/* ==========================================================================
   Слоты
   ========================================================================== */

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }

.slot {
  padding: .62rem .4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: .93rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: border-color .14s, background .14s, color .14s;
}

.slot:hover { border-color: var(--brand); background: var(--brand-wash); color: var(--brand); }

.slot--active, .slot--active:hover {
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 60%, var(--brand-deep) 100%);
  border-color: var(--brand-deep);
  color: #fff;
  box-shadow: 0 5px 14px rgba(16, 43, 133, .26);
}

.slot__owner { display: block; font-size: .67rem; font-weight: 500; color: var(--ink-faint); margin-top: 1px; }
.slot--active .slot__owner { color: rgba(255,255,255,.85); }

/* ==========================================================================
   Длительность
   ========================================================================== */

.durations { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

.chip {
  padding: .5rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 500;
  color: var(--ink); white-space: nowrap;
  transition: border-color .14s, background .14s, color .14s;
}

.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-wash); }
.chip--active, .chip--active:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.duration-select {
  padding: .5rem 2rem .5rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%23545a6b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .8rem center;
  font: inherit; font-size: .86rem; color: var(--ink);
  cursor: pointer; appearance: none; -webkit-appearance: none;
}

.duration-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.duration-select--active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ==========================================================================
   Timezone
   ========================================================================== */

.tz { display: grid; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
@media (min-width: 560px) { .tz--dual { grid-template-columns: 1fr 1fr; } }

.tz__item {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .62rem .8rem;
}

.tz__label {
  display: block; font-size: .63rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .15rem;
}

.tz__value { font-size: .87rem; font-weight: 600; }
.tz__zone { font-size: .74rem; color: var(--ink-faint); font-weight: 400; }
.tz__item--warn { background: var(--warn-soft); border-color: #eedfbd; }
.tz__note { display: block; font-size: .74rem; color: var(--warn); margin-top: .2rem; }

/* ==========================================================================
   Summary + форма
   ========================================================================== */

@media (min-width: 1200px) { .aside { position: sticky; top: 1.75rem; } }

.summary {
  background: linear-gradient(145deg, #ffffff 0%, var(--brand-soft) 100%);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.15rem;
}

.summary__label {
  font-size: .64rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 .5rem;
}

.summary__date {
  font-size: 1.1rem; font-weight: 500; line-height: 1.25;
  margin: 0 0 .5rem; text-transform: capitalize; color: var(--ink);
}

.summary__row { display: flex; justify-content: space-between; gap: 1rem; font-size: .87rem; padding: .15rem 0; }
.summary__row dt { color: var(--ink-soft); margin: 0; }
.summary__row dd { margin: 0; font-weight: 600; text-align: right; }
.summary__zone { display: block; color: var(--ink-faint); font-size: .72rem; font-weight: 400; }

.summary__empty { text-align: center; padding: 1.1rem .5rem; color: var(--ink-faint); font-size: .86rem; }

.field { margin-bottom: 1rem; }

.field__label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.field__req { color: var(--brand); }

.field__input, .field__textarea {
  width: 100%;
  padding: .68rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem;
  color: var(--ink); background: var(--surface);
  transition: border-color .14s, box-shadow .14s;
}

.field__input::placeholder, .field__textarea::placeholder { color: #aab0c0; }

.field__input:focus, .field__textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 43, 133, .11);
}

.field__textarea { min-height: 94px; resize: vertical; line-height: 1.5; }
.field__error { font-size: .78rem; color: var(--err); margin: .3rem 0 0; }
.field__input[aria-invalid='true'], .field__textarea[aria-invalid='true'] { border-color: var(--err); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit; font-size: .92rem; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand) 60%, var(--brand-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 43, 133, .26);
}
.btn--primary:hover { background: var(--brand-deep); }
.btn--primary:disabled { background: #b9c0d8; box-shadow: none; cursor: not-allowed; }

.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-wash); }

.btn--block { width: 100%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 150px; }

/* ==========================================================================
   Состояния
   ========================================================================== */

.state { text-align: center; padding: 2.3rem 1.2rem; }

.state__icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

.state__icon--ok { background: var(--ok-soft); color: var(--ok); }
.state__icon--pending { background: var(--warn-soft); color: var(--warn); }
.state__icon--err { background: var(--err-soft); color: var(--err); }
.state__icon--empty { background: var(--brand-soft); color: var(--brand); }

.state__title { font-size: 1.3rem; font-weight: 500; letter-spacing: .01em; margin: 0 0 .45rem; }
.state__text { color: var(--ink-soft); font-size: .91rem; margin: 0 auto 1.3rem; max-width: 34rem; }

.spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.notice { border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1.05rem; font-size: .88rem; }
.notice--err { background: var(--err-soft); color: var(--err); border: 1px solid #f0cac8; }
.notice--warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #eedfbd; }
.notice__title { font-weight: 700; margin: 0 0 .25rem; }
.notice__text { margin: 0; }

.contacts { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.contacts__title {
  font-size: .66rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 .75rem; text-align: center;
}

.result-card {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  text-align: left;
  max-width: 24rem;
  margin: 0 auto;
}

.comment-echo {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  font-size: .86rem;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  color: var(--ink-soft);
}

/* ==========================================================================
   Подвал
   ========================================================================== */

.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
}

.footer__line {
  font-size: .74rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  margin: 0 0 .4rem;
}

.footer__note {
  font-size: .72rem;
  color: #a4aab9;
  max-width: 44rem;
  margin: 0 auto;
  line-height: 1.55;
}

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

[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 899px) {
  .topbar__inner { padding: .8rem 1rem; }
  .brand-logo { height: 34px; }
  .topbar__meta { display: none; }
  .shell { padding: .75rem .75rem 2rem; }
  .layout { gap: .75rem; }
  .panel { padding: 1rem; border-radius: var(--radius); margin-bottom: .75rem; }
  .profile {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    border-radius: var(--radius);
  }
  .profile__ribbon { display: none; }
  .profile__media { width: 72px; height: 72px; aspect-ratio: 1; margin: .7rem 0 .7rem .7rem; border-radius: 10px; }
  .profile__body { min-width: 0; padding: .6rem .8rem; }
  .profile__name { font-size: 1rem; margin-bottom: .2rem; }
  .profile__company { border: 0; padding: 0; margin: 0; font-size: .58rem; }
  .profile__company::before, .profile__headline, .profile__sub { display: none; }
  .profile__schedule { background: none; border: 0; padding: .3rem 0 0; font-size: .72rem; }
  .profile__schedule svg { width: 14px; height: 14px; }

  .mobile-flow { min-width: 0; }
  .mobile-flow__intro { scroll-margin-top: .75rem; padding: .25rem .15rem .8rem; }
  .mobile-flow__top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
  .mobile-flow__back, .mobile-flow__change {
    border: 0; background: none; color: var(--brand); font: inherit;
    font-size: .85rem; font-weight: 600; padding: .25rem 0; cursor: pointer;
  }
  .mobile-flow__count { color: var(--ink-soft); font-size: .76rem; font-weight: 600; }
  .mobile-flow__progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: .45rem 0 .8rem; }
  .mobile-flow__progress-item { height: 4px; border-radius: 4px; background: var(--line-strong); }
  .mobile-flow__progress-item--active { background: var(--brand); }
  .mobile-flow__title { margin: 0; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
  .mobile-flow__continue { margin: .15rem 0 0; min-height: 48px; }
  .mobile-flow__change { display: block; margin: 0 0 .45rem auto; }
  .mobile-flow .aside { min-width: 0; }
  .mobile-flow .panel:last-child { margin-bottom: 0; }

  .cal__cell { min-height: 44px; }
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
  .slots--dual { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot { min-height: 48px; padding: .5rem .2rem; }
  .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .btn-row .btn { flex: 1 1 100%; }
}

@media (max-width: 380px) {
  .cal__grid { gap: .2rem; }
}
