/* Kanada 2026 – mobile-first */

:root {
    --red: #b91c1c;
    --red-dark: #991b1b;
    --bg: #faf7f2;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --line: #e5e0d8;
    --accent-soft: #fee2e2;
    --green: #15803d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --card-bg: #1e2126;
        --text: #e7e5e0;
        --text-muted: #9aa0a8;
        --line: #2c3037;
        --accent-soft: #3b1d1d;
        --green: #4ade80;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--red); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Login ---------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 24px;
    text-align: center;
}

.login-logo { font-size: 48px; line-height: 1; }

.login-card h1 { margin: 12px 0 4px; font-size: 24px; }

.login-hint { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; }

.login-error {
    background: var(--accent-soft);
    color: var(--red);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px; /* verhindert iOS-Zoom */
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    margin-bottom: 12px;
}

.login-card input:focus {
    outline: 2px solid var(--red);
    outline-offset: 1px;
    border-color: transparent;
}

.login-card button {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--red);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.login-card button:active { background: var(--red-dark); }

/* ---------- App-Header ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--red);
    color: #fff;
    padding-top: env(safe-area-inset-top);
    box-shadow: var(--shadow);
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
    max-width: 680px;
    margin: 0 auto;
}

.app-title {
    font-size: 19px;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-badge {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    font-size: 12px;
    padding: 2px 10px;
}

.logout-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    padding: 3px 10px;
}

.trip-status {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.trip-status:empty { padding-bottom: 4px; }

/* ---------- Timeline ---------- */

.timeline {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 90px;
    position: relative;
}

.stop {
    position: relative;
    padding-left: 34px;
    margin-bottom: 18px;
}

.stop::before {
    /* vertikale Linie */
    content: "";
    position: absolute;
    left: 11px;
    top: 26px;
    bottom: -18px;
    width: 2px;
    background: var(--line);
}

.stop:last-child::before { display: none; }

.stop::after {
    /* Punkt auf der Linie */
    content: "";
    position: absolute;
    left: 5px;
    top: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--line);
}

.stop.is-current::after { border-color: var(--red); background: var(--red); }
.stop.is-past { opacity: 0.62; }
.stop.is-past::after { border-color: var(--line); background: var(--line); }

.stop-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    border: 2px solid transparent;
}

.stop.is-current .stop-card { border-color: var(--red); }

.stop-dates {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    margin-bottom: 4px;
}

.badge-now {
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    padding: 1px 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-confirmed {
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
}

.stop-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.stop-title .icon { flex-shrink: 0; }

.stop-details {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.stop-details div {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    align-items: baseline;
}

.stop-details .k { flex-shrink: 0; min-width: 76px; font-weight: 600; }

.stop-details a { word-break: break-word; }

.stop-note {
    margin-top: 8px;
    font-size: 13px;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
}

/* ---------- Buttons / Footer ---------- */

.today-btn {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 20;
}

.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
}
