/* Verwaltungsportal (Campus-Radar). Material-Design-Anlehnung, Marke #428bc0.
   Struktur-Richtung: schoolib-Admin-Login (App-Bar + zentrale Login-Karte + Footer). */

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/material-symbols-outlined.woff2) format('woff2');
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
}

:root {
  --brand: #428bc0;
  --brand-dark: #3a7dad;
  --surface: #ffffff;
  --outline: #c3d2df;
  --text: #1b2733;
  --muted: #5f7382;
  --bg: #eef4fa;
  --error: #b3261e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
.mbody {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

/* ---- App-Bar (Material top app bar) ---- */
.mtopbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 32px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(27, 39, 51, 0.10);
  position: sticky;
  top: 0;
  z-index: 10;
}
.mtopbar img { height: 36px; width: 36px; object-fit: contain; }
.mtopbar .brand { font-family: bigTitle, sans-serif; font-weight: 700; font-size: 1.15rem; }
.mtopbar .brand .w1 { color: var(--brand); }
.mtopbar .brand .w2 { color: #909090; }
.mtopbar .sep { color: #b0bec5; }
.mtopbar .school { color: var(--muted); font-weight: 500; }
.mtopbar .school-portal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-transform: uppercase; letter-spacing: .5px; font-size: .9rem;
}
.mtopbar .school .short { color: var(--brand); font-weight: 700; }
.mtopbar .spacer { margin-left: auto; }
.mtopbar .mlogout {
  color: var(--brand); text-decoration: none; font-size: .9rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.mtopbar .mlogout:hover { text-decoration: underline; }

/* ---- Layout ---- */
.mmain { flex: 1 0 auto; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }

/* ---- Card ---- */
.mcard {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 1px 2px rgba(27, 39, 51, .08), 0 10px 28px rgba(66, 139, 192, .16);
}
.mcard.mcard-wide { max-width: 640px; }
.mcard-logo { display: block; width: 64px; height: 64px; object-fit: contain; margin: 0 auto 10px; }
.mcard h2 { font-family: bigTitle, sans-serif; color: var(--text); font-size: 1.5rem; margin: 0; text-align: center; }
.msub { text-align: center; color: var(--muted); margin: 2px 0 22px; font-size: .95rem; }

/* ---- Material-Textfeld (outlined, schwebendes Label, leading Icon) ---- */
.mform { display: flex; flex-direction: column; gap: 20px; }
.mfield { position: relative; }
.mfield-input {
  width: 100%;
  padding: 11px 12px 11px 44px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  font-size: .92rem;
  font-family: standard, sans-serif;
  background: var(--surface);
  color: var(--text);
}
.mfield-input:focus { outline: none; border: 2px solid var(--brand); padding: 10px 11px 10px 43px; }
.mfield-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 20px; pointer-events: none;
}
.mfield-label {
  position: absolute; left: 42px; top: 50%; transform: translateY(-50%);
  color: var(--muted); background: var(--surface); padding: 0 5px;
  font-size: .92rem; pointer-events: none; transition: all .15s ease;
}
.mfield-input:focus + .mfield-label,
.mfield-input:not(:placeholder-shown) + .mfield-label {
  top: 0; left: 40px; font-size: .74rem; color: var(--brand);
}

/* ---- Radar-Login (runde Scheibe, zarte Ringe, dezenter Sweep, Logo im BG) ---- */
:root {
  --ring: rgba(66, 139, 192, .14);
  --cross: rgba(66, 139, 192, .09);
  --sweep: rgba(66, 139, 192, .34);
}
.mcard-radar {
  position: relative;
  overflow: hidden;
  width: clamp(340px, 92vw, 460px);
  aspect-ratio: 1 / 1;
  max-width: 460px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Heller Scheibenverlauf + konzentrische Ringe + Fadenkreuz uebereinander. */
  background:
    repeating-radial-gradient(circle at 50% 50%,
      transparent 0 39px, var(--ring) 39px 40px),
    linear-gradient(to right,
      transparent calc(50% - .5px), var(--cross) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom,
      transparent calc(50% - .5px), var(--cross) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
    radial-gradient(circle at 50% 46%, #fbfdff 0%, #eef6fc 58%, #ddebf7 100%);
  box-shadow:
    inset 0 0 0 1px rgba(66, 139, 192, .22),
    0 1px 2px rgba(27, 39, 51, .08),
    0 18px 50px rgba(66, 139, 192, .24);
}
/* Aeusserer Ringrand (Dish-Rim, echot das Logo). */
.mcard-radar::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(66, 139, 192, .16);
  pointer-events: none;
}
/* Logo gross und schwach im Hintergrund. */
.mradar-logo {
  position: absolute;
  inset: 0;
  background: url(../img/logo.png) no-repeat center / 74%;
  opacity: .07;
  pointer-events: none;
}
/* Rotierender Radar-Sweep, zur Mitte hin ausgeblendet (haelt das Formular lesbar). */
.mradar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg,
    var(--sweep) 0deg,
    rgba(66, 139, 192, .14) 22deg,
    rgba(66, 139, 192, 0) 78deg,
    rgba(66, 139, 192, 0) 360deg);
  -webkit-mask: radial-gradient(circle at center, transparent 24%, #000 62%);
          mask: radial-gradient(circle at center, transparent 24%, #000 62%);
  animation: mradar-spin 6s linear infinite;
}
@keyframes mradar-spin {
  to { transform: rotate(360deg); }
}
/* Inhalt ueber den Dekor-Ebenen. */
.mradar-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 300px;
  padding: 0 8px;
}
/* Screenreader-Titel (visuell versteckt; ersetzt die frühere sichtbare Headline). */
.msr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Schmale Radar-Zierleiste mit Schulkürzel als Peilmarke. */
.mrule {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 230px; margin: 0 auto 5px;
}
.mrule-line {
  flex: 1; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(66, 139, 192, .55));
}
.mrule-line:last-child {
  background: linear-gradient(90deg, rgba(66, 139, 192, .55), transparent);
}
.mrule-line-solo {
  flex: 0 0 74px; max-width: 74px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}
.mrule-tag {
  font-family: bigTitle, sans-serif;
  font-size: .74rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--brand); white-space: nowrap;
}
.mradar-content .mform { gap: 16px; }
/* Freie Mitte: Abstand zwischen Feldern und Button, damit "Campus" im BG-Logo durchscheint. */
.mradar-content .mbtn { margin-top: 60px; }
/* Inputs + Button (samt Hinweis) 25px nach unten; Zierleiste bleibt fix (Transform ändert kein Layout). */
.mradar-content .mform,
.mradar-content .mhint { transform: translateY(10px); }
.mradar-content .mhint { margin-top: 16px; }
.mradar-content .merror { margin-bottom: 14px; }
/* Auf schmalen Screens: kein Kreiszwang, damit nichts abgeschnitten wird. */
@media (max-width: 520px) {
  .mcard-radar {
    aspect-ratio: auto;
    border-radius: 24px;
    padding: 30px 22px;
  }
  .mradar-logo { background-size: 62%; }
  .mradar-content .mbtn { margin-top: 12px; }
  .mradar-content .mform,
  .mradar-content .mhint { transform: none; }
  .mtopbar { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mradar-sweep { animation: none; opacity: .5; }
}

/* ---- Material Pill-Button ---- */
.mbtn {
  margin-top: 4px;
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 24px;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .3px;
  font-family: standard, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(27, 39, 51, .25);
  transition: background .15s, box-shadow .15s;
}
a.mbtn { display: block; text-align: center; text-decoration: none; }
.mbtn:hover { background: var(--brand-dark); box-shadow: 0 3px 10px rgba(66, 139, 192, .4); }
.mbtn:active { box-shadow: none; }
.mbtn:disabled { opacity: .6; cursor: default; box-shadow: none; }

/* ---- Fehlermeldung (Material) ---- */
.merror {
  display: flex; align-items: center; gap: 8px;
  background: #fceceb; color: var(--error);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; font-size: .9rem;
}
.merror .material-symbols-outlined { font-size: 20px; }

.mhint { margin-top: 20px; font-size: .78rem; color: #8093a3; line-height: 1.45; text-align: center; }

/* ---- Dashboard-Panel ---- */
.mpanel {
  margin-top: 16px; background: #f4f9fd; border-radius: 12px;
  border-left: 4px solid var(--brand); padding: 18px 20px; color: var(--muted);
}

/* ---- Footer ---- */
.mfooter { flex-shrink: 0; text-align: center; padding: 16px; color: #8093a3; font-size: .78rem; }
.mimpressum-link {
  background: none; border: 0; padding: 0; margin: 0;
  color: #8093a3; font: inherit; cursor: pointer; text-decoration: underline;
}
.mimpressum-link:hover { color: var(--brand); }

/* ---- Impressum-Modal ---- */
.mmodal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.mmodal[hidden] { display: none; }
.mmodal-backdrop { position: absolute; inset: 0; background: rgba(15, 25, 35, .5); }
.mmodal-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.mmodal-card h2 { font-family: bigTitle, sans-serif; color: var(--brand); margin: 0 0 12px; }
.mmodal-card h3 { color: var(--text); margin: 10px 0 4px; font-size: 1.05rem; }
.mmodal-card h4 { color: var(--text); margin: 16px 0 2px; font-size: .95rem; }
.mmodal-card p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 4px 0; }
.mmodal-card a { color: var(--brand); word-break: break-all; }
.mmodal-card hr { border: 0; border-top: 1px solid #e3ebf2; margin: 16px 0; }
.mmodal-close {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 0; cursor: pointer; color: var(--muted); line-height: 0; padding: 4px;
}
.mmodal-close:hover { color: var(--text); }
