/* family.css – Elternbereich der Lernreise 4.0
   Ruhiger und sachlicher als die Kinderwelt, aber in derselben Formensprache (tokens.css). */

body.eltern { background: linear-gradient(180deg, #e3ebff 0, var(--papier) 420px); }
.familie-kopf { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .8rem max(1rem, calc((100% - 1140px) / 2)); background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.familie-marke { font-family: var(--font-titel); font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--primaer-tief); }
.familie-kopf-rolle { flex: 1; color: var(--tinte-weich); font-weight: 700; }
.familie { max-width: 1140px; margin: auto; padding: 2rem 1rem 4rem; }
.familie h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.05; }
.familie h2 { font-size: 1.4rem; }
.familie h3 { font-size: 1.1rem; }
a { color: var(--primaer); }

/* Formulare */
label { display: grid; gap: .4rem; margin: .9rem 0; font-weight: 700; }
input, select { font: inherit; padding: .75rem .9rem; border: 2px solid var(--linie-stark); border-radius: 14px; width: 100%; min-width: 0; min-height: 50px; background: #fff; color: var(--tinte); transition: border-color var(--dauer), box-shadow var(--dauer); }
input:focus, select:focus { border-color: var(--primaer); box-shadow: 0 0 0 4px var(--primaer-hell); outline: none; }
.text-knopf { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: none; color: var(--primaer); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: .6rem 0; min-height: 44px; font: inherit; font-weight: 700; text-align: left; }
.hinweis-klein { font-size: .9rem; color: var(--tinte-weich); line-height: 1.55; }
#status { min-height: 1.5rem; margin: 0 0 1rem; padding: 0; color: var(--schau); font-weight: 700; }
#status:not(:empty) { padding: .8rem 1rem; background: var(--schau-hell); border-radius: 14px; }
#childError, #parentsError, #friendsError, #supportPlanError { color: var(--schau); font-weight: 700; }
#supportPlanError:not(:empty) { background: var(--gut-hell); color: var(--gut-tief); padding: .7rem .9rem; border-radius: 14px; }

/* Karten */
.familie-karte { padding: 1.5rem; background: #fff; border: 1px solid var(--linie); border-radius: 26px; margin-bottom: 1.2rem; box-shadow: var(--schatten-weich); }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

/* Anmeldung */
.familie-start { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; padding-top: 1rem; }
.familie-start-text p { font-size: 1.15rem; line-height: 1.7; color: var(--tinte-weich); max-width: 38rem; }
.vorteile { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.vorteile li { display: flex; align-items: center; gap: .8rem; font-weight: 700; }
.vorteile li span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff; box-shadow: var(--schatten-weich); font-size: 1.3rem; }
.auth-karte { border: 3px solid #fff; box-shadow: var(--schatten); padding: 2rem; }
#authSubmit { width: 100%; margin-top: .5rem; min-height: 56px; }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; }
.auth-links a { padding: .6rem 0; font-weight: 700; }

/* Übersicht */
.willkommen { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.8rem 2rem; margin-bottom: 2rem; border-radius: 30px; color: #fff; background: linear-gradient(120deg, var(--primaer) 0%, #6d4df0 60%, #8a5cf6 100%); box-shadow: var(--schatten); }
.willkommen .reise-kicker { color: rgba(255, 255, 255, .85); }
.willkommen h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); color: #fff; }
.konto-zeile { margin: .5rem 0 0; color: rgba(255, 255, 255, .9); overflow-wrap: anywhere; }
.willkommen .text-knopf { color: #fff; }
.btn-gross-eltern { min-height: 64px; font-size: 1.15rem; padding: .8rem 1.6rem; }
.familie-titel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.familie-raster { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; align-items: start; }
.familie-raster .familie-karte { margin: 0; }
.familie-raster + details { margin-top: 1.2rem; }
.familie-form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.familie-form label { flex: 1; min-width: 170px; }
.familie-form button { margin: .9rem 0; }
.familie-fuss { text-align: center; margin-top: 2rem; }

/* Kinderkarten */
.familie-kinder { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.2rem; margin-bottom: 1.6rem; }
.familie-kind { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; background: #fff; border: 1px solid var(--linie); border-radius: 26px; box-shadow: var(--schatten-weich); transition: box-shadow var(--dauer), transform var(--dauer) var(--kurve); }
.familie-kind:hover { box-shadow: var(--schatten); transform: translateY(-2px); }
.kind-kopf { display: flex; align-items: center; gap: .9rem; }
.kind-kopf .avatar { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 22px; font-size: 2.2rem; background: var(--primaer-hell); }
.familie-kind:nth-child(4n+2) .avatar { background: var(--huegel-hell); }
.familie-kind:nth-child(4n+3) .avatar { background: var(--wiese-hell); }
.familie-kind:nth-child(4n) .avatar { background: var(--turm-hell); }
.kind-kopf h3 { font-size: 1.35rem; overflow-wrap: anywhere; }
.kind-kopf p { margin: .1rem 0 0; color: var(--tinte-weich); font-size: .92rem; }
.kind-marke { margin-left: auto; align-self: flex-start; padding: .25rem .7rem; border-radius: 999px; background: var(--sonne-hell); color: #6b4a00; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.familie-kind > .btn { width: 100%; }
.foerder-box { border-radius: 18px; background: var(--flaeche-2); padding: .9rem; display: grid; gap: .5rem; }
.foerder-box.an { background: var(--sonne-hell); box-shadow: inset 0 0 0 2px #ffe08a; }
.foerder-box .btn { width: 100%; min-height: 48px; font-size: .95rem; }
.lernreise-hilfe { font-size: .85rem; line-height: 1.5; color: var(--tinte-weich); margin: 0; }
.lernreise-speicherstatus { font-size: .88rem; line-height: 1.5; margin: 0; overflow-wrap: anywhere; color: var(--gut-tief); font-weight: 700; }
.lernreise-speicherstatus:empty { display: none; }
.familie-kind [data-support][hidden] { display: none; }
.kind-mehr { display: flex; flex-wrap: wrap; gap: 0 1rem; border-top: 1px solid var(--linie); padding-top: .3rem; }
.kind-mehr .text-knopf { text-decoration: none; font-size: .92rem; color: var(--tinte-weich); }
.kind-mehr .text-knopf:hover { color: var(--primaer); }

/* Schalter (echte Checkbox, als Kippschalter gestaltet) */
.schalter { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .8rem; margin: .6rem 0; cursor: pointer; font-weight: 400; position: relative; }
.schalter input { position: absolute; opacity: 0; width: 56px; height: 32px; margin: 0; min-height: 0; cursor: pointer; }
.schalter-spur { position: relative; width: 56px; height: 32px; border-radius: 999px; background: var(--linie-stark); transition: background .2s; margin-top: .1rem; }
.schalter-spur::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .25s var(--feder); }
.schalter input:checked + .schalter-spur { background: var(--gut); }
.schalter input:checked + .schalter-spur::after { transform: translateX(24px); }
.schalter input:focus-visible + .schalter-spur { outline: 3px solid var(--primaer); outline-offset: 3px; }
.schalter input:disabled + .schalter-spur { opacity: .5; }
.schalter b { display: block; font-size: 1rem; }
.schalter small { display: block; color: var(--tinte-weich); font-size: .86rem; line-height: 1.45; margin-top: .1rem; }

/* Förderplan-Dialog */
dialog { max-height: 92vh; overflow: auto; }
#childDialog, #parentsDialog { width: min(94vw, 500px); }
#friendsDialog { width: min(94vw, 560px); }
.plan-dialog { width: min(96vw, 680px); }
.plan-gruppe { border: 0; margin: 0 0 1rem; padding: 1rem 1.1rem; border-radius: 20px; background: var(--flaeche-2); }
.plan-gruppe legend { font-family: var(--font-titel); font-weight: 700; font-size: 1.05rem; color: var(--primaer-tief); padding: 0; float: left; width: 100%; margin-bottom: .2rem; }
.plan-gruppe legend + * { clear: both; }
.plan-gruppe label:not(.schalter) { margin: .6rem 0; }
.plan-feld { margin: .8rem 0 .2rem; }
.plan-feld-titel { display: block; font-weight: 700; margin-bottom: .4rem; }
.plan-feld small { display: block; color: var(--tinte-weich); font-size: .86rem; margin-top: .4rem; }
.segmente { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; background: #fff; border-radius: 16px; border: 2px solid var(--linie); }
.segmente label { margin: 0; position: relative; font-weight: 700; }
.segmente input { position: absolute; opacity: 0; min-height: 0; }
.segmente span { display: grid; place-items: center; min-height: 44px; border-radius: 12px; cursor: pointer; font-size: .92rem; transition: background .2s, color .2s; }
.segmente input:checked + span { background: var(--primaer); color: #fff; }
.segmente input:focus-visible + span { outline: 3px solid var(--primaer); outline-offset: 2px; }
.plan-entdecken:not(:empty) { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 20px; background: var(--sonne-hell); }
.plan-entdecken p { margin: .3rem 0; }

/* Bericht */
.bericht { border: 3px solid #fff; box-shadow: var(--schatten); }
.bericht-kopf { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.bericht-kopf .avatar { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; font-size: 2rem; background: var(--primaer-hell); }
.bericht-kopf h2 { font-size: 1.6rem; }
.bericht h3 { margin: 1.8rem 0 .3rem; font-size: 1.15rem; }
.familie-zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.familie-zahlen div { border-radius: 20px; padding: 1rem 1.1rem; background: var(--primaer-hell); color: var(--tinte-weich); font-size: .9rem; }
.familie-zahlen div:nth-child(2) { background: var(--wiese-hell); }
.familie-zahlen div:nth-child(3) { background: var(--berg-hell); }
.familie-zahlen div:nth-child(4) { background: var(--sonne-hell); }
.familie-zahlen b { display: block; font-family: var(--font-titel); font-size: 2rem; line-height: 1.1; color: var(--tinte); }
.familie-aktivitaet { display: flex; gap: 5px; align-items: flex-end; height: 150px; margin: 1rem 0; padding: .8rem; background: var(--flaeche-2); border-radius: 18px; }
.familie-tag { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; font-size: .68rem; min-width: 0; height: 100%; color: var(--tinte-weich); }
.familie-tag b { font-size: .75rem; color: var(--tinte); }
.familie-tag i { display: block; width: 100%; max-width: 28px; background: linear-gradient(180deg, #8a5cf6, var(--primaer)); border-radius: 8px 8px 4px 4px; min-height: 3px; }
.familie-tag span { margin-top: .3rem; white-space: nowrap; }
.kompetenzen { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .7rem; }
.kompetenzen li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: center; }
.kompetenzen .balken { grid-column: 1 / -1; height: 12px; border-radius: 999px; background: var(--flaeche-2); overflow: hidden; }
.kompetenzen .balken i { display: block; height: 100%; border-radius: 999px; background: var(--gut); }
.kompetenzen .balken i.mittel { background: var(--sonne); }
.kompetenzen .balken i.noch { background: var(--huegel); }
.kompetenzen small { color: var(--tinte-weich); }
.bericht-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.bericht-raster > div { background: var(--flaeche-2); border-radius: 20px; padding: 1rem 1.1rem; }
.bericht-raster h3 { margin-top: 0; }
.wetter-verlauf { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0; font-size: 1.6rem; }
.wetter-verlauf span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fff; }
.denkweg-balken { display: flex; height: 26px; border-radius: 999px; overflow: hidden; margin: .7rem 0 .5rem; background: #fff; }
.denkweg-balken i { display: block; height: 100%; }
.dw-gesehen { background: var(--gut); } .dw-trick { background: var(--primaer); } .dw-gezaehlt { background: var(--sonne); } .dw-unsicher { background: var(--linie-stark); }
.denkweg-legende { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .9rem; }
.denkweg-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .4rem; vertical-align: middle; }
.eltern-tipp { margin-top: 1.4rem; padding: 1rem 1.2rem; border-radius: 20px; background: var(--wiese-hell); border-left: 6px solid var(--wiese); }
.eltern-tipp p { margin: .3rem 0 0; }

#messages p, #messages h3 { overflow-wrap: anywhere; }
#messages button { margin: .4rem .7rem .4rem 0; }
#messages .familie-karte { box-shadow: none; background: var(--flaeche-2); border: 0; }
#requestFriendForm { padding: .5rem 0 1.2rem; border-bottom: 1px solid var(--linie); margin-bottom: 1rem; }
#parentsInfo, #accountEmail { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .familie-start { grid-template-columns: 1fr; gap: 1.5rem; }
  .familie-raster, .bericht-raster { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .familie { padding-top: 1.2rem; }
  .familie-karte, .auth-karte { padding: 1.1rem; border-radius: 22px; }
  .willkommen { padding: 1.3rem; border-radius: 24px; }
  .willkommen .btn, .familie-titel > .btn { width: 100%; }
  .familie-kinder { grid-template-columns: minmax(0, 1fr); }
  .familie-kind { min-width: 0; }
  .segmente { grid-template-columns: repeat(3, 1fr); }
  .familie-kopf .btn { font-size: .85rem; padding: .5rem; min-height: 44px; }
}

/* ═══ Schule: Lehrkräfte, Schulthemen, Klassenansicht ═══ */
.klasse { margin-bottom: 2rem; }
.klasse-tabelle { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: 26px; box-shadow: var(--schatten-weich); }
.klasse-tabelle table { width: 100%; border-collapse: collapse; min-width: 720px; }
.klasse-tabelle th, .klasse-tabelle td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.klasse-tabelle th { font-size: .82rem; color: var(--tinte-weich); background: var(--flaeche-2); }
.klasse-tabelle tr:last-child td { border-bottom: 0; }
.klasse-tabelle .btn { min-height: 44px; padding: .4rem .8rem; font-size: .9rem; }
.klasse-kind { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.klasse-kind span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primaer-hell); font-size: 1.3rem; }
.thema-chip { display: inline-block; margin: .1rem .2rem .1rem 0; padding: .15rem .6rem; border-radius: 999px; background: var(--sonne-hell); color: #6b4a00; font-size: .8rem; font-weight: 700; }
.schule-dialog { width: min(96vw, 680px); }
.schule-dialog h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.themen-liste { display: grid; gap: .8rem; max-height: 44vh; overflow: auto; padding: .2rem; }
.themen-gebiet { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.themen-gebiet > b { flex: 1 1 100%; font-size: .9rem; color: var(--primaer-tief); }
.thema { display: inline-flex; margin: 0; font-weight: 400; cursor: pointer; }
.thema input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.thema span { display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: .3rem .8rem; border-radius: 999px; border: 2px solid var(--linie-stark); background: #fff; font-size: .9rem; transition: background .2s, border-color .2s; }
.thema input:checked + span { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.thema input:disabled + span { opacity: .45; cursor: not-allowed; }
.thema input:focus-visible + span { outline: 3px solid var(--primaer); outline-offset: 2px; }
.klasse-auswahl { display: flex; flex-wrap: wrap; gap: .4rem; }
.lehrkraft-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .3rem 0; overflow-wrap: anywhere; }
#schoolTopicsStatus:not(:empty), #teacherStatus:not(:empty), #klasseThemaStatus:not(:empty) { padding: .6rem .8rem; border-radius: 12px; background: var(--gut-hell); color: var(--gut-tief); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body.nur-lehrkraft #learn, body.nur-lehrkraft .nur-familie { display: none; }
body.nur-lehrkraft .familie-raster { grid-template-columns: 1fr; }
