﻿/* =============================================
   Psych Booking Widget
   ============================================= */

.psych-widget {
  font-family: 'Inter', 'Nunito', sans-serif;
  font-size: 1.05rem;
  max-width: 100%;
  margin: 0;
  background: #ffffff;
  border: 1px solid #c5d0ee;
  border-radius: 16px;
  padding: 0 0 8px;
  box-shadow: 0 4px 24px rgba(107,124,184,0.10);
  color: #242c40;
}

/* ---------- панель выбора ---------- */
.psych-selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid #c5d0ee;
  background: #f4f6fb;
}

.psych-selection-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #6b7cb8;
  border-radius: 10px;
  padding: 8px 14px;
  background: #ffffff;
  flex: 1 1 0;
  min-height: 60px;
  animation: psych-pop .15s ease;
}
@keyframes psych-pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.psych-selection-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #c5d0ee;
  flex-shrink: 0;
}
.psych-selection-card__avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d0d9f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.psych-selection-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8ecf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.psych-selection-card__text {
  display: flex;
  flex-direction: column;
}
.psych-selection-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
  overflow: visible;
}
.psych-selection-card--clickable:hover {
  border-color: #4f5e96;
  box-shadow: 0 2px 12px rgba(107,124,184,0.18);
  background: #f0f3fb;
}

/* Карандашик */
.psych-selection-card--clickable::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: #4f5e96 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E") center/14px no-repeat;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 10;
}
.psych-selection-card--clickable:hover::after {
  opacity: 1;
  transform: scale(1);
}

.psych-selection-card__label {
  font-size: 0.72rem;
  color: #5a6a9a;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.psych-selection-card__value {
  font-size: 0.95rem;
  font-weight: bold;
  color: #242c40;
}

