/* =============================================================
   DentalART · Booking Modal · custom styles
   Дополняет Tailwind с CDN. Использует существующие цвета сайта.
   Все классы с префиксом .da- чтобы не задеть основные стили.
   ============================================================= */

/* ---- глобальный скролл-лок ---- */
html.da-modal-open,
body.da-modal-open {
  overflow: hidden !important;
}

/* ---- модалка: показ/скрытие ---- */
#da-booking-modal.hidden { display: none !important; }
#da-booking-modal {
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Android mobile fix: 100svh не работает в Chrome < 108, URL-bar
        и клавиатура съедают высоту. Делаем панель на mobile во весь экран
        с fallback на 100vh → 100dvh для современных бровзеров. ---- */
@media (max-width: 639px) {
  #da-booking-modal .da-dialog {
    align-items: stretch !important;
    padding: 0 !important;
  }
  #da-booking-modal .da-panel {
    height: 100vh;             /* fallback */
    height: 100dvh;            /* modern */
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
#da-booking-modal h2,
#da-booking-modal h3,
#da-booking-modal h4 {
  font-family: 'Onest', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* fade-in backdrop + slide-up panel */
#da-booking-modal .da-backdrop {
  opacity: 0;
  transition: opacity .28s cubic-bezier(.22,1,.36,1);
}
#da-booking-modal .da-panel {
  transform: translateY(24px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s cubic-bezier(.22,1,.36,1);
}
#da-booking-modal.is-open .da-backdrop { opacity: 1; }
#da-booking-modal.is-open .da-panel    { transform: translateY(0); opacity: 1; }

@media (min-width: 640px) {
  #da-booking-modal .da-panel { transform: translateY(40px) scale(.98); }
  #da-booking-modal.is-open .da-panel { transform: translateY(0) scale(1); }
}

/* ---- prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  #da-booking-modal .da-backdrop,
  #da-booking-modal .da-panel,
  #da-booking-modal .da-step,
  #da-booking-modal .da-spinner {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ============================================================
   PROGRESS / STEPPER
   ============================================================ */
