/* ============================================
   ОСНОВНІ СТИЛІ - ГРАДІЄНТ ТА КОНТЕЙНЕР
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.top-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.top-header .city-selector,
.top-header .header-time,
.top-header .login-btn {
    flex: 1 1 auto;
    min-width: 150px;
}

.header-time {
    font-size: 14px;
    color: #555;
    text-align: center;
    font-weight: 500;
}

.login-btn {
    display: inline-flex;
    justify-content: flex-end;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }
    .top-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .top-header .login-btn {
        justify-content: center;
    }
}

.booking-container {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px 24px 0 0;
    padding: 24px 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 600px) {
    .booking-container {
        max-width: 500px;
        border-radius: 24px;
        padding: 40px 20px;
        min-height: auto;
    }
}

.booking-title {
    text-align: center;
    margin-bottom: 20px;
}

.booking-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.booking-subtitle {
    font-size: 13px;
    color: #666;
}

/* ============================================
   ПРОГРЕСС БАР
   ============================================ */
.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a1a1a 0%, #3a3a3a 100%);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* ============================================
   СТИЛІ КРОКІВ З АНІМАЦІЄЮ ВИПАРОВУВАННЯ
   ============================================ */
.input-step {
    display: none;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-step.active {
    display: block;
}

.input-step.fade-out {
    animation: fadeOutUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.input-description {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    letter-spacing: -0.2px;
}

.btn-back-floating {
    position: absolute;
    top: 16px;
    left: 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #1a1a1a;
    font-weight: 500;
    transition: transform 0.2s;
    padding: 6px 10px;
}

.btn-back-floating:hover {
    transform: translateX(-4px);
}

/* ============================================
   ПОЛЕ ВВЕДЕННЯ
   ============================================ */
.input-field-wrapper {
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.6);
    color: #1a1a1a;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.input-field:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.input-field::placeholder {
    color: #999;
}

/* ============================================
   ГОРИЗОНТАЛЬНА ЛЕНТА ДАТА (iPhone 15 оптимізована)
   ============================================ */
.dates-horizontal {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.dates-horizontal::-webkit-scrollbar {
    height: 3px;
}

.dates-horizontal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.dates-horizontal::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.date-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: center;
    flex-shrink: 0;
}

.date-item .date-day {
    font-size: 10px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.date-item .date-number {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1;
}

/* АКТИВНА ДАТА */
.date-item.active {
    background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
    border-color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.date-item.active .date-day {
    color: rgba(255, 255, 255, 0.7);
}

.date-item.active .date-number {
    color: white;
}

/* СЕРАЯ ЗАЛИВКА, ЯКА ПОДНІМАЄТЬСЯ */
.date-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #e2e4e9;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: 10px;
}

.date-item:hover::before {
    height: 100%;
}

/* ============================================
   СЕКЦІЯ ЧАСІВ
   ============================================ */
.times-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.times-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
}

/* ============================================
   СІТКА ЧАСІВ (iPhone 15 оптимізована)
   ============================================ */
.times-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

@media (min-width: 390px) {
    .times-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.time-slot {
    position: relative;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: #444;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

/* СЕРАЯ ЗАЛИВКА, ЯКА ПОДНІМАЄТЬСЯ */
.time-slot::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #e2e4e9;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

/* ТЕМНА ЛІНІЯ, ЯКА ВИЇЖДЖАЄ З ЦЕНТРА */
.time-slot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px 2px 0 0;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* АКТИВНИЙ ЧАС */
.time-slot.active {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    font-weight: 600;
    color: #000;
    transform: scale(1.05);
}

.time-slot.active::before {
    height: 100%;
}

.time-slot.active::after {
    width: 60%;
}

/* ============================================
   ВИБІР МАЙСТРІВ ТА ПОСЛУГ
   ============================================ */
.masters-list,
.services-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.master-item,
.service-item {
    position: relative;
    flex: 1 1 calc(50% - 12px);
    min-width: 130px;
    padding: 16px 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

@media (min-width: 380px) {
    .master-item,
    .service-item {
        flex: 1 1 calc(33.333% - 12px);
    }
}

/* СЕРАЯ ЗАЛИВКА, ЯКА ПОДНІМАЄТЬСЯ */
.master-item::before,
.service-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #e2e4e9;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

/* ТЕМНА ЛІНІЯ, ЯКА ВИЇЖДЖАЄ З ЦЕНТРА */
.master-item::after,
.service-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #1a1a1a;
    border-radius: 3px 3px 0 0;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.master-name,
.service-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), font-weight 0.2s, color 0.2s;
    transform-origin: center center;
    line-height: 1.2;
}

/* АКТИВНЕ СТАНУ */
.master-item.active,
.service-item.active {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.master-item.active::before,
.service-item.active::before {
    height: 100%;
}

.master-item.active::after,
.service-item.active::after {
    width: 70%;
}

.master-item.active .master-name,
.service-item.active .service-name {
    transform: scale(1.06);
    font-weight: 600;
    color: #000;
}



/* ============================================
   КНОПКИ
   ============================================ */
.btn-restart {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-restart:active {
    transform: translateY(0);
}

/* ============================================
   ПІДТВЕРДЖЕННЯ
   ============================================ */
.confirmation-box {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: 60px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.confirmation-box h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.confirmation-details {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: left;
}

.confirmation-details p {
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.6;
}

.confirmation-details strong {
    color: #2e7d32;
}