/* ============================================================
   Can You Hear Me — Referral Form Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --page-bg:    #F0F0F8;
  --lavender:   #F3F0FB;
  --lavender-mid: #E6E5F4;
  --white:      #FFFFFF;
  --ink:        #343f52;
  --muted:      #60697b;
  --pink:       #FF94BB;
  --pink-light: #FFF0F6;
  --pink-deep:  #F07090;
  --indigo:     #5B4FE8;
  --indigo-hover: #4a3fd4;
  --track:      #E6E5F4;
  --radius-pill: 100px;
  --radius-card: 16px;
  --shadow-card: 0 4px 24px rgba(91,79,232,.10), 0 1px 4px rgba(91,79,232,.06);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--page-bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 40px;
}

/* --- Shell ------------------------------------------------- */
.form-shell {
  width: 100%;
  max-width: 520px;
}

/* --- Progress bar ----------------------------------------- */
.progress-bar {
  height: 4px;
  background: var(--track);
  border-radius: 2px;
  margin-bottom: 28px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--pink);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* --- Card -------------------------------------------------- */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px 40px 36px;
}

/* --- Screens ----------------------------------------------- */
.screen { display: none; }
.screen.active { display: block; }

/* --- Eyebrow / badge -------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pink-deep);
  background: var(--pink-light);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  margin-bottom: 16px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* --- Typography ------------------------------------------- */
.welcome-org {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.screen-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 8px;
}
.screen-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 28px;
}

/* --- Welcome meta ----------------------------------------- */
.welcome-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 28px;
}

/* --- Fields ----------------------------------------------- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.field {
  position: relative;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  transition: color .2s;
}

.field:focus-within label {
  color: var(--pink-deep);
}

.field input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid var(--lavender-mid);
  padding: 8px 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
  appearance: none;
}

.field input:focus {
  border-color: var(--pink);
}

.field input::placeholder {
  color: #c4cad4;
  font-weight: 400;
}

/* phone field */
.phone-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.phone-prefix-select {
  flex-shrink: 0;
  min-width: 102px;
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid var(--lavender-mid);
  border-radius: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
  padding: 8px 22px 8px 0;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.phone-prefix-select:focus {
  outline: none;
  border-bottom-color: var(--pink);
  color: var(--ink);
}
.phone-wrap input {
  flex: 1;
}

/* inline validation */
.field-error {
  font-size: 12px;
  color: #e53e3e;
  margin-top: 4px;
  display: none;
}
.field.invalid .field-error { display: block; }
.field.invalid input { border-color: #e53e3e; }

/* --- Consent cards ---------------------------------------- */
.consent-copy {
  background: var(--pink-light);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.consent-copy p + p { margin-top: 10px; }

.consent-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  border: none;
  padding: 0;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--lavender-mid);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  user-select: none;
}
.choice-card:hover {
  border-color: var(--pink);
  background: var(--pink-light);
}
.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card.selected {
  border-color: var(--pink);
  background: var(--pink-light);
}
.choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--lavender-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.choice-card.selected .choice-letter {
  background: var(--pink);
  color: #fff;
}
.choice-label { font-size: 15px; font-weight: 500; }

/* --- Buttons ---------------------------------------------- */
.btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--indigo);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 28px;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-primary:hover  { background: var(--indigo-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-arrow {
  display: inline-block;
  transform: translateX(0);
  transition: transform .2s ease;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--lavender-mid);
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  flex-shrink: 0;
}
.btn-back:hover { border-color: var(--pink); color: var(--pink-deep); }

/* --- Thank-you / Error ------------------------------------ */
.outcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 20px;
}
.outcome-icon.success { background: #e6faf0; }
.outcome-icon.error   { background: #fff0f0; }

.outcome-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}
.outcome-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
  max-width: 360px;
  margin: 0 auto 24px;
}
.outcome-body a { color: var(--indigo); text-decoration: none; }
.outcome-body a:hover { text-decoration: underline; }

.screen-thankyou .card,
.screen-error .card {
  text-align: center;
  padding: 52px 40px;
}

/* spinner inside button */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive ------------------------------------------- */
@media (max-width: 480px) {
  body { padding: 16px 12px 32px; }
  .card { padding: 28px 20px 24px; }
  .screen-title { font-size: 22px; }
  .btn-primary { font-size: 14px; padding: 12px 22px; }
  .screen-thankyou .card,
  .screen-error .card { padding: 36px 20px; }
}

/* Embedded iframe: tighter padding, no min-height, transparent bg so Framer page shows through */
body.embedded {
  padding: 20px 16px 28px;
  min-height: unset;
  background: transparent;
}
body.embedded .card {
  box-shadow: 0 2px 16px rgba(91,79,232,.08), 0 1px 3px rgba(91,79,232,.05);
}
body.embedded .btn-back[id="btnBackToWelcome"] {
  display: none; /* no going back to welcome when it's skipped */
}

@media (max-height: 700px) {
  body { min-height: unset; }
}
