:root {
    --bg: #0b1020;
    --panel: #121933;
    --panel-2: #0f1630;
    --text: #eaf0ff;
    --muted: #a9b4d0;
    --primary: #4f8cff;
    --primary-hover: #3e79ea;
    --border: #273057;
    --ok: #16a34a;
    --err: #dc2626;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, #090e1d 0%, #0b1020 100%);
    color: var(--text);
}

html {
    overflow-y: scroll; /* always reserve scrollbar space */
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 16, 32, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 68px;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.3px;
}

.nav nav {
    display: flex;
    gap: 10px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
}

    .nav-link:hover {
        background: #1a2346;
        color: var(--text);
    }

    .nav-link.active {
        background: #1a2346;
        color: var(--text);
    }

.hero {
    padding: 84px 0 36px;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    color: #9ec1ff;
    background: #132346;
    border: 1px solid #29447a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
}

.lead {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.07rem;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-hover);
    }

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 0 56px;
}

.card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
}

    .card h3 {
        margin-top: 0;
        margin-bottom: 10px;
    }

    .card p {
        margin: 0;
        color: var(--muted);
    }

.page {
    padding: 34px 0 56px;
}

.page-head h1 {
    margin: 0 0 8px;
}

.page-head p {
    margin: 0 0 18px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 28px;
    color: var(--muted);
    margin-top: 22px;
}

/* ===== Form styling (merged from old train.css) ===== */
.form-grid {
    display: grid;
    gap: 0.9rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

input, select, textarea, button {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    color: var(--text);
    background: #0d1430;
    border: 1px solid #2a3768;
    border-radius: 10px;
    outline: none;
}

    input:focus, select:focus, textarea:focus {
        border-color: #5f8fff;
        box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2);
    }

button {
    width: 100%;
    margin-top: 0.25rem;
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
}

    button:hover {
        background: var(--primary-hover);
    }

    button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* JS writes .ok / .err on #result */
.result {
    margin-top: 1rem;
    border-radius: 10px;
    padding: 0.8rem;
    border: 1px solid var(--border);
    background: #0b1220;
    white-space: pre-wrap;
    min-height: 48px;
    color: var(--text);
}

    .result.ok {
        border-color: rgba(22, 163, 74, 0.55);
        box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.25);
    }

    .result.err {
        border-color: rgba(220, 38, 38, 0.55);
        box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2);
    }

/* Responsive */
@media (max-width: 860px) {
    .features {
        grid-template-columns: 1fr;
    }

    .nav {
        min-height: 62px;
    }
}

.train-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

    .train-layout .card {
        margin-bottom: 0; /* avoid extra vertical spacing inside grid */
    }

@media (max-width: 980px) {
    .train-layout {
        grid-template-columns: 1fr;
    }
}
