/*
 * Abfahrkontrolle Lkw & Bus – Stile (27.07.2026).
 * Gehoert zu abfahrkontrolle_lkw_bus.php, geladen ueber $css_seiten in tpl/header.php.
 * Farbwelt bewusst am gelben Kartenblatt der PDF-Vorlage orientiert.
 * Alles ist einspaltig ab 320 px nutzbar (rules.md § 9).
 */

/* ---------- Grundfarben ---------- */
#abfahrkontrolle {
    --ak-gelb: #f9b91a;
    --ak-gelb-weich: #fde9b4;
    --ak-dark: #1f2937;
    --ak-grey: #6b7280;
    --ak-gruen: #28a745;
}

/* ---------- Kopfbereich ---------- */
#abfahrkontrolle .ak_label {
    text-align: center;
    font-size: 0.82em;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b07d00;
    background: rgba(249, 185, 26, 0.16);
    border-radius: 999px;
    padding: 5px 14px;
    display: table;
    margin: 0 auto 12px auto;
}
#abfahrkontrolle h1 { text-align: center; font-size: 1.5em; margin: 0 0 12px 0; }
#abfahrkontrolle .ak_intro {
    max-width: 820px;
    margin: 0 auto 18px auto;
    text-align: center;
    color: var(--ak-grey);
    font-size: 1.05em;
    line-height: 1.6;
}

/* ---------- Fortschrittsleiste ---------- */
#abfahrkontrolle .ak_progress_bar {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    padding: 16px 18px;
}
#abfahrkontrolle .ak_progress_text {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
#abfahrkontrolle .ak_progress_label { font-weight: 800; color: var(--ak-dark); }
#abfahrkontrolle .ak_progress_zahl { color: var(--ak-grey); font-size: 0.95em; }
#abfahrkontrolle .ak_progress_zahl b { color: var(--ak-dark); font-size: 1.1em; }
#abfahrkontrolle .ak_progress_track {
    margin: 10px 0 14px 0;
    height: 10px;
    border-radius: 999px;
    background: #eceff3;
    overflow: hidden;
}
#abfahrkontrolle .ak_progress_fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ak-gelb), var(--ak-gruen));
    transition: width .25s ease;
}
#abfahrkontrolle .ak_reset_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: var(--ak-dark);
    font-size: 0.92em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
#abfahrkontrolle .ak_reset_btn:hover { background: #f1f3f6; border-color: #d8dce2; }
#abfahrkontrolle .ak_reset_btn:focus-visible { outline: 2px solid var(--ak-gelb); outline-offset: 2px; }

/* Schalter "Fortschritt merken" – steht bewusst aus, siehe js/abfahrkontrolle.js */
#abfahrkontrolle .ak_save_row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted #e5e7eb;
    display: flex;
    justify-content: center;
}
#abfahrkontrolle .ak_save_row[hidden] { display: none; }
#abfahrkontrolle .ak_save_switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 6px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
#abfahrkontrolle .ak_save_switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}
#abfahrkontrolle .ak_save_track {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color .18s ease;
}
#abfahrkontrolle .ak_save_track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform .18s ease;
}
#abfahrkontrolle .ak_save_switch input:checked ~ .ak_save_track { background: var(--ak-gruen); }
#abfahrkontrolle .ak_save_switch input:checked ~ .ak_save_track::after { transform: translateX(18px); }
#abfahrkontrolle .ak_save_switch input:focus-visible ~ .ak_save_track { outline: 2px solid var(--ak-dark); outline-offset: 2px; }
#abfahrkontrolle .ak_save_label { font-weight: 700; color: var(--ak-dark); font-size: 0.95em; }

#abfahrkontrolle .ak_store_note {
    max-width: 560px;
    margin: 12px auto 0 auto;
    text-align: center;
    color: var(--ak-grey);
    font-size: 0.82em;
    line-height: 1.5;
}
#abfahrkontrolle .ak_store_warn {
    max-width: 560px;
    margin: 8px auto 0 auto;
    text-align: center;
    color: #92400e;
    background: rgba(249, 185, 26, 0.14);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82em;
    line-height: 1.5;
}
#abfahrkontrolle .ak_store_warn[hidden] { display: none; }
#abfahrkontrolle .ak_alldone {
    max-width: 560px;
    margin: 14px auto 0 auto;
    text-align: center;
    font-weight: 800;
    color: var(--ak-gruen);
    background: rgba(40, 167, 69, 0.10);
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 1.5;
}
#abfahrkontrolle .ak_alldone[hidden] { display: none; }

/* ---------- Karten-Raster ---------- */
#abfahrkontrolle .ak_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    max-width: 980px;
    margin: 0 auto;
}
#abfahrkontrolle .ak_card {
    background: linear-gradient(180deg, #fcc63a, var(--ak-gelb));
    border-radius: 18px;
    padding: 16px 16px 18px 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    min-width: 0;
}
#abfahrkontrolle .ak_card_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 4px 12px 4px;
}
#abfahrkontrolle .ak_card_title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 800;
    color: #3b2d00;
    text-align: left;
}
#abfahrkontrolle .ak_card_count {
    flex: 0 0 auto;
    font-size: 0.86em;
    font-weight: 800;
    color: #6b5200;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}
#abfahrkontrolle .ak_card.is-complete .ak_card_count {
    background: var(--ak-gruen);
    color: #fff;
}

/* ---------- Punkte ---------- */
#abfahrkontrolle .ak_list { list-style: none; margin: 0; padding: 0; }
#abfahrkontrolle .ak_li { margin: 0 0 8px 0; }
#abfahrkontrolle .ak_li:last-child { margin-bottom: 0; }

