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

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #222;
    background: #f5f7fa;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ======================================
   Шапка
   ====================================== */

.site-header {
    background: #1e3a5f;
    color: #fff;
    padding: 16px 0;
    margin-bottom: 40px;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: block;
}

.logo-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.site-header nav a {
    color: #cfd8e3;
    margin-left: 24px;
    text-decoration: none;
}

.site-header nav a:hover {
    color: #fff;
}

.site-header nav a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.site-header nav a.active {
    color: #fff;
    font-weight: 600;
}

/* ======================================
   Типографика
   ====================================== */

h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.lead {
    color: #667;
    margin-bottom: 24px;
}

/* ======================================
   Главная страница (hero + features)
   ====================================== */

.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero .lead {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Кнопки главной — одинаковый размер! */
.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
    line-height: 1.2;
    transition: all 0.15s ease;
    width: auto;
    min-width: 220px;
}

.hero-actions .btn-primary {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.hero-actions .btn-primary:hover {
    background: #2a4d7a;
    border-color: #2a4d7a;
}

.hero-actions .btn-secondary {
    background: #fff;
    color: #1e3a5f;
    border-color: #1e3a5f;
    margin-top: 0;
}

.hero-actions .btn-secondary:hover {
    background: #f5f7fa;
}

/* Блоки "фичи" на главной */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.feature h3 {
    color: #1e3a5f;
    margin-bottom: 8px;
    font-size: 18px;
}

.feature p {
    color: #444;
    font-size: 15px;
}

/* ======================================
   Калькулятор
   ====================================== */

.calculator {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Автокомплит */
.autocomplete {
    position: relative;
}

.suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestions.visible {
    display: block;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f5f7fa;
}

.suggestion-item .name {
    font-weight: 600;
    display: block;
}

.suggestion-item .meta {
    font-size: 12px;
    color: #667;
}

.no-results {
    padding: 14px;
    color: #888;
    text-align: center;
}

/* ======================================
   Базовые кнопки (в формах)
   ====================================== */

.btn-primary {
    background: #1e3a5f;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2a4d7a;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.btn-secondary {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s ease;
}

.btn-secondary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ======================================
   Результат расчёта
   ====================================== */

.result {
    margin-top: 24px;
    padding: 24px;
    background: #f0f9f4;
    border: 1px solid #c6e6cf;
    border-radius: 10px;
}

.result h3 {
    margin-bottom: 8px;
    color: #0d5c2d;
}

.result .price {
    font-size: 36px;
    font-weight: 700;
    color: #0d5c2d;
    margin-bottom: 8px;
}

.result .route {
    margin-bottom: 16px;
    color: #444;
}

.result .details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.result .details div {
    display: flex;
    justify-content: space-between;
}

.result .details span {
    color: #667;
}

.result .disclaimer {
    font-size: 13px;
    color: #667;
    font-style: italic;
}

/* ======================================
   Ошибки / сообщения
   ====================================== */

.errors {
    margin-top: 20px;
    padding: 14px 18px;
    background: #fff0f0;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    color: #a33;
}

.errors ul {
    padding-left: 20px;
}

/* ======================================
   Подвал
   ====================================== */

.site-footer {
    margin-top: auto;
    padding: 24px 0;
    background: #1e3a5f;
    color: #cfd8e3;
    font-size: 14px;
    text-align: center;
    width: 100%;
}

.hidden {
    display: none;
}

/* ======================================
   Форма заявки
   ====================================== */

.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.application-form {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 10px;
}

.application-form h4 {
    margin-bottom: 16px;
    color: #1e3a5f;
    font-size: 18px;
}

.application-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.application-form textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Заявка принята */
.success-box {
    margin-top: 20px;
    padding: 32px 24px;
    text-align: center;
    background: #f0f9f4;
    border: 1px solid #c6e6cf;
    border-radius: 10px;
}

.success-box .success-icon {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 12px;
    font-weight: bold;
    line-height: 1;
}

.success-box h3 {
    color: #0d5c2d;
    margin-bottom: 8px;
}

.success-box p {
    color: #444;
}

/* ======================================
   Справочник станций
   ====================================== */

.stations-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: #fff;
    padding: 16px;
    border-radius: 10px;
}

.stations-filters input[type=text] {
    flex: 2;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 14px;
}

.stations-filters select {
    flex: 1;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.stations-filters button {
    padding: 10px 20px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.stations-filters .clear {
    padding: 10px 16px;
    color: #667;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.stations-filters .clear:hover {
    color: #1e3a5f;
}

.results-info {
    color: #667;
    margin-bottom: 12px;
    font-size: 14px;
}

.stations-table {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stations-table th,
.stations-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
}

.stations-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stations-table tbody tr {
    cursor: pointer;
}

.stations-table tbody tr:hover {
    background: #f8fafc;
}

.stations-table code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.stations-table small {
    color: #64748b;
}

.empty {
    padding: 40px;
    text-align: center;
    color: #667;
    background: #fff;
    border-radius: 10px;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a,
.pagination .dots {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #1e3a5f;
    text-decoration: none;
    font-size: 14px;
}

.pagination a:hover {
    background: #f8fafc;
}

.pagination a.active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.pagination .dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* ======================================
   Карточка станции
   ====================================== */

.breadcrumbs {
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: #667;
    font-size: 14px;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #1e3a5f;
}

.station-meta {
    color: #667;
    margin-bottom: 20px;
}

.station-card {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.station-card .info-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.station-card .info-list dt {
    color: #64748b;
    font-size: 14px;
}

.station-card .info-list dd {
    font-weight: 500;
}

.station-card .info-list code {
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.map-link {
    margin-left: 12px;
    color: #2563eb;
    font-size: 14px;
    text-decoration: none;
}

.map-link:hover {
    text-decoration: underline;
}

.station-card .btn-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    width: auto;
    padding: 14px 28px;
}

.nearby-stations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.nearby-item {
    background: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #1e3a5f;
    display: block;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
}

.nearby-item:hover {
    border-color: #1e3a5f;
    transform: translateY(-1px);
}

.nearby-item strong {
    display: block;
    margin-bottom: 2px;
}

.nearby-item small {
    color: #64748b;
    font-size: 12px;
}

/* ======================================
   Страница 404
   ====================================== */

.error-page {
    text-align: center;
    padding: 29px 20px;
}

.error-page h1 {
    font-size: 120px;
    color: #1e3a5f;
    opacity: 0.2;
    margin: 0;
    line-height: 1;
}

.error-page h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.error-page p {
    color: #667;
    margin-bottom: 28px;
}

/* ======================================
   Медиа-запросы (адаптив)
   ====================================== */

@media (max-width: 700px) {
    .stations-table {
        font-size: 13px;
    }

    .stations-table th,
    .stations-table td {
        padding: 8px 10px;
    }

    .station-card .info-list {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }

    .station-card .info-list dt {
        margin-top: 12px;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero {
        padding: 30px 0;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }

    .calculator {
        padding: 20px;
    }

    .result .details {
        grid-template-columns: 1fr;
    }

    .site-header .container {
        flex-direction: column;
        gap: 12px;
    }

    .site-header nav a {
        margin: 0 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .logo-name {
        display: none;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }
}