.psych-selection-arrow {
  color: #c5d0ee;
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- табы ---------- */
.psych-tabs {
  display: flex;
  border-bottom: 2px solid #c5d0ee;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.psych-tab {
  flex: 1;
  padding: 16px;
  font-family: inherit;
  font-size: 1rem;
  background: #eef1fb;
  border: none;
  cursor: pointer;
  color: #4f5e96;
  transition: background 0.2s, color 0.2s;
}
.psych-tab--active {
  background: #ffffff;
  color: #242c40;
  font-weight: bold;
  border-bottom: 2px solid #ffffff;
  margin-bottom: -2px;
}
.psych-tab:hover:not(.psych-tab--active) { background: #dde3f5; }

/* ---------- панели ---------- */
.psych-panel { padding: 28px 44px 0; }
.psych-hidden { display: none !important; }

/* ---------- шаг ---------- */
.psych-step__title {
  font-size: 1.3rem;
  margin: 0 0 20px;
  color: #4f5e96;
}

/* ---------- split layout дата+время ---------- */
.psych-datetime-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: flex-start;
}
.psych-datetime-split__right {
  border-left: 1px solid #dde8f0;
  padding-left: 28px;
}
.psych-slots-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.psych-slots-header__title {
  font-weight: 700;
  font-size: 14px;
  color: #242c40;
}
.psych-slots-date-badge {
  background: #e6f7ee;
  color: #1b7a42;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.psych-slots-grouped { display: flex; flex-direction: column; gap: 16px; }
.psych-slots-placeholder__hint {
  font-size: 13px; color: #a0b0c0; margin: 0 0 12px;
  font-style: italic;
}
.psych-slot--placeholder {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.psych-slots-group__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #8fa3b1;
  margin-bottom: 8px;
}
.psych-slots-group__items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* ---------- календарь ---------- */
.psych-calendar { user-select: none; }
.psych-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.psych-cal-nav button {
  background: none;
  border: 1px solid #c5d0ee;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  color: #4f5e96;
}
.psych-cal-nav button:hover { background: #dde3f5; }
.psych-cal-title { font-weight: bold; }

.psych-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.psych-cal-header { text-align: center; font-size: 0.8rem; color: #5a6a9a; padding: 4px 0; }
.psych-cal-day {
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.psych-cal-day:hover:not(.psych-cal-day--disabled):not(.psych-cal-day--empty) {
  background: #d0d9f0;
}
.psych-cal-day--today    { border-color: #6b7cb8; }
.psych-cal-day--selected { background: #6b7cb8; color: #fff; }
.psych-cal-day--disabled { color: #ccc; cursor: default; }
.psych-cal-day--past     { text-decoration: line-through; }
.psych-cal-day--empty    { cursor: default; }
.psych-cal-day--other         { color: #bbb; cursor: pointer; }
.psych-cal-day--other:hover   { background: #eff1f9; }
.psych-cal-day--other-available { color: #242c40; opacity: 0.55; cursor: pointer; }
.psych-cal-day--other-available:hover { background: #d0d9f0; opacity: 1; }

/* ---------- слоты ---------- */
.psych-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.psych-slot {
  padding: 8px 18px;
  border: 1px solid #c5d0ee;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  background: #eef1fb;
  color: #242c40;
  transition: background 0.15s, border-color 0.15s;
}
.psych-slot:hover    { background: #d0d9f0; border-color: #6b7cb8; }
.psych-slot--selected { background: #6b7cb8; color: #fff; border-color: #4f5e96; }

/* ---------- карточки психологов ---------- */
.psych-psychologist-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}
.psych-psychologist-card {
  border: 1.5px solid #dde3f5;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  background: #fff;
}
.psych-psychologist-card:hover {
  border-color: #a4b4e3;
  box-shadow: 0 6px 20px rgba(107,124,184,0.14);
  transform: translateY(-2px);
}
.psych-psychologist-card--selected { border-color: #6b7cb8; background: #f4f6fb; }

/* фото */
.psych-pc__photo-wrap { width: 100%; overflow: hidden; flex-shrink: 0; }
.psych-pc__photo {
  width: 100% !important; height: 200px !important; max-width: none !important;
  object-fit: cover !important; object-position: top !important;
  display: block !important; border-radius: 0 !important; border: none !important; margin: 0 !important;
}
.psych-pc__photo--empty {
  height: 200px; background: linear-gradient(145deg,#c8d3f0,#b0bcdf);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}

/* тело */
.psych-pc__body { padding: 10px 12px 14px; display: flex; flex-direction: column; flex: 1; }
.psych-pc__name {
  font-family: 'Inter', 'Nunito', sans-serif;
  font-weight: bold; font-size: 0.95rem; color: #1a2340; margin: 0 0 5px;
}
.psych-pc__services {
  font-size: 11.5px; color: #5a6a9a; margin: 0 0 10px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.psych-pc__meta { background: #f0f3fb; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.psych-pc__meta-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: #3a4870;
}
.psych-pc__meta-row svg { color: #6b7cb8; flex-shrink: 0; }

.psych-psychologist-card__placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(160deg, #6b7cb8 0%, #4f5e96 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(255,255,255,0.7);
}
.psych-psychologist-card__name {
  font-weight: bold; font-size: 0.95rem; padding: 12px 10px; display: block;
}

/* ---------- карточки услуг (таб 3) ---------- */
.psych-svc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.psych-svc-card {
  border: 2px solid #c5d0ee;
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  background: #f4f6fb;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.psych-svc-card:hover      { border-color: #6b7cb8; box-shadow: 0 2px 8px rgba(107,124,184,0.15); }
.psych-svc-card--selected  { border-color: #4f5e96; background: #dde3f5; }
.psych-svc-card__name      { font-weight: bold; font-size: 1rem; margin-bottom: 4px; }
.psych-svc-card__meta      { font-size: 0.85rem; color: #5a6a9a; }

/* ---------- панель формы — двухколоночная ---------- */
#psych-form-panel.psych-panel:not(.psych-hidden) {
  display: block;
}
.psych-form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.psych-form-col { display: flex; flex-direction: column; }

/* ---------- summary ---------- */
.psych-summary {
  background: #eef1fb;
  border: 1px solid #c5d0ee;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.95rem;
  margin-bottom: 0;
  margin-top: 26px; /* выравниваем с меткой "Комментарий" справа */
}
.psych-summary strong { color: #4f5e96; }

/* ---------- форма ---------- */
.psych-form { max-width: 100%; }
.psych-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin-top: 24px; /* отступ между сводкой и полями */
}
.psych-form__row { margin-bottom: 14px; }
.psych-form__row label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #4f5e96;
}
.psych-form__row input,
.psych-form__row select,
.psych-form__row textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #c5d0ee;
  border-radius: 7px;
  font-family: inherit;
  font-size: 1rem;
  color: #242c40;
  background: #f4f6fb;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.psych-form__row input:focus,
.psych-form__row select:focus,
.psych-form__row textarea:focus {
  border-color: #6b7cb8;
  outline: none;
}
.req { color: #c0392b; }

/* ---------- оплата (placeholder) ---------- */
.psych-payment-placeholder {
  background: #f9f9f9;
  border: 1px dashed #c5d0ee;
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
}
.psych-payment-placeholder h4 { margin: 0 0 6px; color: #4f5e96; }
.psych-payment-placeholder__note {
  font-size: 0.85rem;
  color: #5a6a9a;
  margin: 0 0 12px;
  font-style: italic;
}
.psych-payment-placeholder__fields input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-family: inherit;
  font-size: 1rem;
  color: #aaa;
  background: #eff1f9;
  cursor: not-allowed;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.psych-payment-placeholder__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.psych-payment-placeholder__row input { margin-bottom: 0; }

/* ---------- кнопки ---------- */
.psych-form__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.psych-btn--primary {
  background: #6b7cb8;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.psych-btn--primary:hover { background: #4f5e96; }

.psych-back {
  background: none;
  border: none;
  color: #4f5e96;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 8px;
  display: inline-block;
}
.psych-back:hover { color: #242c40; }

/* ---------- статусы ---------- */
.psych-error {
  background: #fdecea;
  border: 1px solid #e74c3c;
  color: #c0392b;
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.psych-success {
  background: #eafaf1;
  border: 1px solid #27ae60;
  color: #1e8449;
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.psych-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #c5d0ee;
  border-top-color: #6b7cb8;
  border-radius: 50%;
  animation: psych-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes psych-spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .psych-psychologist-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .psych-widget { overflow: hidden; }
  .psych-form-cols { grid-template-columns: 1fr; }
  .psych-form__grid { grid-template-columns: 1fr; }
  .psych-datetime-split__left,
  .psych-datetime-split__right { min-width: 0; max-width: 100%; }
  #psych-calendar { width: 100%; box-sizing: border-box; }
  .psych-cal-nav { width: 100%; box-sizing: border-box; }
  .psych-cal-grid { width: 100%; box-sizing: border-box; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .psych-slots-group__items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .psych-widget { margin: 12px; border-radius: 8px; }
  .psych-panel { padding: 16px 12px 0; }
  .psych-form__actions { flex-direction: column; align-items: stretch; }
  .psych-cal-grid { gap: 2px; }
  .psych-cal-day { padding: 6px 1px; font-size: 0.82rem; }
  .psych-cal-header { font-size: 0.7rem; padding: 4px 0; }
  .psych-slot { padding: 7px 10px; font-size: 0.88rem; }
}

