*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f6f9f8;
  --surface: rgba(15, 32, 40, 0.045);
  --border: rgba(15, 32, 40, 0.12);
  --accent: #37bba3;
  --accent-hover: #2a9e8a;
  --text: #0f2028;
  --muted: rgba(15, 32, 40, 0.58);
  --button-text: #ffffff;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(246, 249, 248, 0) 0%, rgba(15, 32, 40, 0.035) 100%),
    var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
}

.wrap {
  width: min(430px, 100%);
}

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

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 999px;
  padding: 7px 15px;
  margin-bottom: 16px;
  background: #17130f;
  color: var(--button-text);
  font-size: 12px;
  font-weight: 800;
}

.logo-badge span {
  color: var(--button-text);
  font-size: 14px;
}

.logo-badge img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}

h1,
.step-title,
.coupon-code {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(31px, 8vw, 42px);
  line-height: 1.04;
}

h1 em,
.step-label,
.coupon-code {
  color: var(--accent);
}

.header p,
.step-sub {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.progress-wrap {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.progress-step {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  transform-origin: center;
  transition: background-color 0.24s ease, transform 0.24s ease, opacity 0.24s ease;
}

.progress-step.active {
  background: var(--accent);
  transform: scaleY(1.65);
}

.progress-step.done { background: color-mix(in srgb, var(--accent) 45%, transparent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 22px 60px rgba(23, 19, 15, 0.08);
  animation: cardIn 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.step { display: none; }
.step.active {
  display: block;
  animation: fadeUp 0.28s ease both;
}

.step-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.step-title {
  font-size: 25px;
  margin-bottom: 8px;
}

.input-label {
  display: block;
  margin: 16px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.input-group {
  margin-bottom: 12px;
}

.input-field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.input-field:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.consent-box {
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin: 18px 0 6px;
  padding: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.consent-box:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  box-shadow: 0 10px 24px rgba(23, 19, 15, 0.06);
  transform: translateY(-1px);
}

.consent-box input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin-top: 2px;
}

.consent-box span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.consent-copy,
.consent-box label {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.consent-copy {
  display: block;
}

.consent-copy label {
  display: inline;
  cursor: pointer;
}

.consent-box.needs-attention {
  border-color: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
  animation: consentShake 0.24s ease both;
}

.terms-link {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terms-link:hover {
  color: var(--accent-hover);
}

.consent-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-help.error {
  color: #b42318;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.terms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 32, 40, 0.42);
  backdrop-filter: blur(5px);
}

.terms-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: min(680px, 88vh);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 18px;
  background: #f6f9f8;
  box-shadow: 0 28px 90px rgba(15, 32, 40, 0.24);
  padding: 22px;
  outline: none;
  animation: termsIn 0.24s ease both;
}

.terms-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.terms-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.terms-head h2 {
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  line-height: 1.12;
  margin-top: 4px;
}

.terms-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.terms-content {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.terms-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.review-box {
  resize: vertical;
  min-height: 96px;
}

.triage-box {
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
  margin-top: 16px;
}

.triage-box strong,
.triage-box p {
  display: block;
}

.triage-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 5px;
}

.private-feedback {
  background: color-mix(in srgb, var(--accent) 8%, #ffffff);
}

[hidden] {
  display: none !important;
}

.friend-box {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0 8px;
}

.friend-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}

.star {
  border: 0;
  background: transparent;
  color: rgba(23, 19, 15, 0.2);
  font-size: 38px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.star.active {
  color: var(--accent);
  animation: starPop 0.2s ease both;
}

.star:hover {
  color: var(--accent);
  filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--accent) 22%, transparent));
  transform: translateY(-2px) scale(1.08);
}

.btn,
.google-btn {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  margin-top: 18px;
  background: var(--accent);
  color: var(--button-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 20%, transparent);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.google-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 28%, transparent);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.google-btn {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
}

.success-screen {
  text-align: center;
}

.success-brand {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  margin: 0 auto 10px;
  background: var(--accent);
  color: var(--button-text);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 28px;
  font-weight: 900;
  animation: successPop 0.44s cubic-bezier(0.2, 0.85, 0.2, 1.2) both;
}

.success-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.success-establishment {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.success-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--button-text);
  font-size: 32px;
  font-weight: 900;
  animation: successPop 0.46s cubic-bezier(0.2, 0.85, 0.2, 1.2) 0.08s both;
}

.coupon-box {
  margin-top: 18px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 14px;
  padding: 18px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  animation: couponReveal 0.36s ease 0.12s both;
}

.coupon-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.coupon-code {
  font-size: 30px;
  font-weight: 900;
  margin-top: 6px;
}

.referral-box {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  text-align: left;
}

.referral-box strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
}

.referral-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.coupon-valid,
.success-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.coupon-valid {
  margin-top: 6px;
  font-size: 12px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}

.footer img {
  width: 86px;
  height: 36px;
  display: block;
}

@media (max-width: 520px) {
  .referral-grid {
    grid-template-columns: 1fr;
  }
}

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

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes starPop {
  0% { transform: scale(0.94); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes successPop {
  from { opacity: 0; transform: translateY(8px) scale(0.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes consentShake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

@keyframes termsIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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