/* ── Reset & Basis ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* absolutGPS Brand */
    --brand-teal:      #26ADE3;
    --brand-lime:      #BACD1B;
    --brand-gradient:  linear-gradient(45deg, #26ADE3 0%, #BACD1B 100%);
    --teal-dark:       #1a8abf;
    --teal-light:      #e0f4fb;
    --lime-light:      #f4f8d0;

    /* Status */
    --red:             #d32f2f;
    --red-light:       #ffebee;
    --orange:          #e65100;
    --orange-light:    #fff3e0;
    --status-green:    #2e7d32;
    --status-green-bg: #e8f5e9;

    /* Grautöne */
    --grey-100:        #f5f5f5;
    --grey-200:        #eeeeee;
    --grey-300:        #e0e0e0;
    --grey-600:        #757575;
    --grey-900:        #212121;

    /* Layout */
    --radius:          10px;
    --shadow:          0 2px 8px rgba(0,0,0,.12);
    --tap:             56px;
}

html, body {
    font-family: camingodos-web, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--grey-900);
    background: var(--grey-100);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}
button { font-family: inherit; }

[hidden] { display: none !important; }
.screen { min-height: 100vh; }
html { scroll-behavior: smooth; }

/* ── LOGIN ─────────────────────────────────────────────────── */
#screen-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--brand-gradient);
    gap: 28px;
    flex-direction: column;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.20);
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.login-card .logo {
    height: 56px; width: auto;
    margin-bottom: 14px;
}
.login-card h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 22px;
    color: var(--grey-900);
    letter-spacing: .2px;
}
.login-card form {
    display: flex; flex-direction: column; gap: 14px;
    text-align: left;
}
.login-card label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 13px; color: var(--grey-600); font-weight: 600;
}
.login-card input,
.login-card select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--grey-300);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--grey-900);
    transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus,
.login-card select:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(38,173,227,.18);
}
.error {
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

/* Install-Button (Android/Chrome via beforeinstallprompt) */
.install-btn {
    margin-top: 18px;
    width: 100%;
    background: #fff;
    color: var(--teal-dark);
    border: 1.5px dashed var(--brand-teal);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, transform .04s;
    -webkit-tap-highlight-color: transparent;
}
.install-btn:hover  { background: var(--teal-light); }
.install-btn:active { transform: scale(.98); }
.install-icon {
    font-size: 16px;
    background: var(--teal-light);
    border-radius: 50%;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* iOS-Hinweis (Safari hat keinen Install-Prompt) */
.ios-hint {
    margin-top: 18px;
    background: var(--teal-light);
    border-left: 4px solid var(--brand-teal);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--grey-900);
    line-height: 1.5;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ios-hint strong {
    color: var(--teal-dark);
    font-weight: 700;
}
.ios-share {
    display: inline-block;
    background: #fff;
    color: var(--brand-teal);
    border: 1px solid var(--brand-teal);
    border-radius: 4px;
    padding: 0 6px;
    font-weight: 700;
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: var(--radius);
    font-size: 15px; font-weight: 700; font-family: inherit;
    padding: 12px 18px; cursor: pointer;
    transition: opacity .15s, transform .04s;
    min-height: 44px;
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
    letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); opacity: .88; }
.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-secondary {
    background: #fff;
    color: var(--brand-teal);
    border: 1.5px solid var(--brand-teal);
    text-shadow: none;
}
.btn-large {
    min-height: var(--tap);
    font-size: 16px;
    padding: 14px 22px;
}

/* ── HEADER ────────────────────────────────────────────────── */
.app-header {
    background: var(--brand-gradient);
    color: #fff;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.hdr-left {
    display: flex; flex-direction: column; gap: 1px;
    min-width: 0;
}
.hdr-location {
    font-weight: 700; font-size: 16px;
    letter-spacing: .2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hdr-observer { font-size: 12px; opacity: .85; }
.hdr-right { display: flex; align-items: center; gap: 8px; }

.status {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.18);
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.35);
    font-size: 11px;
}
.dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #c44;
    display: inline-block;
}
.dot.online {
    background: #b6e83a;
    box-shadow: 0 0 0 2px rgba(182,232,58,.30);
}
.queue {
    font-variant-numeric: tabular-nums; font-weight: 700;
    color: #fff;
    min-width: 14px; text-align: center;
}
.queue.has-items {
    background: var(--orange);
    padding: 1px 7px;
    border-radius: 999px;
    text-shadow: none;
}
.icon-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 6px;
    color: #fff;
    width: 34px; height: 34px;
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: rgba(255,255,255,.32); }

/* ── ENTRY MAIN ────────────────────────────────────────────── */
.entry {
    padding: 10px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 10px;
    max-width: 540px; margin: 0 auto;
}
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px 14px;
    border-left: 4px solid var(--brand-teal);
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.card-title {
    font-weight: 700;
    color: var(--grey-900);
    font-size: 15px;
    letter-spacing: .2px;
}
.selected-value {
    font-size: 12px;
    color: var(--grey-600);
    margin-top: 8px;
}
.selected-value strong {
    color: var(--grey-900);
    font-size: 15px;
}

