/* Reha Domus – Therapeutenpool-Anmeldung und Assistent. Farben aus dem Relaunch (--rl-*), mit Ersatzwerten. */
#rd-tp-app, .rdtp-chat {
  --p: var(--rl-petrol, #102C32); --c: var(--rl-coral-d, #F26D51); --ct: var(--rl-coral-text, #A63B24);
  --iv: var(--rl-ivory, #F6F5F1); --ln: var(--rl-line, #E3E1D9); --sl: var(--rl-slate, #52666A);
  --sg: var(--rl-sage, #D7E3DB); --rs: var(--rl-rose, #FFE6DF);
  font-family: var(--rl-body, system-ui, -apple-system, 'Segoe UI', sans-serif); color: var(--p);
}
#rd-tp-app { scroll-margin-top: 90px; }
#rd-tp-app *, .rdtp-chat * { box-sizing: border-box; }
#rd-tp-app h3 { font-family: var(--rl-head, inherit); font-size: 1.35rem; line-height: 1.25; margin: 0 0 .7em; outline: none; }
#rd-tp-app p { margin: 0 0 .9em; }
.rdtp-karte { background: #fff; border: 1px solid var(--ln); border-radius: var(--rl-r, 22px); padding: clamp(18px, 4vw, 34px); }

/* Fortschritt */
.rdtp-fort { display: flex; gap: 6px; margin: 0 0 14px; counter-reset: s; }
.rdtp-fort span { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--sl); padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.6); min-width: 0; }
.rdtp-fort b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ln); color: var(--p); font-size: .8rem; }
.rdtp-fort b svg { width: 15px; height: 15px; }
.rdtp-fort .jetzt { background: #fff; color: var(--p); font-weight: 700; box-shadow: 0 0 0 1px var(--ln); }
.rdtp-fort .jetzt b { background: var(--c); color: #fff; }
.rdtp-fort .fertig b { background: var(--sg); }
@media (max-width: 640px) { .rdtp-fort span:not(.jetzt) { flex: none; font-size: 0; gap: 0; padding: 8px; } }

/* Fachbereich */
.rdtp-fach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 760px) { .rdtp-fach { grid-template-columns: 1fr; } }
.rdtp-fach button { text-align: left; font: inherit; color: inherit; background: var(--iv); border: 1.5px solid var(--ln); border-radius: 16px; padding: 18px; cursor: pointer; display: grid; gap: 4px; transition: border-color .15s, transform .15s; }
.rdtp-fach button:hover, .rdtp-fach button:focus-visible { border-color: var(--c); transform: translateY(-2px); outline: none; }
.rdtp-fach svg { width: 30px; height: 30px; color: var(--c); margin-bottom: 6px; }
.rdtp-fach strong { font-size: 1.05rem; }
.rdtp-fach small { color: var(--sl); font-size: .85rem; }

/* Formular */
.rdtp-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .rdtp-raster { grid-template-columns: 1fr; } }
.rdtp-feld { margin-bottom: 14px; min-width: 0; }
.rdtp-feld.breit { grid-column: 1 / -1; }
.rdtp-feld label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.rdtp-feld label span { font-weight: 400; color: var(--sl); }
.rdtp-feld input:not([type=file]) { width: 100%; font: inherit; font-size: 16px; color: inherit; padding: 12px 14px; border: 1.5px solid var(--ln); border-radius: 12px; background: #fff; }
.rdtp-feld input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px rgba(16,44,50,.12); }
.rdtp-feld input[disabled] { background: var(--iv); color: var(--sl); }
.rdtp-datei { background: var(--iv); border: 1.5px dashed var(--ln); border-radius: 14px; padding: 14px; }
.rdtp-datei input { font: inherit; max-width: 100%; }
.rdtp-code input { max-width: 220px; font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; }
[aria-invalid="true"] { border-color: var(--ct) !important; }
.rdtp-fehl { color: var(--ct); font-size: .85rem; margin: 5px 0 0 !important; }
.rdtp-meldung { background: var(--rs); color: var(--ct); padding: 10px 14px; border-radius: 12px; font-weight: 600; outline: none; }
.rdtp-haken { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: .95rem; cursor: pointer; flex-wrap: wrap; }
.rdtp-haken input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--p); }
.rdtp-haken span { flex: 1; min-width: 0; }
.rdtp-haken .rdtp-fehl { flex-basis: 100%; padding-left: 30px; }
.rdtp-klein { font-size: .87rem; color: var(--sl); }
.rdtp-knoepfe { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 18px; }
.rdtp-btn { font: inherit; font-weight: 700; color: #fff; background: var(--p); border: 0; border-radius: 999px; padding: 14px 26px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; }
.rdtp-btn:hover { background: var(--rl-petrol-2, #18393F); }
.rdtp-btn:disabled { opacity: .75; cursor: wait; }
.rdtp-link { font: inherit; color: var(--p); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.rdtp-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rdtp-d .8s linear infinite; }
@keyframes rdtp-d { to { transform: rotate(360deg); } }

/* Vertrag + Unterschrift */
.rdtp-doc { max-height: 70vh; overflow: auto; background: var(--iv); border: 1px solid var(--ln); border-radius: 14px; padding: 10px; display: grid; gap: 10px; margin-bottom: 8px; }
.rdtp-doc img { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(16,44,50,.12); }
.rdtp-sig { position: relative; border: 1.5px dashed var(--sl); border-radius: 14px; background: #fff; }
.rdtp-sig canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; border-radius: 14px; }
.rdtp-sig > span { position: absolute; left: 16px; right: 16px; bottom: 34px; border-top: 1px solid var(--ln); padding-top: 6px; color: var(--sl); font-size: .85rem; pointer-events: none; }
.rdtp-sig.hat > span { color: transparent; }
.rdtp-sig .rdtp-link { position: absolute; top: 10px; right: 14px; font-size: .85rem; }
.rdtp-fertig { text-align: center; }
.rdtp-fertig p { max-width: 560px; margin-left: auto !important; margin-right: auto !important; }
.rdtp-ok { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--sg); display: grid; place-items: center; }
.rdtp-ok svg { width: 34px; height: 34px; }

/* Assistent */
/* Sitzt über dem WhatsApp-Knopf der Website (.wa: rechts 20px, unten 20px, 60px groß) */
.rdtp-chat { position: fixed; right: 20px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 9990; }
.rdtp-chat-auf { font: inherit; font-weight: 700; display: flex; align-items: center; gap: 8px; background: var(--p); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer; box-shadow: 0 8px 24px rgba(16,44,50,.25); }
.rdtp-chat-auf svg { width: 22px; height: 22px; }
.rdtp-chat.offen .rdtp-chat-auf { display: none; }
@media (max-width: 480px) { .rdtp-chat-auf span { display: none; } .rdtp-chat-auf { padding: 14px; } }
.rdtp-chat-p { width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 130px)); height: min(560px, calc(100dvh - 130px)); background: #fff; border-radius: 20px; box-shadow: 0 16px 48px rgba(16,44,50,.28); display: flex; flex-direction: column; overflow: hidden; }
.rdtp-chat-p[hidden] { display: none; }
.rdtp-chat-p header { background: var(--p); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rdtp-chat-p header small { display: block; opacity: .75; font-size: .75rem; margin-top: 2px; }
.rdtp-chat-zu { background: none; border: 0; color: #fff; cursor: pointer; padding: 2px; }
.rdtp-chat-zu svg { width: 22px; height: 22px; }
.rdtp-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--iv); }
.rdtp-m { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: .93rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.rdtp-m.assistant { background: #fff; border: 1px solid var(--ln); border-bottom-left-radius: 4px; align-self: flex-start; }
.rdtp-m.user { background: var(--p); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.rdtp-m.fehler { background: var(--rs); color: var(--ct); }
.rdtp-m.warte { display: flex; gap: 4px; padding: 14px; }
.rdtp-m.warte i { width: 7px; height: 7px; border-radius: 50%; background: var(--sl); animation: rdtp-p 1s infinite ease-in-out; }
.rdtp-m.warte i:nth-child(2) { animation-delay: .15s; } .rdtp-m.warte i:nth-child(3) { animation-delay: .3s; }
@keyframes rdtp-p { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.rdtp-chat-vor { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; background: var(--iv); }
.rdtp-chat-vor:not(:empty) { padding-bottom: 10px; }
.rdtp-chat-vor button { font: inherit; font-size: .82rem; background: #fff; color: var(--p); border: 1px solid var(--ln); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.rdtp-chat-vor button:hover { border-color: var(--c); }
.rdtp-chat-p form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ln); align-items: flex-end; }
.rdtp-chat-p textarea { flex: 1; font: inherit; font-size: 16px; resize: none; border: 1.5px solid var(--ln); border-radius: 14px; padding: 9px 12px; max-height: 120px; color: inherit; }
.rdtp-chat-p textarea:focus { outline: none; border-color: var(--p); }
.rdtp-chat-p form button { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--c); color: #fff; display: grid; place-items: center; cursor: pointer; }
.rdtp-chat-p form button svg { width: 20px; height: 20px; }
.rdtp-unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { #rd-tp-app *, .rdtp-chat * { animation: none !important; transition: none !important; } }

/* Ausweichweg unter dem Formular */
.rdtp-alt { margin-top: 18px; padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--rl-line, #E3E1D9); color: var(--rl-slate, #52666A); font-size: .9rem; font-family: var(--rl-body, system-ui, sans-serif); }
.rdtp-alt p { margin: 0; }
.rdtp-alt strong { color: var(--rl-petrol, #102C32); }
.rdtp-alt a { color: var(--rl-petrol, #102C32); }

/* Einstieg "Online bewerben" (Testseite / Seitenbereich) */
.rdtp-gold { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; margin-bottom: 26px; }
@media (max-width: 860px) { .rdtp-gold { grid-template-columns: 1fr; gap: 16px; } }
.rdtp-gold .rdtp-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--rl-rose, #FFE6DF); color: var(--rl-coral-text, #A63B24); font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; }
.rdtp-gold h2 { margin: 0 0 12px; }
.rdtp-gold ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rdtp-gold li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--rl-line, #E3E1D9); border-radius: 14px; padding: 12px 14px; }
.rdtp-gold li b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--rl-coral-d, #F26D51); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.rdtp-gold li span { font-size: .95rem; }
.rdtp-gold li strong { display: block; color: var(--rl-petrol, #102C32); }

/* Bisheriges Formular (zugeklappt unter dem neuen Weg) */
details.rdtp-klassisch { border: 1px solid var(--rl-line, #E3E1D9); border-radius: 16px; background: #fff; padding: 0 18px; }
details.rdtp-klassisch > summary { cursor: pointer; padding: 16px 0; font-weight: 700; color: var(--rl-petrol, #102C32); list-style-position: inside; }
details.rdtp-klassisch[open] > summary { border-bottom: 1px solid var(--rl-line, #E3E1D9); margin-bottom: 14px; }
details.rdtp-klassisch > p { color: var(--rl-slate, #52666A); font-size: .92rem; }
