/* ==========================================================================
 * S62 (2026-05-01) — Termin-Anfrage CTA + Modal-Form.
 *
 * Loaded on Untersuchungs-/Labor-/Diagnostik-/Sonographie-/Check-Up-/Bridge-
 * pages (siehe functions.php enqueue-condition).
 *
 * Visual idea (B2):
 *  - One prominent red mail-CTA ".pxz-btn-cta-termin" (Corporate-Rot,
 *    larger pill, Pfeil-Icon, leichtes Pulse-Glow on hover/idle).
 *  - Companion ghost buttons (Doctolib + Telefon) sit alongside.
 *  - Modal opens with overlay + dialog + form.
 * ========================================================================== */


/* --- 1. CTA pair container ------------------------------------------------- */

.pxz-termin-cta-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 1.75rem;
}
.pxz-termin-cta-pair.is-align-center { justify-content: center; }
.pxz-termin-cta-pair.is-align-start  { justify-content: flex-start; }


/* --- 2. The prominent red button ----------------------------------------- */

.pxz-btn-cta-termin {
  background: var(--pxz-red) !important;
  color: #fff !important;
  font-size: 1.0625rem !important;
  font-weight: 600 !important;
  padding: 1.05rem 2rem !important;
  min-height: 52px !important;
  border-radius: 9999px;
  border: 0;
  letter-spacing: -0.005em;
  box-shadow: 0 6px 18px -6px rgba(200, 22, 29, 0.45),
              0 2px 6px -2px rgba(200, 22, 29, 0.25);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  position: relative;
  overflow: hidden;
}
.pxz-btn-cta-termin:hover,
.pxz-btn-cta-termin:focus-visible {
  background: var(--pxz-red-dark) !important;
  box-shadow: 0 10px 26px -6px rgba(200, 22, 29, 0.55),
              0 3px 8px -2px rgba(200, 22, 29, 0.32);
  transform: translateY(-1px);
  outline: none;
}
.pxz-btn-cta-termin:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px -4px rgba(200, 22, 29, 0.45);
}
.pxz-btn-cta-termin:focus-visible {
  outline: 3px solid rgba(200, 22, 29, 0.35);
  outline-offset: 3px;
}

/* The tiny arrow nudges right on hover for a subtle "go" affordance. */
.pxz-btn-cta-termin-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-weight: 500;
}
.pxz-btn-cta-termin:hover .pxz-btn-cta-termin-arrow,
.pxz-btn-cta-termin:focus-visible .pxz-btn-cta-termin-arrow {
  transform: translateX(3px);
}

/* Subtle attention-pulse — only when nothing is hovered/focused.
 * Keep it gentle (1.5s cycle, scale 1 → 1.025) so it reads as "alive"
 * not as flashing. Respect prefers-reduced-motion. */
@keyframes pxz-cta-termin-pulse {
  0%, 100% { box-shadow: 0 6px 18px -6px rgba(200, 22, 29, 0.45),
                          0 2px 6px -2px rgba(200, 22, 29, 0.25),
                          0 0 0 0 rgba(200, 22, 29, 0.0); }
  50%      { box-shadow: 0 6px 18px -6px rgba(200, 22, 29, 0.45),
                          0 2px 6px -2px rgba(200, 22, 29, 0.25),
                          0 0 0 8px rgba(200, 22, 29, 0.10); }
}
.pxz-btn-cta-termin {
  animation: pxz-cta-termin-pulse 2.6s ease-in-out infinite;
}
.pxz-btn-cta-termin:hover,
.pxz-btn-cta-termin:focus-visible {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .pxz-btn-cta-termin { animation: none; transition: none; }
  .pxz-btn-cta-termin:hover { transform: none; }
}


/* --- 3. Companion ghost buttons (Doctolib + Phone) ------------------------ */

.pxz-termin-cta-doctolib,
.pxz-termin-cta-phone {
  /* Inherits .pxz-btn-ghost. We just keep them visually quieter than the red. */
  font-size: 0.9375rem !important;
}


/* --- 4. Modal scaffolding ------------------------------------------------- */

.pxz-termin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.pxz-termin-modal[hidden] { display: none; }

.pxz-termin-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 16, 0.55);
  backdrop-filter: saturate(140%) blur(4px);
  -webkit-backdrop-filter: saturate(140%) blur(4px);
}

/* S65d (2026-05-10): Dialog auf Token-Card-Radius (22px), Shadow auf
 * Token-Hi (mit zusätzlichem 30px-Tiefen-Layer für Modal-Floating). */
.pxz-termin-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: var(--pxz-radius-card);
  box-shadow: var(--pxz-shadow-card-hi),
              0 30px 80px -20px rgba(0, 0, 0, 0.30);
  width: min(640px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: pxz-termin-modal-in 0.28s var(--pxz-easing-spring);
}
@keyframes pxz-termin-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pxz-termin-modal-dialog { animation: none; }
}

.pxz-termin-modal-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 36px; height: 36px;
  border-radius: 9999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--pxz-graphite, #424245);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.pxz-termin-modal-close:hover,