/* ── KEYPADS ───────────────────────────────────────────────── */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.keypad-women { grid-template-columns: repeat(5, 1fr); }
.key {
    background: #fff;
    color: var(--grey-900);
    border: 1.5px solid var(--grey-300);
    border-radius: 8px;
    font-size: 22px; font-weight: 700;
    font-family: inherit;
    min-height: var(--tap);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .04s;
    font-variant-numeric: tabular-nums;
    -webkit-tap-highlight-color: transparent;
}
.key:hover { border-color: var(--brand-teal); background: var(--teal-light); }
.key:active { transform: scale(.96); }
.key.selected {
    background: var(--brand-gradient);
    color: #fff;
    border-color: var(--brand-teal);
    box-shadow: 0 2px 6px rgba(38,173,227,.30);
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.key.zero { background: var(--grey-100); }
.key:disabled {
    opacity: .25; cursor: not-allowed; background: var(--grey-200);
}
.key-wide {
    width: 100%;
    margin-top: 8px;
    min-height: 50px;
    font-size: 20px;
}

.toggle .chip {
    background: #fff;
    color: var(--brand-teal);
    border: 1.5px solid var(--brand-teal);
    border-radius: 999px;
    padding: 4px 14px;
    font-weight: 700; font-size: 13px;
    font-family: inherit;
    cursor: pointer; min-height: 34px;
}
.toggle .chip[aria-pressed="true"] {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
}

/* ── BIKE ROWS ─────────────────────────────────────────────── */
.bike-row {
    border-top: 1px solid var(--grey-200);
    padding: 10px 0;
}
.bike-row:first-child { border-top: 0; padding-top: 4px; }
.bike-row-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.bike-label {
    font-weight: 600; font-size: 14px;
    color: var(--grey-900);
}
.bike-count {
    font-variant-numeric: tabular-nums;
    font-weight: 700; font-size: 20px;
    color: var(--teal-dark);
    background: var(--teal-light);
    padding: 2px 12px;
    border-radius: 999px;
    min-width: 44px; text-align: center;
    cursor: pointer; user-select: none;
}
.bike-count.zero { background: var(--grey-100); color: var(--grey-600); }
.bike-row .keys {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}
.bike-row .keys .add-key {
    background: #fff;
    color: var(--brand-teal);
    border: 1.5px solid var(--grey-300);
    border-radius: 6px;
    font-size: 13px; font-weight: 700;
    font-family: inherit;
    min-height: 40px;
    padding: 0 2px;
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .04s;
    -webkit-tap-highlight-color: transparent;
}
.bike-row .keys .add-key:hover {
    background: var(--teal-light);
    border-color: var(--brand-teal);
}
.bike-row .keys .add-key:active { transform: scale(.94); }

.sum-indicator {
    font-size: 12px; font-weight: 600;
    color: var(--grey-600);
    background: var(--grey-100);
    padding: 3px 10px; border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.sum-indicator.match {
    background: var(--status-green-bg);
    color: var(--status-green);
}
.sum-indicator.over {
    background: var(--orange-light);
    color: var(--orange);
}

/* ── SLIDER ────────────────────────────────────────────────── */
.slider {
    width: 100%;
    height: 44px;
    -webkit-appearance: none; appearance: none;
    background: transparent;
    margin: 4px 0;
}
.slider::-webkit-slider-runnable-track {
    height: 8px; border-radius: 4px;
    background: var(--brand-gradient);
}
.slider::-moz-range-track {
    height: 8px; border-radius: 4px;
    background: var(--brand-gradient);
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--brand-teal);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    margin-top: -13px;
    cursor: pointer;
}
.slider::-moz-range-thumb {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--brand-teal);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    cursor: pointer;
}
.slider-labels {
    display: flex; justify-content: space-between;
    font-size: 11px;
    color: var(--grey-600);
    margin-top: 2px;
    padding: 0 6px;
}
.slider-detail {
    text-align: center; margin-top: 6px;
    font-size: 14px; font-weight: 700;
    color: var(--teal-dark);
}
.impression-value {
    font-variant-numeric: tabular-nums;
    font-size: 20px; font-weight: 700;
    color: var(--teal-dark);
    background: var(--teal-light);
    padding: 2px 14px;
    border-radius: 999px;
    min-width: 44px; text-align: center;
}

/* ── ACTIONS ───────────────────────────────────────────────── */
.actions {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(245,245,245,.95);
    backdrop-filter: blur(6px);
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; gap: 10px;
    border-top: 1px solid var(--grey-300);
    z-index: 40;
}
.actions .btn { flex: 1; }
.actions .btn-primary { flex: 2; }

/* ── TOAST ─────────────────────────────────────────────────── */
.toast {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    background: var(--brand-gradient);
    color: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    justify-content: space-between;
    box-shadow: var(--shadow);
    z-index: 60;
    font-size: 14px; font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
    animation: toast-in .2s ease-out;
}
.toast-btn {
    background: rgba(255,255,255,.22);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700; font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.toast-btn:active { background: rgba(255,255,255,.34); }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── kleine Screens ────────────────────────────────────────── */
@media (max-width: 360px) {
    .key { font-size: 19px; min-height: 50px; }
    .bike-row .keys { gap: 2px; }
    .bike-row .keys .add-key {
        font-size: 11px;
        min-height: 36px;
        padding: 0 1px;
        border-width: 1px;
    }
}
