/* planungstool event – Kundenkonto, Anmeldung und Admin-Bereich (Portal 0.1.0)
   Baut auf site.css auf. Keine Inline-Styles (CSP). */


/* ---------- Kopfzeile im Konto ---------- */
.app-top { background: var(--white); border-bottom: 1px solid var(--line); }
.app-top .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.app-top .brand img { height: 34px; width: auto; }
.app-nav { display: flex; gap: 6px; margin-left: 8px; }
.app-nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; }
.app-nav a[aria-current="page"] { background: var(--himmel-l); color: var(--blau); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.me .ini { width: 34px; height: 34px; border-radius: 50%; background: var(--blau); color: var(--white); display: grid; place-items: center; font-size: 14px; }
.me .out { color: var(--ink-2); font-weight: 500; text-decoration: none; margin-left: 8px; }

.page { padding: 40px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; font-weight: 800; color: var(--blau); }
.page-head p { color: var(--ink-2); margin-top: 6px; }

.layout-2 { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }

/* ---------- Event-Karten ---------- */
.ev-list { display: grid; gap: 16px; }
.ev { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; }
.ev h2 { font-size: 22px; font-weight: 700; color: var(--blau); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ev .addr-line { font-size: 15px; color: var(--ink-2); }
.ev .addr-line b { color: var(--ink); font-weight: 600; }
.ev .meta { font-size: 14px; color: var(--ink-2); display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.ev .acts { grid-row: 1 / span 3; grid-column: 2; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.ev.wait { border-style: dashed; border-color: var(--himmel); background: #FBFCFF; }

.pill { font: 700 12.5px/1 var(--f-body); letter-spacing: .02em; padding: 6px 10px; border-radius: 999px; text-transform: uppercase; }
.pill-ok { background: #DDF0E5; color: #1F6B45; }
.pill-wait { background: var(--apricot-l); color: var(--apricot-d); }
.pill-off { background: var(--paper-d); color: var(--ink-2); }
.pill-bad { background: #F6DEDC; color: #9B2C22; }

/* Fortschritt einer Anfrage */
.track { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; counter-reset: tr; }
.track li { list-style: none; position: relative; padding-top: 26px; font-size: 13.5px; color: var(--ink-2); text-align: center; }
.track li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper-d); border: 2px solid var(--line); z-index: 1; }
.track li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.track li:first-child::after { display: none; }
.track li.done::before { background: var(--blau); border-color: var(--blau); }
.track li.done::after, .track li.now::after { background: var(--blau); }
.track li.now::before { background: var(--apricot); border-color: var(--apricot-d); }
.track li.now { color: var(--ink); font-weight: 600; }
.track ol, ol.track { padding: 0; margin: 14px 0 0; }

.new-ev { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-2); flex-wrap: wrap; }
.new-ev.blocked { background: var(--paper-d); }

/* Seitenleiste im Konto */
.side-card { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px; }
.side-card + .side-card { margin-top: 16px; }
.side-card h3 { font-size: 18px; color: var(--blau); margin-bottom: 12px; }
.meter { margin-top: 12px; font-size: 14px; }
.meter .lbl { display: flex; justify-content: space-between; color: var(--ink-2); }
.meter .lbl b { color: var(--ink); }
.meter .bar span { display: block; height: 100%; background: var(--himmel); border-radius: 4px; }
.w-95 { width: 95%; } .w-45 { width: 45%; } .w-70 { width: 70%; }
.side-card p { font-size: 14.5px; color: var(--ink-2); }
.side-card a { color: var(--blau); font-weight: 600; }

/* ---------- Formular Anfrage ---------- */
.panel { background: var(--white); border: 1.5px solid var(--line); border-radius: 18px; padding: 32px; max-width: 760px; }
.panel .form { max-width: none; }
.field textarea { width: 100%; font: 500 16px var(--f-body); color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 96px; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px var(--himmel-l); }
.info { display: flex; gap: 12px; align-items: flex-start; background: var(--himmel-l); border-radius: 12px; padding: 14px 16px; font-size: 15px; color: var(--ink); }
.info svg { width: 22px; height: 22px; flex: none; color: var(--blau); }
.form-acts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Admin ---------- */
.adm { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.adm-side { background: var(--blau); color: #DCE5F2; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.adm-side img { height: 30px; width: auto; margin: 0 8px 6px; }
.adm-side .role { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--himmel); margin: 0 8px 22px; font-weight: 700; }
.adm-side a { color: #DCE5F2; text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }
.adm-side a[aria-current="page"] { background: var(--blau-m); color: var(--white); }
.adm-side a .n { background: var(--apricot); color: var(--blau-d); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.adm-side .bottom { margin-top: auto; font-size: 13.5px; color: var(--himmel); padding: 0 12px; }
.adm-side .bottom a { display: inline; padding: 0; font-size: inherit; text-decoration: underline; color: inherit; }
.adm-main { padding: 32px 40px 64px; background: var(--paper); min-width: 0; }
.adm-main h1 { font-size: 30px; font-weight: 800; color: var(--blau); }
.adm-main .crumb { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.adm-main .crumb a { color: var(--blau); font-weight: 600; text-decoration: none; }
.adm-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.tile { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.tile .big { font: 800 34px/1 var(--f-head); color: var(--blau); margin-top: 8px; }
.tile .lbl { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.tile.hot { border-color: var(--apricot); background: #FFF8EF; }
.tile .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #2E9A5F; margin-right: 8px; vertical-align: 2px; }

.box { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.box + .box, .box + .grid-2, .grid-2 + .box { margin-top: 22px; }
.box-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.box-head h2 { font-size: 19px; color: var(--blau); }
.box-body { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-2 .box + .box { margin-top: 0; }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 700; padding: 10px 20px; background: #FBF8F1; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--paper-d); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .sub { display: block; font-size: 13.5px; color: var(--ink-2); }
.tbl a.lnk { color: var(--blau); font-weight: 600; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .acts { text-align: right; white-space: nowrap; }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--blau); color: var(--white); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 15px; }
.kv dt { color: var(--ink-2); font-weight: 600; }
.kv dd { margin: 0; }
.quote-box { background: var(--paper); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--ink); border-left: 3px solid var(--himmel); }

.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: td; }
.todo li { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start; padding: 16px 20px; border-bottom: 1px solid var(--paper-d); counter-increment: td; }
.todo li:last-child { border-bottom: 0; }
.todo li::before { content: counter(td); width: 30px; height: 30px; border-radius: 50%; background: var(--himmel-l); color: var(--blau); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.todo li.done::before { content: "✓"; background: var(--blau); color: var(--white); }
.todo b { display: block; color: var(--ink); }
.todo .d { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.todo code, .code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; background: var(--paper); border: 1px solid var(--paper-d); border-radius: 6px; padding: 1px 6px; }
.code-block { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.55; background: var(--blau-d); color: #DCE5F2; border-radius: 12px; padding: 16px 18px; overflow-x: auto; white-space: pre; margin-top: 12px; }
.code-block .c { color: var(--himmel); }
.done-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; background: #F1F7F3; border-top: 1px solid #CFE6D8; flex-wrap: wrap; }
.done-bar .chk { font-size: 14.5px; color: #1F6B45; font-weight: 600; }
.btn-danger { border-color: #C0473B; color: #9B2C22; background: transparent; }

.plan-edit .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.switch input { width: 18px; height: 18px; accent-color: var(--blau); }
.feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; margin-top: 6px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1020px) {
  .layout-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .box + .box { margin-top: 22px; }
  .adm { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .adm-side { flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; padding: 12px 16px; gap: 4px; }
  .adm-side img { margin: 0 12px 0 0; }
  .adm-side .role { display: none; }
  .adm-side .bottom { margin: 6px 0 0; width: 100%; font-size: 12.5px; }
  .adm-side .bottom .ver { display: none; }
  .adm-side a { padding: 8px 10px; font-size: 14px; gap: 6px; }
}
@media (max-width: 720px) {
  .me .nm { display: none; }
  .page { padding-top: 28px; }
  .page-head h1 { font-size: 28px; }
  .ev { grid-template-columns: 1fr; padding: 18px; }
  .ev .acts { grid-row: auto; grid-column: auto; flex-direction: row; flex-wrap: wrap; margin-top: 8px; }
  .track { grid-template-columns: repeat(4, 1fr); font-size: 12px; }
  .track li { font-size: 12px; }
  .panel { padding: 20px 16px; }
  .adm-main { padding: 22px 16px 48px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile .big { font-size: 28px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .todo li { grid-template-columns: 30px 1fr; }
  .todo li > .btn { grid-column: 2; justify-self: start; }
  .plan-edit .row3, .feat { grid-template-columns: 1fr; }
  .tbl th, .tbl td { padding: 10px 12px; }
}

/* ---------- Portal 0.1.0: Meldungen, Dialoge, Hilfsklassen ---------- */
[hidden] { display: none !important; }
.msg { border-radius: 12px; padding: 12px 16px; font-size: 15px; margin: 0 0 18px; border: 1.5px solid; }
.msg-err { background: #F6DEDC; border-color: #E2A59F; color: #7E2017; }
.msg-ok { background: #DDF0E5; border-color: #9FCDB2; color: #17533A; }
.msg-info { background: var(--himmel-l); border-color: var(--himmel); color: var(--ink); }
.msg-wait { background: var(--apricot-l); border-color: var(--apricot); color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--blau-d); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 15px; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: #9B2C22; }
dialog.dlg { border: none; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--white); color: var(--ink); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
dialog.dlg::backdrop { background: rgba(13,33,64,.55); }
.dlg-in { padding: 24px; display: grid; gap: 14px; }
.dlg-in h2 { font: 800 22px/1.2 var(--f-head); color: var(--blau); margin: 0; }
.dlg-in p { margin: 0; color: var(--ink-2); }
.empty { color: var(--ink-2); padding: 18px 0; }
.form.contact-form { max-width: none; }
.cf-row { border-top: 1.5px solid var(--line); padding: 16px 0 6px; }
.cf-row .row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 640px) { .cf-row .row { grid-template-columns: 1fr; } }
.contact-form { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px 28px; margin-top: 22px; }
.legal-event { background: var(--apricot-l); border: 1.5px solid var(--apricot); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; }
.legal-event p { margin: 0 0 6px; }
.legal-event .legal-event-ctrl { white-space: pre-wrap; font-weight: 600; }
.legal-text { white-space: pre-wrap; font-size: 16px; line-height: 1.65; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px; }
.legal-page { max-width: 820px; margin: 0 auto; padding: 32px 16px 72px; }
.legal-page h1 { font: 800 34px/1.15 var(--f-head); color: var(--blau); margin: 18px 0 20px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; width: max-content; border: 1.5px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; word-break: break-all; }
.err-text { color: #9B2C22; font-weight: 600; font-size: 14px; min-height: 1.2em; }
.sub-input input.bad { border-color: #C0473B; }
.hint .no { color: #9B2C22; font-weight: 600; }
.tbl td .sub { display: block; font-size: 13px; color: var(--ink-2); }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.small { font-size: 14px; color: var(--ink-2); }
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--blau-d); }
.adm-login .panel { width: min(440px, 100%); }
.adm-login picture { display: block; }
.adm-login .logo { height: 40px; width: auto; margin-bottom: 18px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { font: 600 15px var(--f-body); border: 1.5px solid var(--line); background: var(--white); color: var(--ink-2); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--himmel-l); color: var(--blau); border-color: var(--himmel); }
.field input[type=checkbox] { width: auto; }
.chk-line { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.chk-line input { width: 18px; height: 18px; accent-color: var(--blau); }
.legal-edit textarea { min-height: 360px; font: 400 14px/1.55 ui-monospace, Consolas, monospace; }
.todo li.done b { text-decoration: line-through; text-decoration-color: var(--ink-2); }
.track li.now { font-weight: 700; }
.burger { display: none; }
@media (max-width: 900px) {
  .layout-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 12px; }
  .app-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .me .nm { display: none; }
  .legal-text { padding: 18px; }
  .contact-form { padding: 18px; }
}

/* ---------- Dunkelmodus (Kundenkonto, Anmeldung, Admin) ---------- */
@media (prefers-color-scheme: dark) {
  body.app {
    color-scheme: dark;
    --paper: #0E1522; --paper-d: #1A2436; --white: #152033; --ink: #E7ECF4; --ink-2: #A9B5C7; --line: #2B3A52;
    --blau: #A9C6EE; --blau-d: #0A1220; --himmel-l: #1C3150; --apricot-l: #3A2A17; --apricot-d: #F2B57A; --rasen: #1A2436;
  }
  body.app .btn-dark { color: #0E1522; }
  body.app .btn-primary { color: #0D2140; }
  body.app .me .ini { color: #0E1522; }
  body.app .pill-ok { background: #173B2A; color: #9FDDBA; }
  body.app .pill-bad, body.app .msg-err { background: #3B1A1D; color: #FFB4AE; border-color: #6E2C2C; }
  body.app .msg-ok { background: #173B2A; color: #9FDDBA; border-color: #2C6B4A; }
  body.app .ok { color: #9FDDBA; }
  body.app .err-text, body.app .hint .no { color: #FFB4AE; }
  body.app .app-top .brand img, body.app .adm-login .logo { filter: none; }
  body.app .qr { background: #fff; }
  body.app .toast { background: #2B3A52; }
  body.app .adm-side { background: #0A1220; border-right: 1px solid var(--line); }
  body.app .adm-side a[aria-current="page"] { background: #1C3150; color: #E7ECF4; }
  body.app .tile.hot { background: var(--apricot-l); }
  body.app .tbl th { background: var(--paper-d); }
  body.app .ev.wait { background: var(--white); }
  body.app .done-bar { background: #15281F; border-top-color: #2C6B4A; }
}
.panel-h { font: 700 20px/1.2 var(--f-head); color: var(--blau); margin: 0 0 14px; }

/* ---------- 0.1.8: Anmelden / Registrieren / Passwort – linke Seite neu, immer dunkel und gut lesbar ---------- */
.auth-side { background: linear-gradient(165deg, #1D4072 0%, #16325C 42%, #0D2140 100%); color: #FFFDF9; isolation: isolate; }
.auth-side.grid-paper-dark { background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(165deg, #1D4072 0%, #16325C 42%, #0D2140 100%); background-size: 28px 28px, 28px 28px, auto; }
.auth-side::after { content: ""; position: absolute; z-index: -1; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 96px, rgba(242,166,90,.22) 97px 100px, transparent 101px 150px, rgba(127,168,220,.16) 151px 154px, transparent 155px 204px, rgba(255,253,249,.08) 205px 208px, transparent 209px); }
.auth-side h2 { color: #FFFDF9; line-height: 1.12; letter-spacing: -.01em; }
.auth-side h2 em { color: #F7BC80; }
.auth-side .ticks { color: #F1F5FB; font-size: 17px; display: grid; gap: 4px; }
.auth-side .ticks li { padding-top: 6px; padding-bottom: 6px; }
.auth-side .ticks li::before { background-color: rgba(242,166,90,.18); box-shadow: inset 0 0 0 1.5px rgba(242,166,90,.55); }
.auth-side .quote { color: #E3EAF5; background: rgba(255,253,249,.06); border-left: 3px solid #F2A65A; border-radius: 0 10px 10px 0; padding: 14px 18px; line-height: 1.5; }
.auth-side a:focus-visible { outline: 3px solid #F2A65A; outline-offset: 4px; border-radius: 6px; }
@media (prefers-color-scheme: dark) {
  body.app .auth-side { color: #FFFDF9; }
  body.app .auth-side .ticks li::before { background-color: rgba(242,166,90,.18); }
}

/* ---------- 0.1.8: Seite „Gleich wieder da“ (Server nicht erreichbar) ---------- */
.wartung { text-align: center; display: grid; justify-items: center; gap: 6px; padding-top: 12vh; }
.wartung-ring { width: 150px; height: 150px; margin: 34px 0 8px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.wartung-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--himmel-l); border-top-color: var(--apricot); animation: wr-spin 1.6s linear infinite; }
.wartung-ring img, .wartung-ring .pz { width: 92px; height: 92px; }
/* 0.1.9: Lade-Animation B „Platzwechsel“ statt drehendem Ring */
.wartung-ring.platzwechsel::before { display: none; }
.wartung-status { color: var(--ink-2); font-size: 15px; min-height: 1.5em; }
@keyframes wr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wartung-ring::before { animation: none; } }
