/* ============================================
   Современный UI с сине-голубой цветовой схемой
   Best Practices: Material Design + iOS Style
   ============================================ */

   :root {
    /* Цветовая палитра - фиолетовый и белый */
    --primary-purple: #3A2F5C;
    --primary-purple-light: #5A4F8C;
    --primary-purple-dark: #2A1F4C;
    --accent-white: #FFFFFF;
    --accent-white-soft: rgba(255, 255, 255, 0.9);
    
    /* Нейтральные цвета */
    --white: #FFFFFF;
    --gray-50: #F9F8FB;
    --gray-100: #F0EFF4;
    --gray-200: #E5E3EB;
    --gray-300: #D0CEE0;
    --gray-400: #B0AEC4;
    --gray-500: #8B8BA8;
    --gray-600: #6E6C88;
    --gray-700: #565472;
    --gray-800: #3E3C58;
    --gray-900: #2A2840;
    
    /* Статусы */
    --success: #4ECDC4;
    --success-light: #81DFD9;
    --warning: #FF9800;
    --error: #FF6B6B;
    --info: #5A4F8C;
    
    /* Тени */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.15);
    
    /* Радиусы */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Предотвращение переполнения текста */
body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Для всех текстовых элементов */
h1, h2, h3, h4, h5, h6, p, span, div, label {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #3A2F5C 0%, #2A1F4C 100%);
    color: var(--white);
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 32px;
    box-sizing: border-box;
}

/* ============================================
   ВКЛАДКИ (Tabs)
   ============================================ */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: var(--white);
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.tab-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    opacity: 0;
    transition: opacity var(--transition-base);
    border-radius: var(--radius-md);
}

.tab-button.active::before {
    opacity: 1;
}

.tab-icon {
    display: none; /* Убраны эмодзи */
}

.tab-text {
    position: relative;
    z-index: 1;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: normal;
}

.tab-button.active {
    color: var(--primary-purple);
    transform: translateY(-1px);
}

.tab-button:not(.active):hover {
    background: var(--primary-purple-light);
    color: var(--white);
}

.tab-button:active {
    transform: scale(0.98);
}

/* Вкладка «Создать заказ» — зелёная (гостевой режим) */
.tab-button--create-order {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: var(--white);
}
.tab-button--create-order::before {
    display: none;
}
.tab-button--create-order:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: var(--white);
}
.tab-button--create-order.active {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: var(--white);
}

.tab-content {
    display: none; /* По умолчанию скрыты */
    animation: fadeInUp 0.3s ease;
}

.tab-content.active {
    display: block; /* Показываем только активную */
}

/* ============================================
   ЗАГОЛОВКИ (Headers)
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 16px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    color: var(--primary-purple);
    position: relative;
}

.header-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 16px;
    display: inline-block;
    object-fit: contain;
    transition: transform var(--transition-base);
    animation: fadeInDown 0.6s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

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

.header-icon {
    display: none; /* Убраны эмодзи */
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 400;
}

/* ============================================
   ФОРМЫ (Forms)
   ============================================ */
.form {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--white);
    font-size: 15px;
}

/* Label'ы внутри форм с белым фоном - темные */
.form .form-group label {
    color: var(--primary-purple);
}

.label-icon {
    display: none; /* Убраны эмодзи */
}

.required {
    color: var(--error);
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.form-group input,
.form-group select {
    width: 100%;
    max-width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--gray-50);
    color: var(--gray-900);
    transition: all var(--transition-base);
    font-family: inherit;
    box-sizing: border-box;
    /* Фикс для iOS date picker */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(58, 47, 92, 0.1);
    transform: translateY(-1px);
    caret-color: var(--primary-purple); /* Цвет курсора */
}

.form-group input::placeholder {
    color: var(--gray-400);
}

/* Стили для textarea */
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--gray-50);
    color: var(--gray-900);
    transition: all var(--transition-base);
    font-family: inherit;
    resize: none;
    min-height: 80px;
    line-height: 1.5;
    box-sizing: border-box;
    caret-color: var(--primary-purple); /* Цвет курсора */
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(58, 47, 92, 0.1);
    transform: translateY(-1px);
}

.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

/* Экран авторизации */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-dark) 100%);
}

