@import url("./brand/fonts.css");

:root {
  --color-ink: #111111;
  --color-brand-blue: #3D86AA;
  --color-brand-red: #C92035;
  --color-page: #F1F1F1;
  --color-surface: #FFFFFF;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--color-ink);
  background: var(--color-page);
  font-family: "Montserrat", Arial, sans-serif;
  line-height: 1.5;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-page);
}

body::after {
  position: fixed;
  right: -54px;
  bottom: -58px;
  z-index: 0;
  width: 210px;
  height: 210px;
  background: url("./brand/pattern.svg") center / contain no-repeat;
  content: "";
  opacity: 0.12;
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: safe center;
  padding: 24px 0;
}

.feedback-card {
  width: min(calc(100% - 32px), 480px);
  min-height: 560px;
  padding: 24px;
  overflow-wrap: anywhere;
  background: var(--color-surface);
  border: 1px solid var(--color-page);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgb(17 17 17 / 12%);
}

.brand-header {
  margin-bottom: 32px;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 4px auto 28px;
}

.clinic-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-family: "Days Sans", "Montserrat", Arial, sans-serif;
  font-size: 1.75rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
  line-height: 1.35;
}

.rating-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-fieldset legend {
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  font-size: 1rem;
  font-weight: 500;
}

.rating-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  justify-items: center;
  margin: 0 -1px 20px;
}

.rating-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.rating-star {
  display: grid;
  width: 48px;
  height: 48px;
  color: var(--color-surface);
  font-size: 2.4rem;
  line-height: 1;
  -webkit-text-stroke: 2px var(--color-brand-blue);
  cursor: pointer;
  place-items: center;
  transition: color 180ms ease, transform 180ms ease;
  user-select: none;
}

.rating-star.is-selected {
  color: var(--color-brand-blue);
}

.rating-star:hover {
  transform: translateY(-2px);
}

.rating-input:focus-visible + .rating-star {
  border-radius: 8px;
  outline: 3px solid var(--color-brand-blue);
  outline-offset: 1px;
}

.action-panel,
.low-rating-panel,
.thanks-panel,
.error-panel {
  animation: reveal 180ms ease both;
}

.low-rating-panel p,
.thanks-panel p,
.error-panel p,
.neutral-card p {
  font-size: 1rem;
}

.comment-label {
  display: block;
  margin: 20px 0 8px;
  font-weight: 600;
}

.comment-label span {
  font-weight: 400;
}

.text-input,
textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 2px solid var(--color-page);
  border-radius: 10px;
  font: inherit;
}

.text-input {
  min-height: 50px;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.text-input:focus-visible,
textarea:focus-visible,
.primary-button:focus-visible,
a:focus-visible,
.thanks-panel h1:focus-visible,
.error-panel h2:focus-visible {
  outline: 3px solid var(--color-brand-blue);
  outline-offset: 3px;
}

.comment-meta {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin: 8px 0 18px;
  font-size: 0.75rem;
}

.comment-meta p {
  flex: 1;
  margin: 0;
  font-size: inherit;
}

.comment-meta output {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.primary-button {
  display: inline-grid;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  color: var(--color-surface);
  background: var(--color-brand-red);
  border: 2px solid var(--color-brand-red);
  border-radius: 10px;
  font: 600 1rem/1.35 "Montserrat", Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  place-items: center;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.thanks-panel,
.error-panel {
  padding-top: 56px;
  text-align: center;
}

.status-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  color: var(--color-surface);
  background: var(--color-brand-blue);
  border-radius: 50%;
  font-size: 2rem;
  place-items: center;
}

.link-button {
  margin-top: 12px;
}

.neutral-card {
  min-height: 0;
  text-align: center;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

@keyframes reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 480px) {
  .feedback-card {
    padding: 32px;
  }

  h1 {
    font-size: 2rem;
  }

  .rating-group {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
