
:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  color: #172b4d;
  background: #f5f8fc;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* BlueSpider Brand Colors */
  --primary: #2588da;
  --primary-dark: #1463a3;
  --primary-light: #eaf3fb;

  --primary-text: #14558a;
  --primary-dot: #2584c7;

  /* UI Colors */
  --text: #172b4d;
  --muted: #69788d;
  --border: #dce5ef;
  --surface: #ffffff;

  /* Feedback Colors */
  --star-active: #f5ad35;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: min(100% - 32px, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 11px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name {
  color: #193b58;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -1px;
}

.brand-subtitle {
  color: #75869b;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.8px;
}

.feedback-card {
  width: 100%;
  padding: 38px;
  background: var(--surface);
  border: 1px solid #e7edf4;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgb(30 57 84 / 7%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--primary-text);
  background: var(--primary-light);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  background: var(--primary-dot);
  border-radius: 50%;
}

h1 {
  margin: 23px 0 12px;
  color: var(--text);
  font-size: clamp(27px, 5vw, 35px);
  line-height: 1.2;
  letter-spacing: -1.2px;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

#feedback-form {
  margin-top: 32px;
}

.rating-field {
  min-width: 0;
  margin: 0 0 30px;
  padding: 0;
  border: 0;
}

.rating-field legend,
.field label {
  margin-bottom: 15px;
  color: #263a53;
  font-size: 14px;
  font-weight: 700;
}

.stars {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 3px 0 8px;
}

.star {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  padding: 7px;
  color: #d5dee9;
  background: #f8fafc;
  border: 1px solid #e6edf4;
  border-radius: 12px;
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.star svg {
  width: 30px;
  height: 30px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.star.is-active {
  color: var(--star-active);
  background: #fff8e9;
  border-color: #f5dba7;
}

.star.is-active svg {
  fill: currentColor;
}

.star:hover {
  transform: translateY(-2px);
  border-color: var(--star-active);
}

.star:focus-visible,
.submit-button:focus-visible {
  outline: 3px solid #8bd5d9;
  outline-offset: 3px;
}

.rating-hint {
  min-height: 21px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  margin-bottom: 23px;
}

.field label {
  display: block;
}

.optional {
  margin-left: 4px;
  color: #8a98aa;
  font-size: 12px;
  font-weight: 400;
}

textarea {
  display: block;
  width: 100%;
  min-height: 130px;
  padding: 15px;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  resize: vertical;
  font-size: 14px;
  line-height: 1.7;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

textarea::placeholder {
  color: #9aa8b8;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(8 127 140 / 10%);
}

.field-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: #8a98aa;
  font-size: 11px;
  line-height: 1.6;
}

#character-count {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.6;
}

.message.error {
  color: #a52828;
  background: #fff0f0;
  border: 1px solid #f7cccc;
}

.message.success {
  color: #176b46;
  background: #edfaf3;
  border: 1px solid #c6ecd7;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 15px 20px;
  color: white;
  background: var(--primary);
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.submit-button:hover {
  background: var(--primary-dark);
}

.submit-button:active {
  transform: scale(0.99);
}

.submit-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.submit-button svg {
  width: 19px;
  height: 19px;
}

.privacy-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: #8290a2;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.privacy-note svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--primary-dark);
}

.footer {
  margin-top: auto;
  padding: 30px 0 0;
  color: #7d8b9d;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.footer p {
  margin: 0;
}

.footer strong {
  color: #50637a;
}

.footer-note {
  margin-top: 5px !important;
  color: #97a3b2;
}

/* Ensure hidden elements stay hidden */
[hidden] {
  display: none !important;
}

/* Token validation / status container */
.status-container {
  text-align: center;
  padding: 32px 12px;
}

.status-container h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.status-container p {
  line-height: 1.7;
  color: #64748b;
}

/* Retry button */
.status-container .submit-button {
  margin-top: 24px;
  cursor: pointer;
}

@media (max-width: 520px) {
  .page {
    width: min(100% - 24px, 620px);
    padding-top: 23px;
  }

  .brand {
    margin-bottom: 23px;
  }

  .feedback-card {
    padding: 25px 20px;
    border-radius: 16px;
  }

  h1 {
    margin-top: 20px;
    font-size: 28px;
  }

  .intro {
    font-size: 14px;
  }

  #feedback-form {
    margin-top: 27px;
  }

  .stars {
    justify-content: space-between;
    gap: 7px;
  }

  .star {
    width: min(17vw, 49px);
    height: min(17vw, 49px);
    padding: 5px;
  }

  .star svg {
    width: 100%;
    height: 100%;
  }

  .field-footer {
    font-size: 10px;
  }

  .footer {
    padding-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
