/* =========================================
   ОБЩИЕ КОНТЕЙНЕРЫ И БАЗА
   ========================================= */
.online-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.hidden { display: none !important; }
.active { display: block !important; }

.msg {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-size: 14px;
}
.msg.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.msg.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.msg.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.btn-back-link {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
}
.btn-back-link:hover { color: #2980b9; }

.loader-container { text-align: center; padding: 40px 20px; color: #7f8c8d; }
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3; border-top: 4px solid #3498db;
    border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-box {
    background: #fff3f3; border: 1px solid #ffcdd2; color: #c62828;
    padding: 15px; border-radius: 8px; text-align: left; margin: 10px 0;
}
.error-box h4 { margin-top: 0; margin-bottom: 5px; }

.no-data, .no-slots-msg {
    text-align: center; color: #999; padding: 20px; font-style: italic;
}

/* =========================================
   ШАГ 1: НАПРАВЛЕНИЯ (Бренд FF7349)
   ========================================= */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.direction-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.direction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 115, 73, 0.15);
    border-color: #FF7349;
}

.dir-icon-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF5F2;
    border-radius: 50%;
    color: #FF7349;
    overflow: hidden;
}

.dir-icon-wrapper svg {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.dir-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.3;
    margin: 0;
}

/* =========================================
   ШАГ 2: УСЛУГИ
   ========================================= */
.services-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.service-item-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.service-item-horizontal:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.svc-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 15px;
}
.svc-info .meta {
    font-size: 13px;
    color: #7f8c8d;
}
.svc-arrow {
    font-size: 20px;
    color: #bdc3c7;
}

/* =========================================
   ШАГ 3: РАСПИСАНИЕ (Даты + Врачи)
   ========================================= */
.dates-scroller-wrapper {
    position: relative;
    margin-bottom: 20px;
    padding: 0 40px;
}

.dates-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 5px 0;
}
.dates-track::-webkit-scrollbar { display: none; }

.date-pill {
    min-width: 75px;
    height: 70px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    flex-shrink: 0;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.date-pill:hover {
    border-color: #3498db;
    background: #f9fcff;
    transform: translateY(-2px);
}

.date-pill.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52,152,219,0.3);
    transform: scale(1.05);
}

.dp-day {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.dp-num {
    font-size: 16px;
    font-weight: bold;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 18px;
    transition: all 0.2s;
}
.scroll-btn:hover {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52,152,219,0.25);
}
.scroll-btn.left { left: 0; }
.scroll-btn.right { right: 0; }

.doctors-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.doctor-schedule-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s;
}
.doctor-schedule-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.ds-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sched-doc-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sched-doc-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #7f8c8d;
}

.ds-info strong {
    display: block;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 2px;
}
.ds-spec {
    font-size: 13px;
    color: #7f8c8d;
}

.ds-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 8px;
}

.time-slot-mini {
    padding: 10px 0;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.time-slot-mini:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

/* =========================================
   ШАГ 4: ПОДТВЕРЖДЕНИЕ (Форма + Детали)
   ========================================= */
.confirm-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .confirm-layout {
        flex-direction: column-reverse;
    }
}

.confirm-form-side {
    flex: 1;
}

.confirm-details-side {
    flex: 1;
    background: #f9fafb;
    border-radius: 12px;
    padding: 25px;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    height: fit-content;
}

.details-panel h4 {
    margin-top: 0;
    color: #6b7280;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}
.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.label {
    color: #9ca3af;
    font-size: 13px;
}
.value.big {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}
.value.medium {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}
.accent {
    color: #059669;
    font-weight: bold;
}

.detail-section {
    margin-bottom: 20px;
}
.section-label {
    display: block;
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 5px;
}
.section-value {
    color: #111827;
    font-size: 15px;
    line-height: 1.4;
}
.section-value.bold {
    font-weight: 600;
}
.section-value.address {
    color: #4b5563;
    font-style: normal;
    font-size: 14px;
}

.detail-row-flex {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #d1d5db;
}
.flex-col {
    display: flex;
    flex-direction: column;
}
.right-align {
    text-align: right;
}
.mt-auto {
    margin-top: auto;
    padding-top: 20px;
}

.styled-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin-bottom: 15px;
}
.styled-input:focus {
    outline: none;
    border-color: #3498db;
    background: #fff;
}
textarea.styled-input {
    resize: vertical;
    min-height: 80px;
}

