/* Kusztrich Tankanleitung – mobile first
   Farben aus kusztrich.at: Gelb #ffdd00, Stahlblau #617e97, Anthrazit #212934 / #464646 */

:root {
    --yellow: #ffdd00;
    --yellow-press: #f2cf00;
    --blue: #617e97;
    --blue-deep: #4b6680;
    --ink: #212934;
    --text: #464646;
    --muted: #6b7681;
    --bg: #f2f3f5;
    --surface: #ffffff;
    --line: #dfe5ea;
    --viewer-bg: #d5dde4;
    --shadow: 0 1px 2px rgba(33, 41, 52, .06), 0 4px 16px rgba(33, 41, 52, .08);
    --radius: 14px;
    --radius-sm: 8px;
    --topbar-h: 60px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f3f5f7;
        --text: #d6dce2;
        --muted: #9aa6b2;
        --bg: #1b222b;
        --surface: #252e39;
        --line: #36414e;
        --viewer-bg: #141a21;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100dvh;
    font-family: Arial, Helvetica, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.icon { width: 24px; height: 24px; flex: none; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 36px; height: 36px; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kopfzeile ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 4px solid var(--yellow);
    padding-top: env(safe-area-inset-top, 0px);
}

.topbar__inner {
    position: relative;
    height: var(--topbar-h);
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar__logo img { height: 42px; width: auto; }

.topbar__lang,
.topbar__call {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    text-decoration: none;
    color: #212934;
    border-radius: 999px;
}

.topbar__lang {
    left: 8px;
    padding: 0 12px 0 6px;
    background: #f2f3f5;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .04em;
}
.topbar__lang:active { background: #e3e8ed; }

.topbar__call {
    right: 12px;
    width: 44px;
    justify-content: center;
    background: var(--yellow);
}
.topbar__call:active { background: var(--yellow-press); }
.topbar__call .icon { width: 22px; height: 22px; }

.page-viewer .topbar__logo img { height: 34px; }

/* ---------- Flaggen ---------- */

.flag {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    flex: none;
}
.flag--sm { width: 24px; height: 18px; border-radius: 3px; }
.flag--lg { width: 56px; height: 42px; border-radius: 7px; }

/* ---------- Startseite ---------- */

.start {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

.hero {
    position: relative;
    margin: 0 -16px;
    padding: 28px 20px 64px;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, .08), transparent 55%),
        var(--blue);
    overflow: hidden;
}

/* gelber Akzent wie im Logo / Plakat */
.hero::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -70px;
    width: 170px;
    height: 170px;
    border: 18px solid var(--yellow);
    border-radius: 50%;
    opacity: .9;
}

.hero__badge {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 18px;
    background: var(--yellow);
    color: #212934;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.hero__title {
    margin: 0;
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -.01em;
}

.hero__sub {
    margin: 8px 0 0;
    font-size: 17px;
    color: rgba(255, 255, 255, .9);
}

.suggest {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: -40px;
    padding: 16px 16px 16px 18px;
    min-height: 84px;
    border-radius: var(--radius);
    background: var(--yellow);
    color: #212934;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(33, 41, 52, .22);
    transition: transform .12s ease, background-color .12s ease;
}
.suggest:active { transform: scale(.98); background: var(--yellow-press); }

.suggest__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.suggest__text strong { font-size: 19px; line-height: 1.25; }
.suggest__text span { font-size: 14px; opacity: .8; }
.suggest__arrow { width: 28px; height: 28px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.lang-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lang-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 2px solid var(--line);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: border-color .12s ease, transform .12s ease;
}
.lang-card .flag { grid-row: span 2; }
.lang-card:active { transform: scale(.97); border-color: var(--yellow); }
.lang-card.is-current { border-color: var(--yellow); }

.lang-card__name {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}
.lang-card__title {
    font-size: 12.5px;
    line-height: 1.3;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 340px) {
    .lang-grid { grid-template-columns: 1fr; }
}

.hotline {
    margin-top: 28px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hotline__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.hotline__head h2 { margin: 0; font-size: 17px; color: var(--ink); line-height: 1.3; }

.hotline__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    flex: none;
}

.hotline__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.hotline__btn--primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    font-size: 20px;
}
.hotline__btn:active { opacity: .85; }

.footer {
    padding: 24px 16px calc(24px + var(--safe-b));
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}
.footer p { margin: 0 0 6px; }
.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; }
.footer__links a { padding: 6px 0; text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }

/* ---------- Viewer ---------- */

.page-viewer { overflow: hidden; background: var(--viewer-bg); }

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

.viewer__scroller {
    position: fixed;
    top: calc(var(--topbar-h) + 4px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    padding: 12px 12px calc(96px + var(--safe-b));
    outline: none;
}

.viewer__pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    min-width: 100%;
    will-change: transform;
}

.page {
    position: relative;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.page canvas {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

.viewer__status {
    position: fixed;
    inset: calc(var(--topbar-h) + 4px) 0 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    color: var(--ink);
    background: var(--viewer-bg);
    transition: opacity .25s ease, visibility .25s;
}
.viewer[data-state="ready"] .viewer__status { opacity: 0; visibility: hidden; }

.viewer__error { margin: 0; font-size: 17px; font-weight: 700; max-width: 320px; }

.spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(97, 126, 151, .25);
    border-top-color: var(--yellow);
    animation: spin .8s linear infinite;
}
.viewer[data-state="error"] .spinner { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}
.btn--primary { background: var(--yellow); color: #212934; }

/* Zoom-Leiste */
.toolbar {
    position: fixed;
    left: 50%;
    bottom: calc(16px + var(--safe-b));
    z-index: 10;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(33, 41, 52, .88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    transition: opacity .2s ease;
}
.viewer:not([data-state="ready"]) ~ .toolbar { opacity: 0; pointer-events: none; }

.toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 48px;
    height: 48px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.toolbar__btn:active { background: rgba(255, 255, 255, .15); }
.toolbar__btn--fit {
    min-width: 96px;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.viewer.is-zoomed ~ .toolbar .toolbar__btn--fit { background: var(--yellow); color: #212934; }

.hint {
    position: fixed;
    left: 50%;
    bottom: calc(84px + var(--safe-b));
    z-index: 11;
    transform: translate(-50%, 8px);
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--yellow);
    color: #212934;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}
.hint.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
    .topbar__lang { left: 16px; }
    .topbar__call { right: 16px; }
    .viewer__scroller { padding: 24px 24px calc(104px + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
}

/* Nur Bildschirmanzeige – kein Druck */
@media print {
    body * { display: none !important; }
}
