* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #74A095;
    --primary-dark: #5A8A7F;
    --primary-light: #A8C8BD;
    --accent: #FF9A76;
    --accent-dark: #E87A56;
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text: #2D3748;
    --text-light: #718096;
    --error: #FF6B6B;
    --success: #4CAF50;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #74A095 0%, #5A8A7F 100%);
    --gradient-accent: linear-gradient(135deg, #FF9A76 0%, #E87A56 100%);
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: var(--gradient-primary);
    z-index: -1;
    border-radius: 0 0 50% 50%;
    transform: scale(1.5);
}

/* Экраны */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовки */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Карточки */
.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

/* Начальный экран - Регистрация */
.auth-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(116, 160, 149, 0.3);
}

.auth-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.auth-card p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.5;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.auth-btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 6px 20px rgba(116, 160, 149, 0.4);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-3px);
}

.auth-btn:active {
    transform: translateY(-1px);
}

.auth-btn svg {
    width: 20px;
    height: 20px;
}

/* Формы регистрации */
.auth-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    background-color: var(--surface);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(116, 160, 149, 0.2);
}

.form-group input:invalid {
    border-color: var(--error);
}

.form-group input:invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 113, 113, 0.2);
}

.form-group input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Навигационные кнопки */
.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
}

.nav-btn {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    min-height: 60px;
    overflow: hidden;
}

.nav-btn:not(.active) {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.nav-btn.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn svg {
    width: 20px;
    height: 16px;
    transition: var(--transition);
}

.nav-btn:hover svg {
    transform: scale(1.1);
}

/* Отображение выбранного кабинета */
.selected-cabinet-display {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    box-shadow: var(--shadow);
}

.selected-cabinet-display strong {
    font-weight: 600;
}

#selected-cabinet-text {
    font-weight: 700;
    font-size: 18px;
}

/* Выпадающий список кабинетов */
.room-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    right: 50%;
    background-color: var(--surface);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    z-index: 10;
    display: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.room-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-option {
    padding: 16px 20px;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.room-option:last-child {
    border-bottom: none;
}

.room-option:hover {
    background-color: rgba(116, 160, 149, 0.1);
    color: var(--primary);
}

/* Календарь */
.calendar-section {
    margin-bottom: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.calendar-nav {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.calendar-nav:hover {
    background-color: rgba(116, 160, 149, 0.1);
}

.calendar-nav:disabled {
    color: var(--text-light);
    cursor: not-allowed;
}

.calendar-nav:disabled:hover {
    background-color: transparent;
}

.calendar {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    padding: 8px;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.date:hover:not(.disabled) {
    background-color: rgba(116, 160, 149, 0.1);
    transform: scale(1.1);
}

.date.selected {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(116, 160, 149, 0.4);
    transform: scale(1.1);
}

.date.disabled {
    color: #bbb;
    cursor: not-allowed;
    background-color: transparent;
}

.date.placeholder {
    visibility: hidden;
}

.date.today::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
}

/* Временные слоты */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.time-slot {
    padding: 14px 8px;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.time-slot:hover:not(.occupied)::before {
    opacity: 0.1;
}

.time-slot.selected {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 6px 15px rgba(116, 160, 149, 0.4);
    transform: translateY(-3px);
    position: relative;
}

.time-slot.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 12px;
    font-weight: bold;
}

.time-slot.occupied {
    background-color: var(--error);
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

.time-slot.passed {
    background-color: #999;
    opacity: 0.5;
}

/* Кнопка подтверждения */
.confirm-btn {
    width: 100%;
    padding: 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(116, 160, 149, 0.4);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.confirm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.confirm-btn:hover::before {
    left: 100%;
}

.confirm-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(116, 160, 149, 0.5);
}

.confirm-btn:active {
    transform: translateY(-1px);
}

/* Экран подтверждения */
.booking-details {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    margin-bottom: 30px;
    text-align: left;
    color: white;
    position: relative;
    overflow: hidden;
}

.booking-details::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.booking-details h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
}

.booking-details p {
    font-size: 16px;
    margin-bottom: 12px;
    position: relative;
}

/* Форма бронирования */
.booking-form {
    margin-top: 25px;
}

.payment-selector {
    margin-top: 25px;
}

.payment-selector select {
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--gradient-primary);
    color: #618f84;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
}

.payment-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 160, 149, 0.3);
}

/* Экран бронирований */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.booking-item {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.booking-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.booking-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.booking-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge.confirmed {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.status-badge.paid {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success);
}

.status-badge.pending {
    background-color: rgba(255, 154, 118, 0.1);
    color: #FF9A76;
}

.status-badge.completed {
    background-color: rgba(113, 128, 150, 0.1);
    color: #718096;
}

.booking-info {
    margin-bottom: 20px;
}

.booking-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text);
}

.booking-info svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.cancel-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--error) 0%, #e05555 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

/* Список всех бронирований */
.booking-summary {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    gap: 15px;
    box-shadow: var(--shadow);
}

.booking-summary:hover {
    background-color: rgba(116, 160, 149, 0.05);
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.booking-icon {
    color: var(--primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(116, 160, 149, 0.1);
    border-radius: 50%;
}

.booking-text {
    flex: 1;
}

.booking-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.booking-date {
    font-size: 14px;
    color: var(--text-light);
}

.booking-status-small {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.booking-status-small.pending {
    color: #FF9A76;
}

.booking-status-small.paid {
    color: var(--success);
}

.booking-status-small.completed {
    color: #718096;
}

.booking-arrow {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.booking-summary:hover .booking-arrow {
    transform: translateX(5px);
}

/* Модальные окна */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 30px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--text);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.modal-btn.secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

/* Переключатели Мои/Все */
.toggle-buttons {
    display: flex;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
    padding: 4px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-light);
}

.toggle-btn.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Адаптивность */
@media (max-width: 380px) {
    body {
        padding: 15px;
    }
    
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .booking-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .booking-status {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .auth-card {
        padding: 20px;
    }
    
    .auth-icon {
        width: 60px;
        height: 60px;
    }
    
    .auth-icon svg {
        width: 30px;
        height: 30px;
    }
}

/* Дополнительные стили для улучшенного UX */
button:active {
    transform: scale(0.98);
}

.time-slot:active:not(.occupied) {
    transform: scale(0.95);
}

.date:active:not(.disabled) {
    transform: scale(0.95);
}

/* Анимация загрузки */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.notification.success .notification-icon {
    background-color: var(--success);
}

.notification.error .notification-icon {
    background-color: var(--error);
}

/* Плавные анимации появления */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Стили для мобильных устройств */
@media (max-width: 320px) {
    header h1 {
        font-size: 28px;
    }
    
    header p {
        font-size: 14px;
    }
    
    .time-slots {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .booking-details {
        padding: 20px 15px;
    }
    
    .auth-card h2 {
        font-size: 20px;
    }
    
    .auth-card p {
        font-size: 14px;
    }
}