/* Terminbuchungs-Popup — Tag-Reiter/Uhrzeit-Chips-Design (identisch zum
   Onboarding-Flow-Buchungsschritt in am-crm), hier als eigenstaendiges
   Vanilla-JS-Popup direkt auf airmastery.de. Kartenrahmen/Kicker/Trustbox/
   Feld- und Button-Optik bewusst 1:1 an videotraining-popup.css angeglichen
   (Owner-Wunsch: "alle Formulare vom Style wie das Videotraining-Formular") —
   eigene Klassennamen (tp- statt vt-) und ein eigenes @property, damit beide
   Popup-Skripte gleichzeitig auf derselben Seite laufen können. */
#tp-popup-root { position: fixed; inset: 0; z-index: 999997; display: none; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
#tp-popup-root.open { display: block; }
#tp-popup-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 15, 0.7); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); opacity: 0; transition: opacity 0.25s ease; }
#tp-popup-root.open #tp-popup-backdrop { opacity: 1; }
#tp-popup-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; pointer-events: none; }

@property --tp-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
#tp-popup-card {
  --tp-border-angle: 0deg;
  pointer-events: auto;
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 2px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(rgba(80, 146, 255, 0.04) 1px, transparent 1px) padding-box,
    linear-gradient(90deg, rgba(80, 146, 255, 0.04) 1px, transparent 1px) padding-box,
    linear-gradient(160deg, rgba(17, 18, 22, 0.97) 0%, rgba(7, 8, 10, 0.99) 100%) padding-box,
    conic-gradient(from var(--tp-border-angle),
      rgba(80, 146, 255, 0) 0deg,
      rgba(80, 146, 255, 0) 250deg,
      rgba(80, 146, 255, 0.9) 300deg,
      rgba(155, 196, 255, 1) 330deg,
      rgba(80, 146, 255, 0.9) 350deg,
      rgba(80, 146, 255, 0) 360deg) border-box;
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 80px -10px rgba(0, 0, 0, 0.7),
    0 0 70px -12px rgba(80, 146, 255, 0.35);
  padding: 28px 26px 22px;
  color: #F0F4FF;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  animation: tpBorderRotate 7s linear infinite;
}
#tp-popup-root.open #tp-popup-card { transform: translateY(0) scale(1); opacity: 1; }
@keyframes tpBorderRotate { to { --tp-border-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { #tp-popup-card { animation: none; } }

.tp-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: none; background: rgba(255, 255, 255, 0.04); color: #8B97B8; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; font-size: 0; }
.tp-close:hover { background: rgba(255, 255, 255, 0.08); color: #F0F4FF; }
.tp-close svg { width: 16px; height: 16px; }

.tp-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #6aa5ff; margin: 0 0 8px; }
.tp-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.2; margin: 0 0 6px; color: #F0F4FF; }
.tp-sub { font-size: 13.5px; color: #B8C2D9; line-height: 1.55; margin: 0 0 16px; }

.tp-trustbox { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid rgba(80, 146, 255, 0.18); border-radius: 12px; background: rgba(80, 146, 255, 0.06); }
.tp-trustbox-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #B8C2D9; }
.tp-trustbox-item svg { width: 14px; height: 14px; flex: none; color: #6aa5ff; }

.tp-field { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.tp-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8B97B8; padding-left: 2px; }
.tp-input-wrap { position: relative; display: flex; align-items: center; margin: 0 3px; }
.tp-input-icon { position: absolute; left: 10px; width: 15px; height: 15px; color: #5f7aa8; pointer-events: none; }
.tp-input { width: 100%; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px 10px 32px; font-size: 12.5px; font-family: inherit; color: #F0F4FF; outline: none; transition: border-color .15s, background .15s; }
.tp-input::placeholder { color: #5a6478; }
.tp-input:focus { border-color: rgba(80,146,255,.5); background: rgba(255,255,255,.05); box-shadow: 0 0 0 3px rgba(80,146,255,.15); }
.tp-err-field { color: #ff8a8a; font-size: 11px; margin: 3px 0 0 2px; }

.tp-days { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0 10px; padding-bottom: 2px; }
.tp-day { flex: none; padding: 8px 12px; border-radius: 9px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.05); color: #B8C2D9; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.tp-day.on { background: linear-gradient(180deg, #5092ff 0%, #306FD5 100%); color: #fff; }
.tp-day:hover:not(.on) { border-color: rgba(80,146,255,.4); }
.tp-times-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8B97B8; margin: 0 0 8px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; min-height: 20px; }
.tp-chip { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: #DCE3F5; cursor: pointer; }
.tp-chip.on { background: linear-gradient(180deg, #5092ff 0%, #306FD5 100%); border-color: transparent; color: #fff; }
.tp-chip:hover:not(.on) { border-color: rgba(80,146,255,.5); }
.tp-hint { font-size: 12.5px; color: #6b7590; }

.tp-legal { margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: #6b7590; text-align: center; }
.tp-err { color: #ff8a8a; font-size: 12.5px; margin: 10px 0 0; }
.tp-submit {
  width: 100%;
  background: linear-gradient(180deg, #5092ff 0%, #306FD5 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 20px rgba(48,111,213,0.4);
  font-family: inherit;
}
.tp-submit:hover:not(:disabled) { transform: translateY(-1px); background: linear-gradient(180deg, #5B93E8 0%, #4080e5 100%); box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 9px 26px rgba(48,111,213,0.5); }
.tp-submit:disabled { opacity: .65; cursor: wait; }
.tp-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: tpspin .7s linear infinite; display: none; }
.tp-submit.busy .tp-spinner { display: inline-block; }
@keyframes tpspin { to { transform: rotate(360deg); } }

.tp-confirmed { text-align: center; padding: 20px 0; }
.tp-confirmed-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: rgba(34, 197, 94, 0.15); border: 2px solid rgba(34, 197, 94, 0.5); display: flex; align-items: center; justify-content: center; }
.tp-confirmed-icon svg { width: 26px; height: 26px; color: #4ade80; }
.tp-confirmed-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.tp-confirmed-text { font-size: 13px; color: #B8C2D9; line-height: 1.55; }

.tp-honey { position: absolute !important; left: -10000px !important; top: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 640px) {
  #tp-popup-card { max-width: none; width: calc(100% - 12px); padding: 22px 18px 24px; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; }
  .tp-title { font-size: 19px; }
  .tp-sub { font-size: 13px; margin-bottom: 18px; }
  .tp-input { padding: 10px 12px 10px 32px; font-size: 16px; }
  .tp-submit { padding: 13px 16px; font-size: 15px; }
  .tp-close { top: 14px; right: 14px; }
}

body.tp-popup-open { overflow: hidden; }
