/* ============================================================================
  videosprechstunde · Secure Waiting Room
  Standalone stylesheet – no dependencies,
  All classes are scoped under .warteraum to avoid conflicts.
   ========================================================================== */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/atkinsonhyperlegible-regular-webfont.woff2') format('woff2'),
  url('/fonts/atkinsonhyperlegible-regular-webfont.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/atkinsonhyperlegible-italic-webfont.woff2') format('woff2'),
  url('/fonts/atkinsonhyperlegible-italic-webfont.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/atkinsonhyperlegible-bold-webfont.woff2') format('woff2'),
  url('/fonts/atkinsonhyperlegible-bold-webfont.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/fonts/atkinsonhyperlegible-bolditalic-webfont.woff2') format('woff2'),
  url('/fonts/atkinsonhyperlegible-bolditalic-webfont.woff') format('woff');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --wr-blue:        #2368B4;
  --wr-blue-dark:   #1B5396;
  --wr-blue-soft:   #A9C4E2;
  --wr-navy:        #1F3A52;
  --wr-ink:         #1C2A36;
  --wr-muted:       #5E6E7B;
  --wr-faint:       #8A98A4;
  --wr-line:        #DEE3E9;
  --wr-line-soft:   #EDEFF2;
  --wr-green:       #2E9E5B;
  --wr-red:         #CF5B57;
  --wr-stage:       #0F2230;
}

/* ---- Overlay / Background -------------------------------------------------*/
.warteraum {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  background: linear-gradient(155deg, #EEF4FA 0%, #DFE9F4 55%, #D5E1F0 100%);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  color: var(--wr-ink);
}
.warteraum *,
.warteraum *::before,
.warteraum *::after { box-sizing: border-box; }

.warteraum-hidden { display: none !important; }

/* ---- Window ---------------------------------------------------------------*/
.warteraum-window {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1140px;
  height: 100%;
  max-height: 750px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(20, 45, 75, .24);
}

/* ---- Stage (camera preview) -----------------------------------------------*/
.warteraum-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--wr-stage);
  overflow: hidden;
}
.warteraum-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);/* Mirror view, as in video conferences */
}
.warteraum-stage.wr-no-video .warteraum-video { display: none; }

.warteraum-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #CDD9E3;
}
.warteraum-stage.wr-no-video .warteraum-placeholder { display: flex; }
.warteraum-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: #214055;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: #EAF2F8;
}
.warteraum-placeholder-text { font-size: 15px; opacity: .8; }

