@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/Nunito-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/Nunito-Medium.woff2') format('woff2'),
       url('/assets/fonts/Nunito-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/Nunito-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --accent: #1f6feb;
  --accent-soft: #e8f0ff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e2e8f0;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #f8fafc 0%, #eef2f8 45%, #e5ecf8 100%);
}

a {
  color: inherit;
}

.page {
  min-height: 100vh;
  padding: 18px 16px 32px;
  max-width: 980px;
  margin: 0 auto;
}

.clinic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.clinic__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clinic__name {
  font-size: 1.45rem;
  font-weight: 700;
}

.clinic__badge {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.clinic__meta {
  margin-top: 10px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.clinic__contacts {
  margin-top: 12px;
}

.clinic__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.step__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.step__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.step__note {
  font-size: 0.95rem;
  color: var(--muted);
}

.step__link {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.step__link:hover {
  text-decoration: underline;
}

.dentists {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.dentist-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dentist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
  border-color: #cbd5f5;
}

.dentist-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}

.dentist-card__photo-wrap {
  width: 86px;
  height: 86px;
  border-radius: 16px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dentist-card__photo {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  object-fit: cover;
}

.dentist-card__content {
  display: grid;
  gap: 4px;
}

.dentist-card__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

.dentist-card__position {
  font-size: 0.92rem;
  color: var(--muted);
}

.dentist-card__mini {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.mini-time {
  padding: 8px 6px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.mini-time.is-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.mini-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.dentist-card__rating,
.dentist-card__chip,
.dentist-card__info,
.dentist-card__action {
  display: none;
}

.week {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  padding-bottom: 4px;
}

.day {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 8px 6px;
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.day__label {
  font-size: 0.7rem;
  color: var(--muted);
}

.day__weekday {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.day__date {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

.day.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.day.is-selected .day__weekday,
.day.is-selected .day__label {
  color: var(--accent);
}

.times {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.time {
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.time:hover {
  transform: translateY(-1px);
}

.time.is-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: transparent;
}

.time.is-selected {
  background: #0f4ab8;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
}

.form {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.form.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

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

.field input,
.field textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  background: #ffffff;
}

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

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.message.is-error {
  background: #fff1f2;
  color: #b91c1c;
  border: 1px solid #fecdd3;
}

.message.is-success {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.message.is-hidden {
  display: none;
}

.success {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.success__title {
  font-weight: 800;
  margin-bottom: 6px;
}

.success.is-hidden {
  display: none;
}

.empty,
.skeleton {
  padding: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.is-hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.is-hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal__card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  width: min(92vw, 420px);
  box-shadow: var(--shadow);
  z-index: 1;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal__title {
  font-weight: 700;
  font-size: 1.1rem;
}

.modal__close {
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.modal__subtitle {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.modal__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (min-width: 900px) {
  .dentists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page {
    padding: 32px 24px 48px;
  }
}