.auth-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: calc(100% - 32px);
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    box-sizing: border-box;
}

.auth-content .header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-content .header-icon {
    display: none; /* Убраны эмодзи */
}

.auth-content .header h1 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.auth-content .header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
}

.auth-back-link {
    display: block;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--primary-purple);
    text-decoration: none;
}
.auth-back-link:hover {
    text-decoration: underline;
}

/* Кнопка выхода убрана по требованию */

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233A2F5C' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 48px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-col {
    flex: 1;
}

/* ============================================
   КНОПКИ (Buttons)
   ============================================ */
.btn-primary {
    width: 100%;
    padding: 18px 24px;
    background: var(--white);
    color: var(--primary-purple);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(58, 47, 92, 0.1), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-purple-light);
    color: var(--white);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.btn-secondary {
    flex: 1;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--white);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

/* Кнопки внутри форм с белым фоном */
.form .btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-purple);
    color: var(--primary-purple);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border-color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Ховер для кнопок внутри форм */
.form .btn-secondary:hover {
    background: var(--primary-purple-light);
    color: var(--white);
    border-color: var(--primary-purple-light);
    box-shadow: 0 4px 12px rgba(58, 47, 92, 0.2);
}

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

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.btn-secondary:disabled:hover {
    background: var(--gray-100);
    color: var(--gray-500);
    transform: none;
    box-shadow: none;
}

/* Группа кнопок */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.button-group .btn-secondary {
    flex: 1;
}

.button-group .btn-secondary.active {
    background: var(--white);
    color: var(--primary-purple);
    border-color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* Активное состояние для кнопок внутри форм */
.form .button-group .btn-secondary.active {
    background: var(--primary-purple);
    color: var(--white);
    border-color: var(--primary-purple);
    box-shadow: 0 4px 12px rgba(58, 47, 92, 0.3);
}

/* ============================================
   КАРТОЧКИ ЗАКАЗОВ (Order Cards)
   ============================================ */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.order-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-purple);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-purple-light);
}

.order-card:hover::before {
    opacity: 1;
}

.order-card:active {
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.order-id {
    font-size: 13px;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    max-width: 100%;
}

.order-date {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.order-items {
    margin-bottom: 16px;
}

.order-item {
    font-size: 15px;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-weight: 500;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-item::before {
    content: '📦';
    font-size: 16px;
}

.order-status {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--gray-200);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    word-break: break-word;
}

.status-created {
    background: linear-gradient(135deg, #E8E6F0 0%, #D4D0E8 100%);
    color: var(--primary-purple-dark);
}

.status-processing {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #E65100;
}

.status-packed {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.status-shipped {
    background: linear-gradient(135deg, #E0F9F7 0%, #B3EFEB 100%);
    color: #00695C;
}

.status-delivered {
    background: linear-gradient(135deg, #E8F5E9 0%, #A5D6A7 100%);
    color: #1B5E20;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.status-cancelled {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
}

.status-draft {
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
    color: var(--gray-700);
}

/* Прогресс-бар статуса */
.progress-bar {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

.progress-step {
    flex: 1;
    height: 6px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.progress-step.active {
    background: var(--white);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.progress-step.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.order-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* ============================================
   СОСТОЯНИЯ (States)
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.empty-state::before {
    content: '📭';
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-top: 12px;
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 500;
}

/* Информация о нас (гостевой режим) */
.about-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 24px;
    color: var(--gray-800);
}
.about-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 12px;
}
.about-desc {
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-700);
    margin-bottom: 20px;
}
.about-telegram-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    margin-bottom: 24px;
}
.about-details {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
}
.about-details p {
    margin-bottom: 10px;
}
.about-details a {
    color: var(--primary-purple);
    text-decoration: none;
}
.about-details a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

/* Loading внутри формы с белым фоном */
.form .loading {
    color: var(--gray-600);
}

.loading::before {
    content: '⏳';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   СООБЩЕНИЯ (Messages)
   ============================================ */
.message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    display: none;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

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

.message.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
    border: 2px solid var(--success);
    display: block;
}

.message.error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
    border: 2px solid var(--error);
    display: block;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО (Modal)
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-base);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: calc(100% - 32px);
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-base);
    border: 1px solid var(--gray-200);
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-purple);
    background: var(--primary-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-600);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--error);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-body {
    color: var(--gray-800);
}

.modal-body .detail-row {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-body .detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-body .detail-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body .detail-value {
    font-size: 16px;
    color: var(--gray-900);
    font-weight: 500;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   АНИМАЦИИ (Animations)
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* ============================================
   РАСПИСАНИЕ ОТГРУЗОК (Warehouse Schedule)
   ============================================ */
.schedule-header {
    margin: 24px 0 16px 0;
    padding: 0;
}

.schedule-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-purple);
    margin: 0 0 8px 0;
}

.schedule-header p {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.schedule-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.schedule-card:hover {
    border-color: var(--primary-purple-light);
    box-shadow: 0 2px 8px rgba(58, 47, 92, 0.2);
}

.schedule-card.selected {
    border-color: var(--primary-purple);
    background: rgba(58, 47, 92, 0.05);
    box-shadow: 0 2px 12px rgba(58, 47, 92, 0.2);
}

.schedule-card.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-50);
}