#abfahrkontrolle .ak_item {
    position: relative;   /* haelt das unsichtbare Kaestchen in der Zeile */
    display: grid;
    grid-template-columns: 26px 22px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 44px;
    padding: 11px 12px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    line-height: 1.45;
    transition: background-color .15s ease, opacity .15s ease;
    -webkit-tap-highlight-color: transparent;
}
#abfahrkontrolle .ak_item:hover { background: #fffdf6; }

/* Das echte Kaestchen bleibt bedienbar, ist aber unsichtbar; sichtbar ist .ak_box */
#abfahrkontrolle .ak_cb {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}
#abfahrkontrolle .ak_box {
    grid-column: 1;
    width: 26px;
    height: 26px;
    border: 2px solid #d3d8de;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background-color .15s ease, border-color .15s ease;
}
#abfahrkontrolle .ak_box svg { width: 16px; height: 16px; opacity: 0; transition: opacity .15s ease; }
#abfahrkontrolle .ak_cb:checked ~ .ak_box { background: var(--ak-gruen); border-color: var(--ak-gruen); }
#abfahrkontrolle .ak_cb:checked ~ .ak_box svg { opacity: 1; }
#abfahrkontrolle .ak_cb:focus-visible ~ .ak_box { outline: 2px solid var(--ak-dark); outline-offset: 2px; }

#abfahrkontrolle .ak_nr { grid-column: 2; font-weight: 800; color: var(--ak-grey); font-size: 0.95em; padding-top: 2px; }
#abfahrkontrolle .ak_txt { grid-column: 3; color: var(--ak-dark); font-size: 0.95em; overflow-wrap: break-word; }

#abfahrkontrolle .ak_cb:checked ~ .ak_nr,
#abfahrkontrolle .ak_cb:checked ~ .ak_txt { color: #9aa1ab; text-decoration: line-through; text-decoration-thickness: 1px; }

/* Unterpunkte a)–d) */
#abfahrkontrolle .ak_sub {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 10px 12px 10px 14px;
    background: rgba(255, 255, 255, 0.62);
    border-radius: 10px;
}
#abfahrkontrolle .ak_sub li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    font-size: 0.88em;
    line-height: 1.5;
    color: #3b2d00;
    padding: 3px 0;
}
#abfahrkontrolle .ak_sub_nr { font-weight: 800; }
#abfahrkontrolle .ak_sub_txt { overflow-wrap: break-word; }

/* ---------- Hinweis & Abschluss ---------- */
#abfahrkontrolle .ak_hinweis {
    max-width: 980px;
    margin: 22px auto 0 auto;
    text-align: center;
    color: var(--ak-grey);
    font-size: 0.82em;
    line-height: 1.55;
}
#abfahrkontrolle .ak_cta { max-width: 720px; margin: 0 auto; text-align: center; }
#abfahrkontrolle .ak_cta h2 { font-size: 1.35em; margin: 0 0 8px 0; }
#abfahrkontrolle .ak_cta p { color: var(--ak-grey); line-height: 1.6; margin: 0 0 16px 0; }
#abfahrkontrolle .ak_cta_btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--ak-gelb);
    color: #3b2d00;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(249, 185, 26, 0.35);
    transition: transform .12s ease, box-shadow .12s ease;
}
#abfahrkontrolle .ak_cta_btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(249, 185, 26, 0.45); }
#abfahrkontrolle .ak_cta_btn:focus-visible { outline: 2px solid var(--ak-dark); outline-offset: 3px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
    #abfahrkontrolle .ak_grid { grid-template-columns: 1fr; max-width: 520px; gap: 18px; }
}
/* Der seitliche Rand kommt aus css/start.css (.article_wrapper_1_row{padding:20px}).
   Auf dem Handy nehmen wir ihn hier gezielt zurueck, sonst verschenken die Karten
   rund 30 px Breite. Gleiches Rezept wie in Merkhilfe und Berater. */
@media (max-width: 650px) {
    #abfahrkontrolle .article_wrapper_1_row { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 360px) {
    #abfahrkontrolle .article_wrapper_1_row { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 480px) {
    #abfahrkontrolle h1 { font-size: 1.3em; }
    #abfahrkontrolle .ak_intro { font-size: 1em; }
    #abfahrkontrolle .ak_card { padding: 14px 12px 16px 12px; border-radius: 16px; }
    #abfahrkontrolle .ak_item { grid-template-columns: 26px minmax(0, 1fr); padding: 11px 10px; column-gap: 9px; }
    #abfahrkontrolle .ak_nr { display: none; }          /* die Nummer steckt schon in der Reihenfolge */
    #abfahrkontrolle .ak_txt { grid-column: 2; font-size: 0.93em; }
    #abfahrkontrolle .ak_sub { padding: 9px 10px; }
    #abfahrkontrolle .ak_progress_bar { padding: 14px; border-radius: 14px; }
    #abfahrkontrolle .ak_reset_btn { width: 100%; }
    #abfahrkontrolle .ak_save_switch { gap: 9px; }
    #abfahrkontrolle .ak_save_label { font-size: 0.9em; }
}

/* Bewegung reduzieren, wenn das Geraet es wuenscht */
@media (prefers-reduced-motion: reduce) {
    #abfahrkontrolle .ak_progress_fill,
    #abfahrkontrolle .ak_box,
    #abfahrkontrolle .ak_box svg,
    #abfahrkontrolle .ak_cta_btn { transition: none; }
}
