/* Avatar Suisse App – gemeinsame Gestaltung (Kunden-App und Praxis-App) */
@font-face { font-family: Montserrat; font-weight: 300; font-display: swap; src: url(fonts/montserrat-300.woff) format('woff'); }
@font-face { font-family: Montserrat; font-weight: 400; font-display: swap; src: url(fonts/montserrat-regular.woff) format('woff'); }
@font-face { font-family: Montserrat; font-weight: 500; font-display: swap; src: url(fonts/montserrat-500.woff) format('woff'); }
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url(fonts/montserrat-600.woff) format('woff'); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(fonts/montserrat-700.woff) format('woff'); }

:root {
  --navy: #0B1826;
  --ink: #193755;
  --teal: #38B3C9;
  --text: #193755;
  --text-2: #5B6E80;
  --text-3: #8496A6;
  --line: #E1E8EE;
  --line-2: #CBD6DF;
  --flaeche: #F3F6F9;
  --karte: #FFFFFF;
  --gut: #38B3C9;
  --beobachten: #F2A93B;
  --auffaellig: #DC3C3D;
  --info: #A0B4C0;
  --radius: 18px;
  --radius-s: 12px;
  --schatten: 0 1px 2px rgba(11, 24, 38, .05), 0 8px 24px rgba(11, 24, 38, .06);
  --schatten-h: 0 2px 4px rgba(11, 24, 38, .06), 0 16px 40px rgba(11, 24, 38, .10);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Montserrat, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--flaeche);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
/* Umbrüche: Überschriften ausgewogen, Fliesstext ohne einzelnes Wort in der letzten Zeile */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, figcaption, blockquote, small, dd { text-wrap: pretty; }
sup.reg { font-size: .42em; line-height: 0; position: relative; top: -.95em; }

/* ---------- Bausteine ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .65em 1.25em; border-radius: 999px;
  border: 1.5px solid transparent; background: var(--ink); color: #fff; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { background: #22486e; }
.btn:active { transform: scale(.98); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal); box-shadow: 0 6px 18px rgba(56, 179, 201, .35); }
.btn.leer { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.leer:hover { background: #fff; border-color: var(--ink); }
.btn.hell { background: #fff; color: var(--ink); }
.btn.klein { min-height: 36px; padding: .4em .95em; font-size: .86rem; }
.btn.gefahr { background: transparent; color: var(--auffaellig); border-color: rgba(220, 60, 61, .35); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(25, 55, 85, .07); }
.icon-btn svg { width: 22px; height: 22px; }

.feld { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; align-content: start; min-width: 0; }
.feld > span { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.feld small { color: var(--text-3); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .85rem; border-radius: var(--radius-s); border: 1.5px solid var(--line-2); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 1rem; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(56, 179, 201, .16); }
.fehlertext { color: var(--auffaellig); font-size: .9rem; font-weight: 500; min-height: 1.2em; }

.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); }
.label { font-size: .92rem; font-weight: 600; color: var(--text-2); }
.weich { -webkit-hyphens: manual; hyphens: manual; overflow-wrap: break-word; }
.punkte { display: flex; flex-wrap: wrap; margin-left: -1.05em; clip-path: inset(0 0 0 1.05em); }
.punkte > span { position: relative; padding-left: 1.05em; min-width: 0; }
.punkte > span::before { content: '·'; position: absolute; left: .38em; }
.funke { position: relative; }
.funke-punkt { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2.5px #fff; }

/* Status: Farbe immer mit Form und Wort */
.status { display: inline-flex; align-items: center; gap: .4em; font-size: .82rem; font-weight: 600; padding: .28em .75em .28em .45em; border-radius: 999px;
  background: rgba(160, 180, 192, .16); color: var(--text-2); white-space: nowrap; }
