.patient-feedback-prompt {
  font-family: inherit;
}

.patient-feedback-prompt,
.patient-feedback-prompt * {
  box-sizing: border-box;
}

.patient-feedback-prompt__launcher {
  position: fixed;
  right: 0;
  bottom: 88px;
  z-index: 9998;
}

.patient-feedback-prompt__tab {
  display: inline-flex;
  min-width: 152px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  background: var(--primary-brand-color, #5c70ff);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgb(15 23 42 / 18%);
  transition: box-shadow 160ms ease, filter 160ms ease, transform 160ms ease;
}

.patient-feedback-prompt__tab svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.patient-feedback-prompt__tab:hover {
  filter: brightness(0.94);
  transform: translateX(-3px);
}

.patient-feedback-prompt__dismiss {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 4px 12px rgb(15 23 42 / 16%);
  transform: translate(-50%, -50%);
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.patient-feedback-prompt__dismiss svg {
  width: 14px;
  height: 14px;
}

.patient-feedback-prompt__dismiss:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translate(-50%, -50%) scale(1.06);
}

.patient-feedback-prompt__backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: rgb(15 23 42 / 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

.patient-feedback-prompt__backdrop[hidden],
[data-patient-feedback-panel][hidden] {
  display: none !important;
}

.patient-feedback-prompt__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.patient-feedback-prompt__dialog {
  position: relative;
  width: 100%;
  max-width: 512px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  background: #fff;
  color: #0f172a;
  font-size: 16px;
  box-shadow: 0 24px 64px rgb(15 23 42 / 28%);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.patient-feedback-prompt__backdrop.is-open .patient-feedback-prompt__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.patient-feedback-prompt__header {
  position: relative;
  padding: 24px 56px 24px 20px;
  background: var(--primary-brand-color, #5c70ff);
  color: #fff;
}

.patient-feedback-prompt__header-icon {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgb(255 255 255 / 15%);
}

.patient-feedback-prompt__header-icon svg {
  width: 19px;
  height: 19px;
}

.patient-feedback-prompt__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.patient-feedback-prompt__close:hover {
  background: rgb(255 255 255 / 20%);
  transform: rotate(6deg);
}

.patient-feedback-prompt__close svg {
  width: 19px;
  height: 19px;
}

.patient-feedback-prompt__title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.patient-feedback-prompt__description {
  max-width: 42ch;
  margin: 0;
  color: rgb(255 255 255 / 82%);
  font-size: 14px;
  line-height: 1.5;
}

.patient-feedback-prompt__body {
  padding: 20px;
}

.patient-feedback-prompt__methods {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.patient-feedback-prompt__methods legend,
.patient-feedback-prompt [data-patient-feedback-form] label {
  display: block;
  margin: 0 0 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.patient-feedback-prompt__methods > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.patient-feedback-prompt__methods label {
  min-width: 0;
  cursor: pointer;
}

.patient-feedback-prompt__methods input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.patient-feedback-prompt__method-card {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.patient-feedback-prompt__method-card svg {
  width: 19px;
  height: 19px;
}

.patient-feedback-prompt__methods input:checked + .patient-feedback-prompt__method-card {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.patient-feedback-prompt__methods input:focus-visible + .patient-feedback-prompt__method-card,
.patient-feedback-prompt button:focus-visible,
.patient-feedback-prompt a:focus-visible,
.patient-feedback-prompt textarea:focus-visible,
.patient-feedback-prompt input:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.patient-feedback-prompt__survey-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
}

.patient-feedback-prompt__survey-note > svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 2px;
  color: #1d4ed8;
}

.patient-feedback-prompt__survey-note strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.patient-feedback-prompt__survey-note p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 20px;
}

.patient-feedback-prompt__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.patient-feedback-prompt__primary-action,
.patient-feedback-prompt__secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.patient-feedback-prompt__primary-action {
  gap: 8px;
  border: 1px solid var(--primary-brand-color, #5c70ff);
  background: var(--primary-brand-color, #5c70ff);
  color: #fff;
}

.patient-feedback-prompt__primary-action:hover {
  color: #fff;
  filter: brightness(0.94);
}

.patient-feedback-prompt__primary-action svg {
  width: 19px;
  height: 19px;
}

.patient-feedback-prompt__secondary-action {
  order: 2;
  border: 0;
  background: #f1f5f9;
  color: #475569;
}

.patient-feedback-prompt__secondary-action:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.patient-feedback-prompt [data-patient-feedback-form] > div + div {
  margin-top: 16px;
}

.patient-feedback-prompt [data-patient-feedback-form] label span {
  margin-left: 4px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.patient-feedback-prompt [data-patient-feedback-form] textarea,
.patient-feedback-prompt [data-patient-feedback-form] input[type="email"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
  line-height: 20px;
}

.patient-feedback-prompt [data-patient-feedback-form] textarea {
  min-height: 122px;
  padding-block: 12px;
  resize: vertical;
}

.patient-feedback-prompt [data-patient-feedback-form] textarea + p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 20px;
}

.patient-feedback-prompt [data-patient-feedback-form] textarea:focus,
.patient-feedback-prompt [data-patient-feedback-form] input[type="email"]:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 4px #dbeafe;
}

.patient-feedback-prompt__primary-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.patient-feedback-prompt__status {
  min-height: 20px;
  margin-top: 12px;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

.patient-feedback-prompt__status.is-success {
  color: #15803d;
}

body.patient-feedback-prompt-open {
  overflow: hidden;
}

@media (min-width: 640px) {
  .patient-feedback-prompt__launcher {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .patient-feedback-prompt__tab {
    min-width: 48px;
    min-height: 144px;
    padding: 20px 12px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .patient-feedback-prompt__tab:hover {
    transform: translateX(-3px) rotate(180deg);
  }

  .patient-feedback-prompt__tab svg {
    transform: rotate(180deg);
  }

  .patient-feedback-prompt__backdrop {
    align-items: center;
    padding: 20px;
  }

  .patient-feedback-prompt__dialog {
    max-height: calc(100vh - 40px);
  }

  .patient-feedback-prompt__header {
    padding: 28px 64px 28px 28px;
  }

  .patient-feedback-prompt__body {
    padding: 28px;
  }
}

@media (min-width: 391px) {
  .patient-feedback-prompt__methods > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .patient-feedback-prompt__actions {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.6fr);
  }

  .patient-feedback-prompt__secondary-action {
    order: initial;
  }
}

@media (prefers-reduced-motion: reduce) {
  .patient-feedback-prompt__tab,
  .patient-feedback-prompt__dismiss,
  .patient-feedback-prompt__backdrop,
  .patient-feedback-prompt__dialog,
  .patient-feedback-prompt__close {
    transition: none;
  }
}