.schedule-card.unavailable:hover {
    border-color: var(--gray-200);
    box-shadow: none;
}

.schedule-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.schedule-status.available {
    background: var(--success);
    color: var(--white);
}

.schedule-status.urgent {
    background: var(--warning);
    color: var(--white);
}

.schedule-status.soon {
    background: var(--success);
    color: var(--white);
    font-weight: 700;
}

.schedule-status.unavailable {
    background: var(--error);
    color: var(--white);
}

.schedule-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-date-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.schedule-date-value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 600;
}

.schedule-time-left {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.schedule-time-left-label {
    font-size: 13px;
    color: var(--gray-600);
}

.schedule-time-left-value {
    font-size: 14px;
    color: var(--primary-purple);
    font-weight: 600;
}

.schedule-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    margin-top: 12px;
}

.schedule-price-item {
    font-size: 13px;
    color: var(--gray-600);
}

.schedule-price-item strong {
    color: var(--gray-900);
    font-weight: 600;
}

.schedule-special-conditions {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--error);
    font-weight: 600;
    line-height: 1.4;
}

/* Стили для выбора типа упаковки */
.package-type-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.price-tag {
    font-size: 12px;
    color: var(--white);
    font-weight: 600;
}

/* Цена внутри форм */
.form .price-tag {
    color: var(--primary-purple);
}

.package-type-option.active .price-tag {
    color: var(--white);
}

/* Цена на активной кнопке внутри формы */
.form .package-type-option.active .price-tag {
    color: var(--white);
}

/* Итоговая стоимость */
.total-price-block {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    border: 2px solid var(--primary-purple);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-lg);
}

.total-price-block > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}

.total-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

.price-hint {
    display: block;
    font-size: 12px;
    color: var(--white);
    line-height: 1.4;
    margin-top: 4px;
    opacity: 0.9;
}

.price-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.price-detail-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.price-detail-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    opacity: 0.9;
}

.price-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

/* ============================================
   АДАПТИВНОСТЬ (Responsive)
   ============================================ */

