/* karteikarte.com – Stylesheet (mobile first, ruhig und schlicht)
 *
 * Grundsätze: eine Akzentfarbe, wenige Linien, keine Schatten, viel Weißraum.
 * Die Klassen der bestehenden Templates (box-100, subject-list, button-big, …) bleiben erhalten.
 */

:root {
    --paper:       #F6F4EF;
    --surface:     #FFFFFF;
    --ink:         #23282F;
    --text:        #2F353E;
    --muted:       #666B75;
    --rule:        #DEDACF;
    --rule-soft:   #ECE9E0;
    --accent:      #C0621F;
    --accent-ink:  #9A4B15;
    --accent-soft: #F6E9DC;
    --slate:       #2A3B52;
    --slate-hover: #1D2B3D;
    --head:        #B5561E;
    --head-line:   rgba(255,255,255,.14);
    --danger:      #9E3A2C;
    --danger-soft: #F6E5E1;
    --ok:          #3F6B52;
    --ok-soft:     #E4EEE7;
    --radius:      6px;
    --maxw:        1080px;
    --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.65; }
img, svg { max-width: 100%; height: auto; border: 0; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.3; margin: 0 0 .6em; font-weight: 600; }
h1, h2 { font-family: var(--serif); letter-spacing: -.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
h4 span { font-weight: 400; }
.content h1 { font-size: 1.3rem; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }

a { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .2em; }
a:hover { color: color-mix(in srgb, var(--ink) 72%, var(--accent)); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, label.nav-toggle:focus-visible {
    outline: 3px solid #C9A24A; outline-offset: 2px;
}

.breaker { clear: both; height: 0; line-height: 0; }
.float-right { float: right; }
.float-left  { float: left; }
.small  { font-size: .9em; }
.grey   { color: var(--muted) !important; font-weight: 400; }
.center { text-align: center; }
.hide   { display: none; }

/* ---------- Rahmen: der Kopf geht über die volle Breite, der Inhalt ist begrenzt ---------- */
#wrapper { margin: 0; padding: 0; }
#page, .hero, #footer, #register-box { max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }

/* ---------- Kopf ---------- */
#header { background: var(--head); color: #fff; padding: 0 16px; }
.header-inner { max-width: calc(var(--maxw) + 120px); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 24px; min-height: 60px; padding: 8px 0; }

.logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; flex: 0 0 auto; }
.logo:hover { color: #fff; }
.logo-mark { display: block; color: #fff; }
.logo-mark rect { fill: transparent; }
.logo-mark line { stroke: #fff; }
.logo-word { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.logo-tld { font-family: var(--sans); font-size: .72em; font-weight: 400; color: rgba(255,255,255,.7); margin-left: 1px; letter-spacing: 0; }
#slogan { display: none; }

.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
label.nav-toggle {
    margin-left: auto; display: inline-flex; align-items: center; justify-content: center; float: none;
    width: 42px; height: 42px; padding: 0; border: 1px solid var(--head-line); border-radius: var(--radius);
    background: transparent; cursor: pointer; font-size: 1.3rem; line-height: 1; color: #fff;
}
#navigation { display: none; flex-basis: 100%; }
.nav-toggle-input:checked ~ .header-inner #navigation { display: block; }
#navigation ul { list-style: none; margin: 0; padding: 0; }
#navigation li a { display: block; padding: 12px 2px; font-weight: 500; text-decoration: none; color: #fff; border-top: 1px solid var(--head-line); }
#navigation li a:hover { color: #fff; }
#navigation li a.hit { color: #fff; font-weight: 600; }
#navigation li a.highlight { color: #fff; }
.nav-lang { display: flex; gap: 14px; padding: 12px 2px; border-top: 1px solid var(--head-line); font-size: .9rem; }
.nav-lang a { text-decoration: none; color: rgba(255,255,255,.7); }
.nav-lang a[aria-current="true"] { color: #fff; font-weight: 600; }
.nav-user { padding: 12px 2px; border-top: 1px solid var(--head-line); font-size: .9rem; color: rgba(255,255,255,.7); }
.nav-user a { font-weight: 500; color: #fff; text-decoration: none; }

/* ---------- Start ---------- */
.hero { padding-top: 36px; padding-bottom: 8px; }
.hero-grid { display: grid; gap: 28px; }
.hero-eyebrow { display: none; }
.hero h1 { font-size: 2.05rem; line-height: 1.15; margin-bottom: .5em; }
.hero-lead { font-size: 1.05rem; max-width: 34em; margin-bottom: 1.3em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-card { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 34px 22px 24px; max-width: 400px; width: 100%; justify-self: center; }
.hero-card .tag { position: absolute; right: 14px; top: 11px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hero-card .q { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); margin: 0 0 14px; }
.hero-card .a { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule-soft); color: var(--text); }

.steps { display: grid; gap: 18px; margin: 34px 0 6px; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding: 14px 0 0 0; border-top: 1px solid var(--rule); }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-size: 1.4rem; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.steps strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: .94rem; }

.section-title { font-size: 1.15rem; margin: 36px 0 12px; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 1em; padding: 0; list-style: none; }
.tile { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); height: 100%; }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile strong { display: block; font-weight: 600; line-height: 1.3; }
.tile span { font-size: .85rem; color: var(--muted); }

/* ---------- Inhalt ---------- */
.content { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 18px; margin: 20px 0; min-height: 240px; }
.content p { line-height: 1.65; }
.box-100 { clear: both; padding: 0; margin-bottom: 8px; }
.box-75, .box-50, .box-25 { width: 100%; float: none; }
.left, .right { padding: 0; }
#register-box { background: var(--accent-soft); border-radius: var(--radius); padding-top: 16px; padding-bottom: 16px; margin-top: 16px; margin-bottom: 16px; }

/* ---------- Formulare ---------- */
label { display: block; margin: 0 0 .25em; font-weight: 600; color: var(--ink); }
label.no_padding { padding: 0; }
label.checkbox { display: inline; font-weight: 400; margin: 0; color: var(--text); }
.text, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
    width: 100%; max-width: 480px; font: inherit; color: var(--ink); padding: 10px 12px;
    background: var(--surface); border: 1px solid #C4BFB1; border-radius: var(--radius);
}
.text:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { max-width: 100%; min-height: 110px; resize: vertical; }
textarea.lesson { font-weight: 600; }
.caption { font-size: .875rem; color: var(--muted); padding-top: 4px; }
input[type="checkbox"], input[type="radio"] { width: 1.1em; height: 1.1em; vertical-align: -.15em; accent-color: var(--slate); }
input[type="range"] { width: 100%; max-width: 480px; accent-color: var(--slate); }
form p { margin-bottom: .9em; }

/* ---------- Schaltflächen ---------- */
.submit, .submit-small, .button-big, .button-big-grey, .content .button-big, .content .button-big-grey, .btn {
    display: inline-block; padding: 10px 18px; font: inherit; font-weight: 500;
    color: #fff; text-decoration: none; text-align: center; background: var(--slate);
    border: 1px solid var(--slate); border-radius: var(--radius); cursor: pointer; line-height: 1.3;
}
.submit:hover, .button-big:hover, .content .button-big:hover, .btn:hover { background: var(--slate-hover); border-color: var(--slate-hover); color: #fff !important; }
.btn-line { background: transparent; color: var(--ink); border-color: #AFA99B; }
.btn-line:hover { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.button-big-grey, .content .button-big-grey { background: var(--rule-soft); border-color: var(--rule); color: var(--muted); cursor: default; }
.submit-small { padding: 6px 12px; }

/* ---------- Meldungen ---------- */
p.error, div.error, .error { border: 1px solid #DDB5AD; background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 1em; }
div.error ul { list-style: none; margin: 0; padding: 0; }
p.success, .success { border: 1px solid #B9CFC0; background: var(--ok-soft); color: var(--ok); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 1em; }
.info { color: var(--muted); }
.description { background: var(--paper); border-radius: var(--radius); padding: 9px 12px; margin: 0 0 1em; overflow: hidden; color: var(--text); }

/* ---------- Listen: Fächer, Lektionen, Karten ---------- */
.subject-list { list-style: none; margin: 0 0 1em; padding: 0 !important; display: grid; gap: 8px; }
.subject-list li { list-style: none; margin: 0; padding: 12px 14px !important; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-wrap: anywhere; }
.subject-list li img { float: left; margin: 2px 6px 0 0; }
.subject-list li a { font-weight: 600; line-height: 1.5; }
.subject-list li .card-front { display: block; font-weight: 600; color: var(--ink); }
.subject-list li span.description { display: block; margin: 8px 0 0; padding: 8px 10px; background: var(--paper); border-radius: 4px; font-weight: 400; }
.subject-list li span.description a { font-weight: 400; color: var(--muted); }
.subject-list li span.description:empty { display: none; }
.subject-list li span.quicklink { float: right; margin-left: 8px; color: var(--muted); font-size: .8rem; }
.subject-list li span.quicklink a { font-weight: 400; color: var(--muted); }
.user-list, .content .user-list { list-style: none; padding: 0; }
.user-list li { background: var(--paper); border-radius: 4px; padding: 8px 10px; margin: 0 0 6px; }

.navigation-page { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .95rem; margin: 0 0 1em; color: var(--muted); }
.navigation-page a { font-weight: 500; }
.navigation-page .float-right { margin-left: auto; float: none; }



table { border-collapse: collapse; }
table td { vertical-align: top; padding: 0 0 10px; }
table td.label { padding-right: 8px; }

/* ---------- Lernmodus ---------- */
.card { position: relative; min-height: 160px; }
.card_front, .card_back { position: relative; border: 1px solid var(--rule); border-radius: var(--radius); padding: 34px 18px 22px; margin: 0 0 8px; min-height: 140px; overflow-wrap: anywhere; background: var(--surface); }
.card_front { font-size: 1.15rem; color: var(--ink); }
.card_back  { font-size: 1.05rem; background: #FBFAF6; }
.card_front h1 { padding: 0; font-weight: 400; }
.card span.info, .card_wrapper span.info { position: absolute; top: 9px; right: 12px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card p { margin-bottom: .8em; }
.card ul, .card ol { padding-left: 1.4em; }

.card_action { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; margin: 12px 0; }
.card_action .button-wrong, .card_action .button-correct { display: block; padding: 15px 8px; border-radius: var(--radius); font-weight: 600; text-decoration: none; float: none; width: auto; border: 1px solid transparent; }
.card_action .button-wrong   { background: var(--surface); color: var(--danger); border-color: #D2AEA6; }
.card_action .button-correct { background: var(--surface); color: var(--ok);     border-color: #B3C9BA; }
.card_action .button-wrong:hover   { background: var(--danger-soft); }
.card_action .button-correct:hover { background: var(--ok-soft); }
.card_action .breaker { display: none; }
.card_action .button-turn { grid-column: 1 / -1; display: block; padding: 11px; width: auto; margin: 0; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; font-weight: 500; background: var(--paper); color: var(--ink); }
.box_number { display: inline-block; margin: 0 0 4px; padding: 2px 10px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--muted); font-size: .8rem; line-height: 1.5; background: var(--paper); }
.box_number::before { content: "Box "; }
.process_bg { background: var(--rule-soft); border-radius: 2px; overflow: hidden; margin: 0 0 12px; }
.process    { background: var(--accent); height: 4px; margin: 0; }
/* Anzahl der Karten einer Lektion */
.count-badge { float: right; margin: 2px 0 0 12px; padding: 2px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* Bestätigungsdialog */
dialog.confirm { border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 22px 18px; max-width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog.confirm::backdrop { background: rgba(35, 40, 47, .5); }
dialog.confirm form { margin: 0; }
.confirm-text { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-actions .btn { min-width: 110px; }
/* Handy: Antwort-Buttons am unteren Rand fixiert, mit dem Daumen erreichbar */
@media (max-width: 767px) {
    .card_action {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: var(--paper); border-top: 1px solid var(--rule);
        box-shadow: 0 -4px 12px rgba(0,0,0,.06);
    }
    .card_action .button-wrong, .card_action .button-correct { padding: 17px 8px; }
    .card_action .button-turn { padding: 13px; }
    body:has(.card_action) { padding-bottom: 170px; }
}
@media (max-width: 767px) { .hint-keys { display: none; } }

.auto_complete, .ui-autocomplete { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px 0; list-style: none; }
.message_inbox { width: 100%; border: 1px solid var(--rule); }
.message_inbox td, .message_inbox th { padding: 6px; border-bottom: 1px solid var(--rule); text-align: left; }
.message_text { padding: 10px; margin: 0 0 1em; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--radius); }

/* ---------- Werbung ----------
 * Jeder Platz reserviert seine Höhe vor dem Laden der Anzeige, damit der Text nicht springt.
 */
.ad { display: block; clear: both; margin: 20px auto; text-align: center; min-height: 286px; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8A8F99; margin-bottom: 4px; }
.ad .adsbyvli { display: inline-block; max-width: 100%; }
.ads-line { text-align: center; }
li.ads_subject-list { background: none !important; border: 0 !important; padding: 0 !important; }
.ads_top, .ads_bottom, .ads_footer { display: block; text-align: center; }

/* ---------- Fuß ---------- */
#footer { text-align: center; font-size: .875rem; color: var(--muted); padding-top: 12px; padding-bottom: 30px; }
#footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; }
#footer li { display: inline; padding: 0; }
#footer a { color: var(--muted); font-weight: 400; }
#footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Breiter als Handy ---------- */
@media (min-width: 640px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    #page, .hero, #footer, #register-box { padding-left: 24px; padding-right: 24px; }
    #header { padding: 0 24px; }
    .content { padding: 28px 32px; margin: 24px 0; }

    .hero { padding-top: 56px; }
    .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; gap: 48px; }
    .hero h1 { font-size: 2.6rem; }
    .tiles { gap: 12px; }

    .box-50 { width: calc(50% - 16px); float: left; }
    .box-50.left  { margin-right: 32px; }
    .box-75 { width: calc(75% - 12px); float: left; }
    .box-25 { width: calc(25% - 12px); float: left; }
    .card_front, .card_back { padding: 38px 28px 26px; }
}

@media (min-width: 1120px) {
    label.nav-toggle { display: none; }
    .header-inner { flex-wrap: nowrap; gap: 2px 20px; }
    #navigation { display: flex; flex: 1 1 auto; flex-basis: auto; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
    #navigation ul { display: flex; flex-wrap: nowrap; gap: 2px; }
    #navigation li a { border-top: 0; padding: 6px 9px; font-size: .95rem; border-radius: var(--radius); }
    #navigation li a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
    #navigation li a.hit { background: rgba(255,255,255,.16); }
    .nav-lang { margin-left: auto; border-top: 0; padding: 0; }
    .nav-user { border-top: 0; padding: 0 0 0 14px; white-space: nowrap; font-size: .85rem; }
    .nav-user-label { display: none; }

}

@media (min-width: 1100px) {
    #page:has(> aside) { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
    #page > aside { position: sticky; top: 16px; padding-top: 24px; }
    .ad--sidebar { min-height: 616px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
    #header, #footer, .ad, aside, .navigation-page, .button-big { display: none !important; }
    body { background: #fff; }
    .content { border: 0; padding: 0; }
}