.status svg { width: 1.1em; height: 1.1em; flex: none; }
.status.gut { background: rgba(56, 179, 201, .13); color: var(--ink); }
.status.gut svg, .app-status.aktiv svg, .chip.da svg { color: var(--teal); }
.status.beobachten { background: rgba(242, 169, 59, .16); color: #9a5f06; }
.status.auffaellig { background: rgba(220, 60, 61, .11); color: #b42b2c; }
.status.dunkel.gut { background: rgba(56, 179, 201, .2); color: #fff; }
.status.dunkel.gut svg { color: var(--teal); }
.status.dunkel.beobachten { background: rgba(242, 169, 59, .2); color: #f7c97f; }
.status.dunkel.auffaellig { background: rgba(220, 60, 61, .22); color: #f29b9b; }
.status.dunkel.info { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--info); }
.punkt.gut { background: var(--gut); } .punkt.beobachten { background: var(--beobachten); } .punkt.auffaellig { background: var(--auffaellig); }

/* Skala (Wert im Referenzbereich) */
.skala { position: relative; height: 34px; margin-top: .35rem; }
.skala .spur { position: absolute; left: 0; right: 0; top: 13px; height: 8px; border-radius: 4px; background: #E9EEF2; overflow: hidden; }
.skala .grenz { position: absolute; top: 0; bottom: 0; background: rgba(242, 169, 59, .28); }
.skala .zone { position: absolute; top: 0; bottom: 0; background: var(--teal); }
.skala .marke { position: absolute; top: 9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(11, 24, 38, .3); background: var(--ink); transition: left .8s var(--ease); }
.skala .marke.vorher { background: #fff; border: 2.5px solid var(--text-3); box-shadow: none; width: 12px; height: 12px; margin-left: -6px; top: 11px; }
.skala .zahlen { position: absolute; left: 0; right: 0; top: 24px; font-size: .72rem; color: var(--text-3); }
.skala .zahlen span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* Diagramme */
.diagramm { position: relative; width: 100%; }
.diagramm svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagramm .achse { font-size: 11px; fill: var(--text-3); font-family: Montserrat, sans-serif; }
.diagramm .gitter { stroke: #E9EEF2; stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: .8rem; line-height: 1.35; padding: .45rem .65rem; border-radius: 10px;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: 0 6px 18px rgba(11, 24, 38, .25); z-index: 5; }
.tip b { font-weight: 600; }

/* 3D-Betrachter */
.viewer { position: relative; border-radius: var(--radius); overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #1b3550 0%, #0B1826 70%); touch-action: none; }
.viewer canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer .hinweis { position: absolute; left: 14px; bottom: 12px; font-size: .76rem; color: rgba(255, 255, 255, .55); pointer-events: none; }
.viewer .titel { position: absolute; left: 14px; top: 12px; font-size: .82rem; font-weight: 600; color: rgba(255, 255, 255, .85); }
.viewer .werkzeuge { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.viewer .werkzeuge button { height: 32px; padding: 0 .75rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(11, 24, 38, .5);
  color: #fff; font-size: .76rem; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewer .werkzeuge button:hover { border-color: var(--teal); }
.viewer .laden { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .7); font-size: .9rem; }

/* Einblenden */
@keyframes rein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rein { animation: rein .5s var(--ease) both; }
.rein-1 { animation-delay: .05s; } .rein-2 { animation-delay: .1s; } .rein-3 { animation-delay: .15s; } .rein-4 { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { .rein { animation: none; } .skala .marke { transition: none; } }

/* Meldung unten */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: .8rem 1.2rem; border-radius: 14px;
  font-size: .92rem; font-weight: 500; opacity: 0; transition: opacity .25s, transform .25s var(--ease); z-index: 200; box-shadow: 0 12px 30px rgba(11, 24, 38, .3); max-width: calc(100vw - 32px); }
.toast.zeigen { opacity: 1; transform: translate(-50%, 0); }

/* Anmelden (beide Apps) */
.tor { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background: radial-gradient(90% 46% at 70% 28%, #1d3b5a 0%, var(--navy) 60%); color: #fff; }
.tor canvas.kopf { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.tor .tor-karte { position: relative; width: min(440px, 100%); background: rgba(11, 24, 38, .62); border: 1px solid rgba(255, 255, 255, .1); border-radius: 26px;
  padding: 34px 30px 28px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.tor img.logo { height: 40px; display: block; margin-bottom: 26px; }
.tor h1 { font-size: 1.6rem; font-weight: 300; margin-bottom: .4rem; }
.tor h1 b { font-weight: 600; }
.tor p.unter { color: rgba(255, 255, 255, .65); margin-bottom: 1.4rem; font-size: .96rem; }
.tor form { display: grid; gap: 14px; }
.tor .feld > span { color: rgba(255, 255, 255, .7); }
.tor .feld small { color: rgba(255, 255, 255, .55); }
.tor input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #fff; }
.tor input:focus { border-color: var(--teal); background: rgba(255, 255, 255, .09); }
.tor .btn { width: 100%; margin-top: 4px; }
.tor .wechsel { margin-top: 18px; text-align: center; font-size: .9rem; color: rgba(255, 255, 255, .6); }
.tor .wechsel button { background: none; border: 0; color: var(--teal); font-weight: 600; cursor: pointer; padding: 6px; }
.tor .fehlertext { color: #f29b9b; }
.tor-passkey { display: grid; gap: 10px; margin-bottom: 14px; }
.tor .btn.leer { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.tor-passkey .btn svg { width: 22px; height: 22px; }
.tor-passkey .fehlertext:empty { display: none; }
.tor .oder { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: rgba(255, 255, 255, .5); font-size: .84rem; }
.tor .oder::before, .tor .oder::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .14); }


/* Hinweis in der öffentlichen Vorführung */
.tor .demo-hinweis { margin: 12px 0 18px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .78); font-size: .86rem; line-height: 1.5; }
.tor .demo-hinweis b { color: #fff; font-weight: 600; }
