/* ============================================================
   Sanveca Care Program — Stylesheet
   Design system: 8px grid, Inter font, teal palette
   ============================================================ */

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

:root {
  /* Teal palette */
  --teal-900: #0d3d38;
  --teal-800: #10524a;
  --teal-700: #136658;
  --teal-600: #167a65;  /* primary */
  --teal-500: #1a8f75;
  --teal-400: #22a887;
  --teal-200: #a8ddd4;
  --teal-100: #d4eeea;
  --teal-50:  #eaf6f4;

  /* Green accent (logo leaf) */
  --green-500: #6abf45;
  --green-300: #a8dd7a;

  /* Neutrals */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* Semantic */
  --bg-page:    #eef5f3;
  --bg-card:    #ffffff;
  --text-main:  var(--gray-900);
  --text-muted: var(--gray-500);
  --border:     var(--gray-200);

  /* Success / Error */
  --success: #16a34a;
  --error:   #dc2626;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout Helpers ---------- */
.container {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-2) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-img { height: 24px; width: auto; display: block; }

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  flex: 1;
  padding: var(--space-6) var(--space-4) var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Screen transitions ---------- */
.screen {
  width: 100%;
  max-width: 640px;
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.screen.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero Text ---------- */
.hero-text {
  text-align: center;
  margin-bottom: var(--space-8);
}

.protect-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--teal-600);
  background: linear-gradient(135deg, rgba(22,122,101,.08), rgba(106,191,69,.08));
  border: 1px solid rgba(22,122,101,.18);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.protect-badge svg { color: var(--teal-600); flex-shrink: 0; }

.hero-text h1 {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal-800), var(--teal-500) 55%, var(--green-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--teal-800);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.hero-sub {
  font-size: 15px;
  color: var(--teal-600);
  line-height: 1.6;
}

.br-desktop { display: block; }

/* ---------- Card ---------- */
.card {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8) var(--space-8);
  border: 1px solid rgba(0,0,0,.04);
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: var(--space-8);
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  min-width: 64px;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-base) var(--ease);
  position: relative;
  z-index: 1;
}

.step.active .step-circle {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(22,122,101,.15);
}

.step.completed .step-circle {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: var(--white);
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: .01em;
  white-space: nowrap;
}

.step.active .step-label,
.step.completed .step-label {
  color: var(--teal-700);
  font-weight: 600;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin-top: 15px; /* align with circle center */
  transition: background var(--dur-slow) var(--ease);
}

.step-line.completed { background: var(--teal-500); }

/* ---------- Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-5);
  margin-bottom: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group.full-width {
  grid-column: 1 / -1;
  margin-bottom: var(--space-6);
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--teal-700);
}

.required { color: var(--teal-600); }

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  outline: none;
  appearance: none;
}

input::placeholder { color: var(--gray-400); }

input:focus,
select:focus {
  border-color: var(--teal-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(22,122,101,.10);
}

input.invalid,
select.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}

input.valid {
  border-color: var(--teal-400);
}

.field-error {
  font-size: 12px;
  color: var(--error);
  min-height: 16px;
  display: block;
}

/* Select wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  padding-right: 36px;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-400);
}

/* ---------- Combobox (searchable city dropdown) ---------- */
.combobox {
  position: relative;
}

.combobox input {
  width: 100%;
  padding-right: 36px;
}

.combobox-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-400);
  transition: transform var(--dur-fast) var(--ease);
}

.combobox.open .combobox-arrow { transform: translateY(-50%) rotate(180deg); }

.combobox-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15,42,38,.12);
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 4px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  pointer-events: none;
}

.combobox-list:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.combobox-option {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: background var(--dur-fast) var(--ease);
}

.combobox-option .opt-city {
  font-weight: 500;
}

.combobox-option .opt-state {
  font-size: 12px;
  color: var(--gray-400);
}

.combobox-option:hover,
.combobox-option.active {
  background: var(--teal-50);
}

.combobox-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--gray-400);
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 15px var(--space-6);
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  box-shadow: 0 4px 14px rgba(22,122,101,.30);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur-fast) var(--ease);
  border-radius: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22,122,101,.38);
}
.btn-primary:hover::before { background: rgba(255,255,255,.08); }

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(22,122,101,.25);
}

.btn-primary:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow, .btn-text { transition: transform var(--dur-fast) var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

/* Loading spinner */
.btn-spinner svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  display: block;
  width: 100%;
  text-align: center;
}

.btn-ghost:hover {
  color: var(--teal-700);
  background: var(--teal-50);
}

/* ---------- Review & Success: reduce top gap (registration unchanged) ---------- */
#screen-review,
#screen-success {
  margin-top: calc(-1 * var(--space-4));
}

/* ---------- Review Screen ---------- */
.review-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-4) 0;
}

.community-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--teal-600);
  background: linear-gradient(135deg, rgba(22,122,101,.08), rgba(106,191,69,.08));
  border: 1px solid rgba(22,122,101,.18);
  padding: 5px 14px;
  border-radius: var(--radius-full);
}

.heart-icon-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heart-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(22,122,101,.12);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50%        { transform: scale(1.18); opacity: .3; }
}

.heart-icon-wrap > svg {
  /* sits inside the teal circle */
}

.heart-icon-wrap::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--teal-600);
  border-radius: 50%;
  z-index: 0;
}

.heart-icon-wrap > svg {
  position: relative;
  z-index: 1;
}

.review-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 400;
  color: var(--teal-900);
  line-height: 1.25;
}

.review-title strong {
  font-weight: 700;
  color: var(--teal-700);
}

.review-sub {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 320px;
  line-height: 1.6;
}

.review-sub em { color: var(--teal-600); font-style: normal; }

.review-body .btn-primary { max-width: 380px; }
.review-body .btn-ghost   { max-width: 380px; margin-top: -var(--space-2); }

/* ---------- Success Screen ---------- */
.success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-4) 0;
}

.success-anim-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--teal-400);
  animation: ring-expand 1.8s ease-out infinite;
}

.success-ring.ring-1 { animation-delay: 0s; }
.success-ring.ring-2 { animation-delay: 0.6s; }

@keyframes ring-expand {
  0%   { width: 60px; height: 60px; opacity: .8; }
  100% { width: 110px; height: 110px; opacity: 0; }
}

.success-checkmark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(22,122,101,.35);
  position: relative;
  z-index: 1;
  animation: check-pop var(--dur-slow) var(--ease) both;
}

@keyframes check-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--teal-800);
}

.success-sub {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 380px;
  line-height: 1.7;
}

.success-sub strong { color: var(--teal-700); }

/* Details grid */
.success-details {
  width: 100%;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.detail-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}

.detail-value {
  font-size: 13px;
  color: var(--teal-800);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.success-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--teal-600);
  background: rgba(22,122,101,.06);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  max-width: 100%;
}

.success-note svg { flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: var(--space-5);
  font-size: 12px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .card {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-md);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .br-desktop { display: none; }

  .stepper { gap: 0; }

  .step { min-width: 56px; }

  .step-label { font-size: 10px; }

  .step-circle { width: 28px; height: 28px; font-size: 12px; }

  .step-line { margin-top: 13px; }

  .success-details { padding: var(--space-4); }
}

@media (max-width: 400px) {
  .page-wrapper { padding: var(--space-6) var(--space-3) var(--space-10); }
  .card { padding: var(--space-5) var(--space-4); }
  .hero-text h1 { font-size: 22px; }
}