#online-phone::placeholder {
    color: #aaa;
}

.contact-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}
.method-option {
    position: relative;
    cursor: pointer;
}
.method-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.method-label {
    display: block;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
}
.method-option:hover .method-label {
    border-color: #bbb;
}
.method-option input:checked + .method-label {
    background: #FFF5F2;
    border-color: #FF7349;
    color: #FF7349;
    font-weight: bold;
}

.mb-15 {
    margin-bottom: 15px;
}

.privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7280;
}
.privacy-check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #FF7349;
}

.btn-primary.large {
    padding: 16px;
    font-size: 16px;
    width: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-primary.large:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.btn-primary.large:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
    font-size: 14px;
}
.btn-secondary:hover {
    background: #dfe6e9;
}

/* =========================================
   ШАГ 5: ФИНАЛЬНЫЙ ЭКРАН (SUCCESS)
   ========================================= */
.success-screen {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 60px;
    color: #2ecc71;
    margin-bottom: 10px;
}

.final-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 20px auto;
    text-align: left;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ccc;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-secondary-outline {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-secondary-outline:hover {
    background: #ebf5fb;
}

.btn-primary-medium {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-primary-medium:hover {
    opacity: 0.9;
}

.map-frame-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
}

.map-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
    .half {
        width: 100%;
        margin-bottom: 10px;
    }
    .directions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .action-buttons {
        flex-direction: column;
    }
    .card-header-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== LD UNIFY v5 ===== */
/* Активная пилюля/слот — фирменный оранжевый ВЕЗДЕ (перебиваем синий оригинала и тему) */
.date-pill.active, .date-pill.selected,
.time-slot-mini.active, .time-slot-mini.selected{
  background:#FF7349 !important; color:#fff !important; border-color:#e65a32 !important;
  box-shadow:0 4px 12px rgba(255,115,73,.3) !important;
}
/* страховка от inline-синего, который JS врача вешает на выбранный слот */
.time-slot-mini[style*="3498db"], .date-pill[style*="3498db"]{
  background:#FF7349 !important; color:#fff !important; border-color:#e65a32 !important;
}
/* Единая сетка времени на обеих страницах */
.ds-times-grid, .times-grid, .inline-times-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,minmax(70px,1fr)) !important;
  gap:10px !important; width:100% !important; box-sizing:border-box !important;
}

/* ---- ТОЛЬКО страница врача: стрелка вправо + свайп + конец обрезке ---- */
/* position:relative возвращает absolute-стрелки внутрь блока виджета */
.doctor-inline-booking-widget .dates-scroller-wrapper{
  position:relative !important;
  padding:0 38px !important;          /* места под ‹ и ›, чтобы не накрывали пилюли */
  box-sizing:border-box !important;
}
/* min-width:0 + overflow = трек скроллится внутри себя, а не распирает родителя */
.doctor-inline-booking-widget .inline-dates-track{
  min-width:0 !important;
  overflow-x:auto !important;
  -webkit-overflow-scrolling:touch !important;   /* инерционный свайп в WebView */
  scrollbar-width:none !important;
}
.doctor-inline-booking-widget .inline-dates-track::-webkit-scrollbar{ display:none !important; }

@media (max-width:768px){
  .doctor-inline-booking-widget .dates-scroller-wrapper{ padding:0 32px !important; }
  .ds-times-grid, .times-grid, .inline-times-grid{
    grid-template-columns:repeat(auto-fill,minmax(64px,1fr)) !important; gap:8px !important;
  }
}