.warteraum-stage-logo {
  position: absolute; top: 16px; left: 18px;
  height: 30px; width: auto; opacity: .95;
  pointer-events: none; z-index: 2;
}
.warteraum-badge {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(15, 34, 48, .66);
  color: #fff;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 15px; font-weight: 700;
  backdrop-filter: blur(6px);
  max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Control bar above the video------------------------------------------*/
.warteraum-controls {
  position: absolute; left: 0; right: 0; bottom: 18px;
  display: flex; justify-content: center; gap: 16px;
}
.warteraum-ctrl {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 60px; height: 60px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-family: inherit; cursor: pointer;
  backdrop-filter: blur(6px);
}
.warteraum-ctrl:hover { background: rgba(255, 255, 255, .26); }
.warteraum-ctrl.wr-off { background: var(--wr-red); }
.warteraum-ctrl.wr-off:hover { background: #c14f4b; }
.warteraum-ctrl-label { font-size: 12px; font-weight: 700; margin-top: 3px; }
.warteraum-ctrl .wr-ico-off { display: none; }
.warteraum-ctrl.wr-off .wr-ico-on  { display: none; }
.warteraum-ctrl.wr-off .wr-ico-off { display: block; }

/* ---- Panel -----------------------------------------------------------------*/
.warteraum-panel {
  width: 384px; flex: none;
  background: #fff;
  padding: 26px 28px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.warteraum-panel-logo { height: 48px; width: auto; align-self: flex-start; margin-bottom: 2px; }


.warteraum-h1 {
  font-size: 23px; line-height: 1.25; font-weight: 700;
  color: var(--wr-navy); margin: 14px 0 6px;
}
.warteraum-lead { font-size: 15px; color: var(--wr-muted); margin: 0 0 18px; line-height: 1.45; }

.warteraum-form { display: flex; flex-direction: column; flex: 1; }

.warteraum-label { font-size: 14px; font-weight: 700; color: var(--wr-navy); margin-bottom: 7px; }
.warteraum-sublabel { font-size: 13px; font-weight: 700; color: var(--wr-muted); display: block; margin-bottom: 6px; }

.warteraum-input {
  height: 54px;
  border: 1.5px solid var(--wr-line);
  border-radius: 12px;
  padding: 0 16px;
  font-size: 18px; font-family: inherit; color: var(--wr-ink);
  outline: none; width: 100%;
}
.warteraum-input:focus {
  border-color: var(--wr-blue);
  box-shadow: 0 0 0 3px rgba(35, 104, 180, .15);
}

.warteraum-divider { height: 1px; background: var(--wr-line-soft); margin: 22px 0 18px; }

.warteraum-devices { display: flex; flex-direction: column; gap: 16px; }
.warteraum-row-inline { display: flex; gap: 10px; }

.warteraum-select {
  flex: 1; min-width: 0; width: 100%;
  height: 46px;
  border: 1.5px solid var(--wr-line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px; font-family: inherit; color: var(--wr-ink);
  background: #fff; outline: none;
}
.warteraum-select:focus { border-color: var(--wr-blue); }

.warteraum-meter-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.warteraum-meter-label { font-size: 12px; color: var(--wr-faint); flex: none; }
.warteraum-meter { flex: 1; height: 9px; background: #E6EBF0; border-radius: 6px; overflow: hidden; }
.warteraum-meter-fill {
  height: 100%; width: 4%;
  background: var(--wr-green); border-radius: 6px;
  transition: width .07s linear;
}

.warteraum-test {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 46px; padding: 0 16px;
  border: 1.5px solid var(--wr-line);
  background: #fff; color: var(--wr-navy);
  border-radius: 10px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.warteraum-test.wr-testing { border-color: var(--wr-blue); background: #E9F1FB; color: var(--wr-blue); }

.warteraum-spacer { flex: 1; min-height: 18px; }

.warteraum-enter {
  width: 100%; height: 56px;
  border: none; border-radius: 12px;
  background: var(--wr-blue); color: #fff;
  font-size: 19px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(35, 104, 180, .28);
}
.warteraum-enter:hover:not(:disabled) { background: var(--wr-blue-dark); }
.warteraum-enter:disabled {
  background: var(--wr-blue-soft); box-shadow: none; cursor: not-allowed;
}

.warteraum-footnote {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--wr-faint); font-size: 13px; margin-top: 14px;
}

/* ---- Waiting state ----------------------------------------------------------*/
.warteraum-waiting {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  flex: 1; padding: 10px 4px;
}
.warteraum-spinner { position: relative; width: 74px; height: 74px; margin-bottom: 22px; }
.warteraum-spinner-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(35, 104, 180, .35);
  animation: warteraum-pulse 2s ease-out infinite;
}
.warteraum-spinner-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid #DCE6F2; border-top-color: var(--wr-blue);
  animation: warteraum-spin 1.1s linear infinite;
}
.warteraum-spinner-initials {
  position: absolute; inset: 14px; border-radius: 50%;
  background: var(--wr-blue);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.warteraum-waiting-title { font-size: 22px; font-weight: 700; color: var(--wr-navy); margin: 0 0 6px; }
.warteraum-waiting-text { font-size: 16px; color: var(--wr-muted); margin: 0; line-height: 1.5; }
.warteraum-dot { animation: warteraum-blink 1.4s infinite; }
.warteraum-dot:nth-child(2) { animation-delay: .2s; }
.warteraum-dot:nth-child(3) { animation-delay: .4s; }

.warteraum-link {
  margin-top: 26px;
  background: none; border: none;
  color: var(--wr-blue); font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* ---- Error state ---------------------------------------------------------*/
.warteraum-state-error {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  flex: 1; padding: 20px 4px;
}
.warteraum-error-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: #FCEEED; color: var(--wr-red);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.warteraum-error-text { font-size: 16px; color: var(--wr-red); margin: 0; line-height: 1.5; }

/* ---- "Too early" / Appointment not yet open ----------------------------------*/
.warteraum-sched-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(20, 45, 75, .16);
  padding: 32px;
  margin: auto;
}
.warteraum-sched-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.warteraum-sched-logo img { height: 50px; width: auto; }
.warteraum-sched-title { font-size: 24px; font-weight: 700; color: var(--wr-navy); text-align: center; margin: 0 0 4px; }
.warteraum-sched-lead { font-size: 15px; color: var(--wr-muted); text-align: center; margin: 0 0 22px; line-height: 1.45; }

.warteraum-date-card {
  background: var(--wr-blue);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  color: #fff;
}
.warteraum-date-left, .warteraum-date-right { flex: 1; }
.warteraum-date-divider { width: 1px; background: rgba(255, 255, 255, .25); margin: 0 22px; }
.warteraum-date-day { font-size: 46px; font-weight: 700; line-height: 1; }
.warteraum-date-month { font-size: 16px; font-weight: 700; margin-top: 6px; }
.warteraum-date-weekday { font-size: 14px; opacity: .85; }
.warteraum-date-caption { font-size: 12px; letter-spacing: .1em; opacity: .8; font-weight: 700; }
.warteraum-date-time { font-size: 30px; font-weight: 700; margin-top: 4px; }
.warteraum-date-duration { font-size: 14px; opacity: .85; margin-top: 6px; }

.warteraum-countdown {
  margin-top: 16px;
  display: flex; align-items: center; gap: 14px;
  background: #E9F1FB; border-radius: 12px; padding: 14px 18px;
}
.warteraum-countdown-label { font-size: 13px; font-weight: 700; color: var(--wr-muted); }
.warteraum-countdown-value {
  font-size: 25px; font-weight: 700; color: var(--wr-navy);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.warteraum-sched-note { font-size: 14px; color: var(--wr-muted); line-height: 1.5; margin: 18px 0 0; text-align: center; }
.warteraum-sched-note strong { color: var(--wr-navy); }

@media (max-width: 767px) {
  .warteraum-sched-card { border-radius: 16px; padding: 24px 20px 26px; }
  /* In "Too Early" mode, the bright brand background remains (no full-screen video) */
  .warteraum.wr-sched-mode {
    background: linear-gradient(155deg, #EEF4FA 0%, #DFE9F4 55%, #D5E1F0 100%);
    padding: 18px;
  }
}

@keyframes warteraum-blink { 0%,80%,100% { opacity: .25 } 40% { opacity: 1 } }
@keyframes warteraum-pulse { 0% { transform: scale(.7); opacity: .6 } 70% { transform: scale(2.1); opacity: 0 } 100% { opacity: 0 } }
@keyframes warteraum-spin  { to { transform: rotate(360deg) } }

/* ---- Mobile (full screen) ------------------------------------------------------*/
@media (max-width: 767px) {
  .warteraum { padding: 0; background: var(--wr-stage); }
  .warteraum-window {
    max-width: none; max-height: none;
    border-radius: 0; box-shadow: none;
    flex-direction: column;
  }
  .warteraum-stage { flex: none; height: 244px; }
  .warteraum-panel { width: 100%; flex: 1; padding: 20px 18px 22px; }
  .warteraum-avatar { width: 80px; height: 80px; font-size: 28px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .warteraum-spinner-pulse,
  .warteraum-spinner-ring,
  .warteraum-dot { animation: none; }
}