.da-progress { user-select: none; }
.da-step-dot {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .25rem;
  flex: 0 0 auto;
  position: relative;
}
.da-dot-num {
  width: 28px; height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F0EEE9; /* softGray */
  color: #57534E;      /* inkMuted */
  font-weight: 700;
  font-size: 13px;
  font-family: 'Onest', sans-serif;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.da-dot-label {
  font-size: 12px;
  font-weight: 600;
  color: #57534E;
  white-space: nowrap;
  transition: color .25s ease;
}
@media (max-width: 480px) {
  .da-dot-label { display: none; }
}
.da-step-dot.is-active .da-dot-num {
  background: #2A6B68;
  color: #fff;
  transform: scale(1.05);
}
.da-step-dot.is-active .da-dot-label { color: #143432; }
.da-step-dot.is-done .da-dot-num {
  background: #C7DDDB;
  color: #1C4744;
}
.da-step-dot.is-done .da-dot-label { color: #235955; }

.da-step-bar {
  flex: 1 1 auto;
  height: 2px;
  background: #F0EEE9;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.da-step-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: #2A6B68;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.da-step-bar.is-done::after { transform: scaleX(1); }

/* ============================================================
   STEPS · общая анимация смены
   ============================================================ */
.da-step {
  animation: daStepIn .35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes daStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STEP 1 · service cards
   ============================================================ */
.da-service-card {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #F0EEE9;
  border-radius: 1.25rem;
  box-shadow: 0 10px 40px -28px rgba(20, 52, 50, 0.18);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.da-service-card:hover,
.da-service-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -32px rgba(20, 52, 50, 0.35);
  border-color: #9CC2BF;
  outline: none;
}
.da-service-card:focus-visible {
  outline: 2px solid #2A6B68;
  outline-offset: 3px;
}
.da-service-icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.da-service-body { flex: 1 1 auto; min-width: 0; }
.da-service-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 9999px;
}
.da-service-title {
  margin-top: .4rem;
  font-family: 'Onest', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #292524;
  line-height: 1.25;
}
.da-service-desc {
  margin-top: .35rem;
  font-size: .875rem;
  color: #57534E;
  line-height: 1.45;
}
.da-service-cta {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: .35rem;
  align-self: center;
  color: #2A6B68;
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .da-service-cta { display: inline-flex; }
}
.da-service-card:hover .da-service-cta { color: #E87A5D; }

/* ============================================================
   STEP 2 · даты + слоты
   ============================================================ */
.da-dates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: .5rem;
}
.da-date-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .55rem .25rem;
  border-radius: .9rem;
  border: 1px solid #F0EEE9;
  background: #fff;
  font-family: 'Onest', sans-serif;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease;
  min-height: 64px;
}
.da-date-btn:hover:not([disabled]) {
  border-color: #9CC2BF;
  transform: translateY(-2px);
}
.da-date-btn .dow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #57534E;
}
.da-date-btn .dnum {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #292524;
}
.da-date-btn .dmon {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #57534E;
}
.da-date-btn[disabled] {
  background: #F0EEE9;
  opacity: .55;
  cursor: not-allowed;
}
.da-date-btn[disabled] .dnum { color: #57534E; }
.da-date-btn.is-today {
  border-color: #E4B363;
}
.da-date-btn.is-selected {
  background: #2A6B68;
  border-color: #2A6B68;
  color: #fff;
}
.da-date-btn.is-selected .dow,
.da-date-btn.is-selected .dnum,
.da-date-btn.is-selected .dmon { color: #fff; }

/* ---- слоты ---- */
.da-slots {
  min-height: 60px;
}
.da-slot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .4rem;
  border-radius: .75rem;
  border: 1px solid #F0EEE9;
  background: #fff;
  color: #292524;
  font-family: 'Onest', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease;
}
.da-slot-btn:hover:not([disabled]) {
  border-color: #2A6B68;
  color: #2A6B68;
  transform: translateY(-1px);
}
.da-slot-btn[disabled] {
  background: #F0EEE9;
  color: #A8A29E;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: #A8A29E;
  text-decoration-thickness: 1px;
}
.da-slot-btn.is-selected {
  background: #2A6B68;
  border-color: #2A6B68;
  color: #fff;
}

/* ---- loader ---- */
.da-slots-loader {
  text-align: center;
  padding: 1.25rem 0;
}
.da-spinner {
  width: 28px; height: 28px;
  border: 3px solid #C7DDDB;
  border-top-color: #2A6B68;
  border-radius: 9999px;
  margin: 0 auto;
  animation: daSpin .85s linear infinite;
}
@keyframes daSpin { to { transform: rotate(360deg); } }

/* ============================================================
   STEP 3 · форма
   ============================================================ */
.da-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .85rem 1rem;
  background: #EAF3F2;
  border-radius: 1rem;
  border: 1px solid #C7DDDB;
}
.da-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: #143432;
  font-weight: 500;
  background: #fff;
  padding: .3rem .65rem;
  border-radius: 9999px;
  border: 1px solid #C7DDDB;
}
.da-summary-pill strong {
  font-family: 'Onest', sans-serif;
  font-weight: 700;
}

.da-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #57534E;
  margin-bottom: .4rem;
}
.da-input {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid #F0EEE9;
  background: #FAF9F6;
  border-radius: .85rem;
  color: #292524;
  font-size: .95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  outline: none;
}
.da-input::placeholder { color: #A8A29E; }
.da-input:focus {
  border-color: #2A6B68;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 107, 104, 0.18);
}
.da-input.is-invalid {
  border-color: #E87A5D;
  background: #fff5f1;
}
.da-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(232, 122, 93, 0.18);
}
.da-textarea {
  resize: vertical;
  min-height: 88px;
  font-family: 'Inter', sans-serif;
}

