/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные стили */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

/* Контейнер приложения */
.app-container {
    max-width: 420px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
    position: relative;
}

/* Заголовок */
.header {
    background: linear-gradient(135deg, #0051cc 0%, #0066ff 100%);
    color: white;
    padding: 16px 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header p {
    font-size: 13px;
    opacity: 0.9;
}

/* Индикатор офлайн/онлайн */
.offline-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    backdrop-filter: blur(10px);
}

.offline-badge.online {
    background: rgba(76, 217, 100, 0.3);
}

/* Индикатор шагов */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: #f5f5f7;
    gap: 8px;
}

.steps-indicator .step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e5e7;
    color: #86868b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.steps-indicator .step.active {
    background: #0066ff;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.steps-indicator .step.completed {
    background: #34c759;
    color: white;
}

.steps-indicator .step-line {
    width: 40px;
    height: 3px;
    background: #e5e5e7;
    border-radius: 2px;
}

.steps-indicator .step-line.hidden,
.steps-indicator .step.hidden {
    display: none;
}

/* Контент */
.content {
    padding: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.content.active {
    display: block;
}

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

/* Секции */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1d1d1f;
}

/* Поля ввода */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    color: #86868b;
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e5e7;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #0066ff;
    background: white;
    box-shadow: 0 0 0 4px rgba(0,102,255,0.1);
}

.input-with-unit {
    position: relative;
}

.input-with-unit .unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 14px;
    pointer-events: none;
}

/* Чекбоксы */
.checkbox-group {
    margin: 12px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1d1d1f;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0066ff;
}

/* Сообщения об ошибках */
.error-message {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    display: none;
    border-left: 4px solid #c00;
}

/* Предупреждения */
.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 16px;
    border-left: 4px solid #ffc107;
}

.warning-message strong {
    display: block;
    margin-bottom: 4px;
}

/* Информационные подсказки */
.info-tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #e5e5e7;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    color: #86868b;
    cursor: help;
    margin-left: 6px;
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1d1d1f;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.info-tooltip:hover .tooltip-content {
    opacity: 1;
}

/* Адаптивность */
@media (min-width: 768px) {
    .app-container {
        max-width: 480px;
    }
}

/* Утилиты */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* Плавное скрытие секции маршрута */
.route-section-hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, max-height 0.4s ease, transform 0.4s ease;
    margin: 0 !important;
    padding: 0 !important;
}

.route-section-visible {
    opacity: 1;
    max-height: 2000px;
    transform: translateY(0);
    transition: opacity 0.4s ease, max-height 0.4s ease, transform 0.4s ease;
}

/* Плавное появление результата */
.result-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-card.show {
    opacity: 1;
    transform: translateY(0);
}