/* Планшеты и маленькие десктопы */
@media (max-width: 768px) {
    .container {
        padding: 14px;
    }
    
    .header h1 {
        font-size: 26px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .form {
        padding: 22px;
    }
    
    .total-label {
        font-size: 14px;
    }
    
    .total-value {
        font-size: 22px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    /* Предотвращение зума при фокусе на input в iOS */
    input[type="text"],
    input[type="number"],
    input[type="tel"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Специальный фикс для date picker на iOS */
    input[type="date"] {
        position: relative;
        overflow: hidden;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Убираем стандартную иконку календаря на iOS */
    input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        cursor: pointer;
        opacity: 0;
    }
    
    /* Убираем нативные стили для даты */
    input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
        margin: 0;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Заголовки */
    .header {
        padding: 20px 14px;
        margin-bottom: 20px;
    }
    
    .header-logo {
        max-width: 100px;
        margin-bottom: 12px;
    }
    
    .header h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .header p {
        font-size: 13px;
    }
    
    /* Вкладки */
    .tabs {
        gap: 6px;
        padding: 5px;
        margin-bottom: 16px;
    }
    
    .tab-button {
        flex: 1 1 0;
        padding: 12px 6px;
        font-size: 13px;
    }
    
    .tab-text {
        line-height: 1.2;
    }
    
    /* Формы */
    .form {
        padding: 16px;
        margin-bottom: 16px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .form-group {
        margin-bottom: 18px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .form-hint {
        font-size: 12px;
    }
    
    /* Кнопки */
    .btn-primary {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .btn-secondary {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .button-group {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .button-group .btn-secondary {
        min-width: calc(50% - 4px);
    }
    
    /* Карточки заказов */
    .order-card {
        padding: 14px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-id {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .order-date {
        font-size: 12px;
    }
    
    .order-item {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    /* Расписание складов */
    .schedule-header h3 {
        font-size: 16px;
    }
    
    .schedule-header p {
        font-size: 13px;
    }
    
    .schedule-card {
        padding: 14px;
    }
    
    .schedule-status {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .schedule-date-label,
    .schedule-date-value,
    .schedule-time-left-label,
    .schedule-time-left-value {
        font-size: 13px;
    }
    
    .schedule-price-item {
        font-size: 12px;
    }
    
    /* Итоговая стоимость */
    .total-price-block {
        padding: 16px;
        margin: 16px 0;
    }
    
    .total-label {
        font-size: 13px;
    }
    
    .total-value {
        font-size: 20px;
    }
    
    .price-hint {
        font-size: 11px;
    }
    
    /* Модальные окна */
    .modal-content {
        padding: 20px;
        max-width: calc(100vw - 20px);
        margin: 10px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-body .detail-label {
        font-size: 12px;
    }
    
    .modal-body .detail-value {
        font-size: 14px;
    }
    
    /* Пустые состояния */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state::before {
        font-size: 48px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
    
    .loading {
        padding: 40px 16px;
        font-size: 14px;
    }
    
    .loading::before {
        font-size: 40px;
    }
    
    /* Экран авторизации */
    .auth-content {
        padding: 24px;
        width: calc(100% - 24px);
    }
    
    .auth-content .header h1 {
        font-size: 22px;
    }
    
    .auth-content .header p {
        font-size: 13px;
    }
    
    /* Отступы между элементами формы */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-col {
        width: 100%;
    }
    
    /* Адаптация иконки select */
    .form-group select {
        background-size: 10px 10px;
        background-position: right 14px center;
        padding-right: 40px;
    }
    
    /* Улучшение для длинных label'ов */
    .form-group label {
        line-height: 1.4;
    }
    
    /* Улучшение для кнопок действий */
    .order-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .order-actions .btn-secondary {
        width: 100%;
    }
}

/* Очень маленькие экраны (старые смартфоны) */
@media (max-width: 360px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 16px 12px;
    }
    
    .header-logo {
        max-width: 80px;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header p {
        font-size: 12px;
    }
    
    .form {
        padding: 12px;
    }
    
    .tab-button {
        flex: 1 1 0;
        padding: 10px 4px;
        font-size: 12px;
    }
    
    .tab-text {
        line-height: 1.2;
        font-size: inherit;
    }
    
    .btn-primary {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .btn-secondary {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .total-label {
        font-size: 12px;
    }
    
    .total-value {
        font-size: 18px;
    }
    
    .price-hint {
        font-size: 10px;
    }
    
    .order-card {
        padding: 12px;
    }
    
    .button-group {
        gap: 6px;
    }
    
    .form {
        padding: 10px;
    }
    
    .auth-content {
        padding: 20px;
        width: calc(100% - 16px);
    }
    
    .modal-content {
        width: calc(100% - 20px);
        padding: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    /* Кнопки минимального размера для удобства нажатия */
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
    }
    
    .tab-button {
        min-height: 40px;
    }
}

/* ============================================
   SCROLLBAR (Кастомный скроллбар)
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--white);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple-light);
}

/* ============================================
   СПЕЦИАЛЬНЫЕ ФИКСЫ ДЛЯ iOS
   ============================================ */

/* Фикс для date picker на всех iOS устройствах */
@supports (-webkit-touch-callout: none) {
    /* Только для iOS Safari */
    input[type="date"] {
        min-height: 52px;
        padding: 16px 18px !important;
        text-align: left;
        position: relative;
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }
    
    input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: auto;
        color: transparent;
        background: transparent;
        cursor: pointer;
        margin: 0;
        padding: 0;
    }
    
    input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
        padding: 0;
        margin: 0;
    }
    
    /* Убираем внутренние отступы для iOS */
    input[type="date"]::-webkit-datetime-edit {
        padding: 0;
        margin: 0;
    }
    
    input[type="date"]::-webkit-datetime-edit-fields-wrapper {
        padding: 0;
        margin: 0;
    }
    
    /* Дополнительная защита от выезжания за границы */
    .form-group .input-wrapper {
        overflow: visible !important;
        position: relative;
        contain: layout;
    }
}

/* Универсальный фикс для всех браузеров */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Фикс для календарного виджета iOS */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* ============================================
   ВИЗАРД РАСЧЁТА (Calculation Wizard)
   ============================================ */
.calculation-wizard {
    position: relative;
}

.calculation-progress {
    margin-bottom: 24px;
    position: relative;
    --calc-progress-width: 0%;
}

.calculation-progress-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    width: 100%;
    z-index: 0;
}

.calculation-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    border-radius: var(--radius-full);
    width: var(--calc-progress-width);
    transition: width var(--transition-slow);
}

.calculation-progress-dots {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    padding: 0 4px;
}

.calculation-dot {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-sizing: border-box;
    background: var(--gray-200);
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--transition-base);
}

.calculation-dot.active {
    background: #ffffff;
    color: var(--primary-purple);
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--primary-purple), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.calculation-dot.done {
    background: var(--success);
    color: var(--white);
}

.calculation-panels {
    position: relative;
    min-height: 220px;
}

.calculation-panel {
    display: none;
    animation: calcPanelOut 0.25s ease forwards;
}

.calculation-panel.active {
    display: block;
    animation: calcPanelIn 0.35s ease forwards;
}

@keyframes calcPanelIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes calcPanelOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-12px);
    }
}

.calculation-step-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.calculation-step-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.calc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Явно перебиваем .form-group label { color: white } — надписи всегда тёмные на белой карточке */
.calculation-wizard .calc-checkbox-item,
.calculation-wizard .calc-checkbox-label {
    color: #1a1a2e !important;
}

.calc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 500;
    color: #1a1a2e;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.calc-checkbox-item:hover {
    border-color: var(--primary-purple-light);
    box-shadow: var(--shadow-md);
}

/* Скрываем нативный чекбокс, оставляем кликабельным; рисуем свой с галочкой */
.calc-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
}

.calc-checkbox-item::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border: 2px solid var(--gray-400);
    border-radius: 6px;
    background: #ffffff;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.calc-checkbox-item:has(input:checked)::before {
    border-color: var(--primary-purple);
    background: var(--primary-purple);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.calc-checkbox-item input[type="checkbox"]:checked + .calc-checkbox-label,
.calc-checkbox-item:has(input:checked) {
    border-color: var(--primary-purple);
    background: #ffffff;
    color: var(--primary-purple);
    box-shadow: 0 0 0 1px var(--primary-purple);
}

.calc-checkbox-item:has(input:checked) .calc-checkbox-label {
    color: var(--primary-purple) !important;
}

.calc-checkbox-label {
    pointer-events: none;
    color: inherit;
}

.calc-checkbox-custom {
    border-style: dashed;
}

.calc-custom-input-wrap {
    margin-top: 14px;
}

.calc-custom-input-wrap .input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--gray-50);
    color: var(--gray-900);
    transition: all var(--transition-base);
}

.calc-custom-input-wrap .input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--white);
}

.calculation-summary {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-800);
}

.calculation-summary p {
    margin: 0 0 6px 0;
}

.calculation-summary p:last-child {
    margin-bottom: 0;
}

.btn-calculation-submit {
    width: 100%;
    margin-top: 8px;
}

.calculation-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.calculation-nav .btn-secondary,
.calculation-nav .btn-primary {
    flex: 1;
}

.calculation-panel[data-step="5"] .calculation-nav {
    display: none;
}
