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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Карточки */
.auth-card, .driver-panel, .passenger-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.panel-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.panel-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Формы */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group {
    position: relative;
}

.btn-location {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопки */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

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

/* Статус водителя */
.status-section {
    text-align: center;
    margin: 30px 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.offline {
    background: #6b7280;
}

/* Очередь */
.queue-info {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

/* Заказы */
.order-section {
    margin-top: 30px;
}

.order-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.order-card, .order-status-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-info {
    margin-bottom: 20px;
}

.order-info p {
    margin: 10px 0;
    font-size: 16px;
}

.order-actions {
    display: flex;
    gap: 10px;
}

.order-actions .btn {
    flex: 1;
}

.timer {
    font-size: 32px;
    font-weight: bold;
    color: #ef4444;
    text-align: center;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

/* Статус заказа пассажира */
.status-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.status-steps::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 50px;
    height: 50px;
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 10px;
    transition: all 0.3s;
}

.step.active .step-icon {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.step.completed .step-icon {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-label {
    font-size: 12px;
    color: #6b7280;
}

.step.active .step-label,
.step.completed .step-label {
    color: #333;
    font-weight: 600;
}

.order-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.order-details p {
    margin: 10px 0;
}

/* Сообщения */
.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.no-orders {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 18px;
}

.switch-link {
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
}

.switch-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.switch-link a:hover {
    text-decoration: underline;
}

.role-choice-section .role-choice-hint { margin-bottom: 12px; color: #555; }
.role-choice-buttons { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.role-choice-buttons .btn-role { flex: 1; }
.role-switch { font-size: 14px; margin-top: 8px; }
.role-switch a { color: #667eea; text-decoration: none; margin-right: 8px; }
.role-switch a:hover { text-decoration: underline; }

.drivers-count {
    margin-top: 8px;
    font-size: 13px;
    color: #374151;
}

.geo-status {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.geo-status #geo-status-text {
    flex: 1;
    min-width: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .auth-card, .driver-panel, .passenger-panel {
        padding: 20px;
        border-radius: 15px;
    }
    
    .panel-header h1 {
        font-size: 24px;
    }
    
    .status-steps {
        flex-wrap: wrap;
    }
    
    .step {
        flex: 0 0 50%;
        margin-bottom: 20px;
    }
    
    .order-actions {
        flex-direction: column;
    }
    
    .timer {
        font-size: 24px;
    }
}

/* Анимации */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.order-card.new-order {
    animation: pulse 2s infinite;
    border-color: #667eea;
}

/* --- Страница заказа: карта максимально, форма компактнее --- */
.page-passenger .container.container--passenger {
    max-width: 100%;
    padding: 0 12px;
}
.page-passenger .passenger-panel--order {
    padding: 12px 16px 20px;
}
.page-passenger .panel-header--compact {
    padding-bottom: 10px;
    margin-bottom: 8px;
}
.page-passenger .panel-header--compact h1 {
    font-size: 1.25rem;
}

/* Карта заказа — как можно шире и выше */
.order-map {
    width: 100%;
    height: 52vh;
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #e5e7eb;
    margin: 6px 0 12px;
}
.map-hint {
    margin: 4px 0;
    font-size: 13px;
    color: #6b7280;
}
.map-toolbar {
    margin-bottom: 4px;
}
.map-toolbar .btn {
    width: 100%;
}

/* Компактные поля адресов */
.form-group-compact {
    margin-bottom: 10px;
}
.form-group-compact label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 2px;
}
.input-with-reset {
    display: flex;
    gap: 8px;
    align-items: center;
}
.input-with-reset input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
}
.btn-reset {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.btn-reset:hover:not(:disabled) {
    background: #f3f4f6;
    color: #374151;
}
.btn-reset:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.form-group .coords {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}
.order-form-fields {
    gap: 10px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}
.btn-outline:hover {
    background: #f3f4f6;
}
.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .order-map {
        height: 55vh;
        min-height: 260px;
    }
    .page-passenger .passenger-panel--order {
        padding: 10px 12px 16px;
    }
}

/* --- Навигационная панель водителя --- */
.driver-nav-stage {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin: 4px 0 8px;
}
.driver-route-map {
    width: 100%;
    height: 42vh;
    min-height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: #e5e7eb;
    margin: 6px 0 10px;
}
.driver-map-hint {
    font-size: 12px;
    color: #6b7280;
    margin: -4px 0 10px;
}
.order-actions--driver-nav {
    flex-wrap: wrap;
}
.order-actions--driver-nav .btn {
    flex: 1;
    min-width: 140px;
}
@media (max-width: 480px) {
    .driver-route-map {
        height: 38vh;
        min-height: 200px;
    }
}
