/* Vertical "Request an appointment" tab — top-right, below header */
.appt-float {
  position: fixed;
  top: 96px;
  right: 0;
  z-index: 998;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.appt-float__inner {
  position: relative;
  display: block;
  animation: appt-float-nudge 3s ease-in-out infinite;
}

.appt-float__ripples {
  position: absolute;
  inset: -6px 0 -6px -8px;
  pointer-events: none;
}

.appt-float__ripple {
  position: absolute;
  inset: 0;
  border-radius: 12px 0 0 12px;
  border: 2px solid rgba(30, 64, 175, 0.4);
  animation: appt-float-ripple 2.4s ease-out infinite;
}

.appt-float__ripple:nth-child(2) { animation-delay: 0.8s; }
.appt-float__ripple:nth-child(3) { animation-delay: 1.6s; }

.appt-float__btn {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px 16px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  font-family: Manrope, Inter, system-ui, sans-serif;
  box-shadow: -4px 6px 24px rgba(37, 99, 235, 0.38);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: appt-float-pulse 2.2s ease-in-out infinite;
}

.appt-float__icon {
  flex-shrink: 0;
}

.appt-float__label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.appt-float__badge {
  position: absolute;
  top: 6px;
  left: 4px;
  z-index: 3;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-family: Manrope, Inter, system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.45);
  animation: appt-badge-bounce 2s ease-in-out infinite;
}

.appt-float:hover .appt-float__btn,
.appt-float:focus-visible .appt-float__btn {
  transform: translateX(-4px);
  box-shadow: -8px 8px 28px rgba(37, 99, 235, 0.52);
}

.appt-float:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 12px 0 0 12px;
}

/* Modal */
.appt-modal {
  position: fixed;
  inset: 0;
  z-index: 20010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.appt-modal[hidden] { display: none; }

.appt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.appt-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  animation: appt-modal-in 0.28s ease;
}

.appt-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.appt-modal__close:hover { background: #e2e8f0; }

.appt-modal__title {
  margin: 0 0 0.35rem;
  font-family: Manrope, Inter, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}

.appt-modal__subtitle {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
  text-align: center;
}

.appt-modal__form { display: grid; gap: 0.9rem; }

.appt-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.appt-modal__field--full {
  grid-column: 1 / -1;
}

.appt-modal__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.appt-modal__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.appt-modal__field label span { color: #dc2626; }

.appt-modal__field input,
.appt-modal__field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.appt-modal__field input:focus,
.appt-modal__field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.appt-modal__field textarea { resize: vertical; min-height: 96px; }

.appt-modal__field.is-invalid input,
.appt-modal__field.is-invalid textarea {
  border-color: #dc2626;
}

.appt-modal__error {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #dc2626;
}

.appt-modal__form-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.86rem;
}

.appt-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.8rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  font-family: Manrope, Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.appt-modal__submit:hover:not(:disabled) { transform: translateY(-1px); }
.appt-modal__submit:disabled { opacity: 0.7; cursor: not-allowed; }

.appt-modal__submit-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: appt-spin 0.7s linear infinite;
}

@keyframes appt-float-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

@keyframes appt-float-pulse {
  0%, 100% { box-shadow: -4px 6px 24px rgba(37, 99, 235, 0.38); }
  50% { box-shadow: -6px 8px 30px rgba(37, 99, 235, 0.55); }
}

@keyframes appt-float-ripple {
  0% { transform: scale(1); opacity: 0.45; }
  100% { transform: scale(1.15); opacity: 0; }
}

@keyframes appt-badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes appt-modal-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes appt-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .appt-float {
    top: 78px;
  }

  .appt-float__label {
    font-size: 0.72rem;
  }

  .appt-float__btn {
    padding: 12px 8px 14px;
    gap: 8px;
  }

  .appt-modal__row {
    grid-template-columns: 1fr;
  }

  .appt-modal__dialog {
    padding: 1.5rem 1.15rem 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .appt-float__inner,
  .appt-float__btn,
  .appt-float__ripple,
  .appt-float__badge,
  .appt-modal__dialog,
  .appt-modal__submit-spinner {
    animation: none !important;
  }
}