.pxz-termin-modal-close:focus-visible {
  background: var(--pxz-chalk, #f5f5f7);
  color: var(--pxz-ink, #1d1d1f);
  outline: none;
}

.pxz-termin-modal-body {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}


/* --- 5. Modal head --------------------------------------------------------- */

.pxz-termin-modal-head {
  margin-bottom: 1.5rem;
}
.pxz-termin-modal-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pxz-red);
  font-weight: 700;
  margin: 0 0 0.5rem;
  min-height: 1em;
}
.pxz-termin-modal-eyebrow:empty { display: none; }
.pxz-termin-modal-title {
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--pxz-ink, #1d1d1f);
  margin: 0 0 0.5rem;
}
.pxz-termin-modal-lead {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--pxz-graphite, #424245);
  margin: 0;
}
.pxz-termin-modal-lead:empty { display: none; }


/* --- 5b. Untersuchungs-Pitch (S75 2026-05-16) ---------------------------- */

.pxz-termin-modal-pitch {
  background: #f1faf4;
  border: 1px solid #cbe9d4;
  border-radius: var(--pxz-radius-input);
  padding: 1rem 1.125rem 1.125rem;
  margin: 0 0 1.5rem;
  color: #234d33;
}
.pxz-termin-modal-pitch[hidden] { display: none; }
.pxz-termin-modal-pitch-headline {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1f3a26;
}
.pxz-termin-modal-pitch-paragraph {
  margin: 0 0 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.pxz-termin-modal-pitch-bullets {
  margin: 0;
  padding: 0 0 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.pxz-termin-modal-pitch-bullets:empty { display: none; }
.pxz-termin-modal-pitch-bullets li { margin: 0.125rem 0; }

.pxz-termin-form-cta-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #234d33;
  text-align: center;
}
.pxz-termin-form-cta-hint[hidden] { display: none; }


/* --- 6. IGeL info block --------------------------------------------------- */

.pxz-termin-modal-igel {
  background: #fff8f1;
  border: 1px solid #f5d6b8;
  border-radius: var(--pxz-radius-input);
  padding: 1rem 1.125rem;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #5a3a18;
}
.pxz-termin-modal-igel p { margin: 0; }
.pxz-termin-modal-igel strong { color: #3d2810; }
.pxz-termin-modal-igel abbr   { text-decoration: underline dotted; cursor: help; }


/* --- 7. Form -------------------------------------------------------------- */

.pxz-termin-form { display: block; }

.pxz-termin-honeypot {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.pxz-termin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem 1rem;
}
@media (max-width: 520px) {
  .pxz-termin-form-grid { grid-template-columns: 1fr; }
}

.pxz-termin-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.pxz-termin-field-wide {
  grid-column: 1 / -1;
}
.pxz-termin-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pxz-ink, #1d1d1f);
}
/* S65d (2026-05-10): Input-Radius auf Token (12px), Transitions auf 0.2s. */
.pxz-termin-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--pxz-line, #d2d2d7);
  border-radius: var(--pxz-radius-input);
  font-size: 0.9375rem;
  background: #fff;
  color: var(--pxz-ink, #1d1d1f);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
select.pxz-termin-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23424245' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}
textarea.pxz-termin-input { resize: vertical; min-height: 88px; }
.pxz-termin-input:focus {
  outline: none;
  border-color: var(--pxz-red);
  box-shadow: 0 0 0 3px rgba(200, 22, 29, 0.16);
}
.pxz-termin-input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--pxz-red, #c8161d);
}
.pxz-termin-hint {
  font-size: 0.75rem;
  color: var(--pxz-graphite, #424245);
  margin-top: 0.125rem;
}

.pxz-termin-check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--pxz-graphite, #424245);
}
.pxz-termin-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 0.125rem;
  accent-color: var(--pxz-red);
}
.pxz-termin-check a { color: var(--pxz-red); text-decoration: underline; }


/* --- 8. Form actions ------------------------------------------------------ */

.pxz-termin-form-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.pxz-termin-submit { animation: none !important; }   /* no pulse inside modal */

.pxz-termin-form-status {
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: var(--pxz-red, #c8161d);
}
.pxz-termin-form-status.is-info { color: var(--pxz-graphite, #424245); }


/* --- 9. Success state ----------------------------------------------------- */

.pxz-termin-modal-success h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--pxz-ink, #1d1d1f);
}
.pxz-termin-modal-success p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--pxz-graphite, #424245);
  margin: 0 0 0.875rem;
}
.pxz-termin-modal-success a {
  color: var(--pxz-red);
  text-decoration: underline;
}


/* --- 10. Submit busy state ------------------------------------------------ */

.pxz-termin-form.is-busy .pxz-termin-input,
.pxz-termin-form.is-busy .pxz-termin-check input {
  pointer-events: none;
  opacity: 0.65;
}
.pxz-termin-form.is-busy .pxz-termin-submit {
  pointer-events: none;
  opacity: 0.75;
}