.da-field-error {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: #C2624A;
  font-weight: 500;
}
.da-form-error {
  margin-top: .25rem;
  padding: .65rem .9rem;
  background: #fff5f1;
  border: 1px solid #E87A5D;
  border-radius: .85rem;
  color: #C2624A;
  font-size: .85rem;
  font-weight: 500;
}

/* ---- checkbox ---- */
.da-checkbox {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  user-select: none;
}
.da-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.da-checkbox-box {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border: 1.5px solid #C7DDDB;
  background: #fff;
  border-radius: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  margin-top: 1px;
}
.da-checkbox input:focus-visible + .da-checkbox-box {
  outline: 2px solid #2A6B68;
  outline-offset: 2px;
}
.da-checkbox input:checked + .da-checkbox-box {
  background: #2A6B68;
  border-color: #2A6B68;
  color: #fff;
}
.da-checkbox-text {
  font-size: .85rem;
  line-height: 1.45;
  color: #57534E;
}
.da-link {
  color: #2A6B68;
  text-decoration: underline;
  text-decoration-color: rgba(42,107,104,.4);
  text-underline-offset: 2px;
  transition: color .2s ease;
}
.da-link:hover { color: #E87A5D; }

/* ============================================================
   SUCCESS / ERROR
   ============================================================ */
.da-success-icon,
.da-error-icon {
  width: 76px; height: 76px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.da-success-icon {
  background: rgba(42, 107, 104, .12);
  color: #2A6B68;
  animation: daPop .45s cubic-bezier(.22,1.4,.36,1) both;
}
.da-error-icon {
  background: rgba(232, 122, 93, .15);
  color: #C2624A;
}
@keyframes daPop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.da-success-card {
  margin: 1.5rem auto 0;
  max-width: 360px;
  text-align: left;
  background: #fff;
  border: 1px solid #F0EEE9;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 40px -28px rgba(20,52,50,.2);
}
.da-success-card dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #57534E;
}
.da-success-card dd {
  font-family: 'Onest', sans-serif;
  font-weight: 700;
  color: #143432;
  margin: .15rem 0 .65rem 0;
}
.da-success-card dl > div + div { margin-top: .25rem; }

/* ============================================================
   BUTTONS (unified inside modal)
   ============================================================ */
.da-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .8rem 1.4rem;
  border-radius: 9999px;
  font-family: 'Onest', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
  white-space: nowrap;
}
.da-btn:focus-visible {
  outline: 2px solid #2A6B68;
  outline-offset: 3px;
}
.da-btn:active { transform: scale(.98); }

.da-btn-primary {
  background: #E87A5D;
  color: #fff;
  box-shadow: 0 10px 40px -20px rgba(20,52,50,.4);
}
.da-btn-primary:hover { background: #C2624A; }
.da-btn-primary[disabled] {
  background: #C7DDDB;
  cursor: not-allowed;
  box-shadow: none;
  color: #fff;
}

.da-btn-ghost {
  background: transparent;
  color: #292524;
  border-color: #F0EEE9;
}
.da-btn-ghost:hover {
  background: #F0EEE9;
  border-color: #C7DDDB;
}

/* loading state */
.da-btn.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.da-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: daSpin .8s linear infinite;
}
.da-btn-ghost.is-loading::after {
  border-color: rgba(42,107,104,.25);
  border-top-color: #2A6B68;
}

/* ============================================================
   SCROLLBAR (modal body)
   ============================================================ */
.da-body::-webkit-scrollbar { width: 8px; }
.da-body::-webkit-scrollbar-track { background: transparent; }
.da-body::-webkit-scrollbar-thumb {
  background: #E4DFD6;
  border-radius: 8px;
}
.da-body::-webkit-scrollbar-thumb:hover { background: #C7DDDB; }

/* ============================================================
   утилиты
   ============================================================ */
.da-hidden { display: none !important; }
