:root {
  --bg: #eef2ff;
  --bg-soft: rgba(255, 255, 255, 0.62);
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --text: #151b2b;
  --muted: #5d667d;
  --line: rgba(103, 123, 177, 0.18);
  --primary: #2f628d;
  --primary-soft: #bdd1f4;
  --primary-strong: #1f4f7b;
  --success: #18794e;
  --error: #c93c3c;
  --shadow: 0 30px 80px rgba(112, 132, 184, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(159, 181, 255, 0.28), transparent 30%),
    radial-gradient(circle at right 10%, rgba(198, 215, 255, 0.42), transparent 22%),
    linear-gradient(180deg, #f7f9ff 0%, #edf2ff 48%, #eef2ff 100%);
  position: relative;
  overflow-x: hidden;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.42;
  pointer-events: none;
}

.page-shell::before {
  top: -7rem;
  left: -8rem;
  background: rgba(199, 214, 255, 0.85);
}

.page-shell::after {
  right: -8rem;
  bottom: 10%;
  background: rgba(214, 226, 255, 0.92);
}

.page {
  width: min(100%, 36rem);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.card,
.step-card {
  min-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
}

.step-card {
  justify-content: flex-start;
  padding-top: 0.25rem;
}

.logo-wrap {
  width: 7rem;
  height: 7rem;
  margin: 0 auto;
  border-radius: 50%;
  background:#2c6284;
  display: grid;
  place-items: center;
  color: #f6f8ff;
}

.step-logo {
  margin-top: 1.2rem;
}

.logo-mark {
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.12em;
  transform: translateX(-0.1rem);
}

.logo-image {
  width: 76%;
  border-radius: 20px;
  height: 76%;
  object-fit: contain;
}

.hero-copy {
  text-align: center;
}

.step-copy {
  max-width: 32rem;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.5rem);
  line-height: 1.08;
}

.subtitle {
  margin: 0.85rem auto 0;
  max-width: 31rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.phone-form,
.step-form {
  background: var(--bg-soft);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 2rem;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.step-form {
  margin-top: 0.2rem;
}

.field-label {
  display: block;
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.phone-field {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.phone-field:focus-within {
  border-color: rgba(47, 98, 141, 0.45);
  box-shadow: 0 0 0 0.28rem rgba(91, 134, 189, 0.14);
  transform: translateY(-1px);
}

.single-field {
  grid-template-columns: 1fr;
}

.prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-right: 0.8rem;
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.flag {
  width: 2rem;
  height: 1.35rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(180deg, #d61f2a 0 33%, #ffffff 33% 66%, #2d8c3c 66% 100%);
  position: relative;
}

.flag::after {
  content: "*";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e3b129;
  font-size: 0.7rem;
}

.phone-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  min-height: 2rem;
}

.phone-field input::placeholder {
  color: #a2abc0;
}

.consent {
  margin: 1rem 0 1.1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
}

a {
  color: #2f74ff;
  text-decoration-thickness: 0.08em;
}

.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 1rem;
  min-height: 3.6rem;
  padding: 1rem 1.25rem;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  color: #f6f9ff;
  background: linear-gradient(180deg, var(--primary-soft) 0%, #9cb8e8 100%);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 14px 30px rgba(101, 132, 193, 0.2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.submit-btn.is-inactive,
.submit-btn:disabled {
  background: linear-gradient(180deg, #d5def2 0%, #bfcee8 100%);
  color: rgba(246, 249, 255, 0.92);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.submit-btn.is-ready {
  background: linear-gradient(180deg, #4f86be 0%, #2f628d 100%);
  box-shadow: 0 18px 36px rgba(47, 98, 141, 0.28);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(101, 132, 193, 0.26);
}

.secondary-btn {
  margin-top: 1rem;
}

.status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.status.is-success {
  color: var(--success);
}

.status.is-error {
  color: var(--error);
}

.field-error {
  margin: 0.65rem 0 0;
  color: var(--error);
  font-size: 0.92rem;
  font-weight: 700;
}

.help-text {
  margin: 0;
  text-align: center;
  color: var(--text);
  font-weight: 600;
}

.back-link {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #2f74ff;
  text-decoration: none;
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.otp-input {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
  font: inherit;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.otp-input:focus {
  border-color: rgba(47, 98, 141, 0.45);
  box-shadow: 0 0 0 0.28rem rgba(91, 134, 189, 0.14);
  transform: translateY(-1px);
}

.ghost-link {
  display: block;
  margin: 1.15rem auto 0;
  background: transparent;
  border: 0;
  color: #2f74ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.resend-btn {
  margin-top: 1rem;
}

.center-link {
  margin-top: 0.5rem;
}

.rejected-card {
  justify-content: center;
}

.waiting-card {
  justify-content: center;
}

.survey-start-card,
.survey-finish-card {
  align-items: stretch;
}

.survey-start-btn {
  max-width: 22rem;
  margin: 0 auto;
}

.survey-card {
  justify-content: center;
}

.survey-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0 auto 0.25rem;
  width: min(100%, 18rem);
}

.survey-progress span {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(157, 184, 232, 0.32);
}

.survey-progress .survey-progress-active {
  background: linear-gradient(90deg, #2f628d 0%, #76a3da 100%);
}

.survey-form {
  display: grid;
  gap: 0.8rem;
}

.survey-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.survey-option:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 98, 141, 0.35);
  box-shadow: 0 12px 24px rgba(114, 136, 184, 0.12);
}

.survey-option input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--primary);
}

.survey-option span {
  font-weight: 700;
  color: var(--text);
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.6rem 1.2rem;
  border-radius: 1.6rem;
  background: var(--bg-soft);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.loading-ring {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  border: 0.35rem solid rgba(157, 184, 232, 0.34);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

.loading-text {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

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

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(171, 192, 255, 0.32), transparent 34%),
      radial-gradient(circle at bottom right, rgba(203, 220, 255, 0.56), transparent 26%),
      linear-gradient(180deg, #f8faff 0%, #eef3ff 55%, #e9efff 100%);
  }

  .page {
    width: 100%;
    padding:
      max(1rem, env(safe-area-inset-top))
      0.9rem
      calc(1.4rem + env(safe-area-inset-bottom));
  }

  .card,
  .step-card {
    min-height: calc(100vh - 2rem);
    gap: 1.35rem;
  }

  .card {
    justify-content: flex-start;
  }

  .logo-wrap {
    width: 5.8rem;
    height: 5.8rem;
  }

  .logo-mark {
    font-size: 2.65rem;
  }

  h1 {
    font-size: 1.9rem;
    letter-spacing: -0.03em;
  }

  .subtitle {
    font-size: 1rem;
    max-width: 24rem;
  }

  .phone-form,
  .step-form {
    border-radius: 1.5rem;
    padding: 1rem;
    position: relative;
  }

  .phone-field {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.95rem 0.95rem 1rem;
  }

  .single-field {
    grid-template-columns: 1fr;
  }

  .prefix {
    padding-right: 0;
    padding-bottom: 0.6rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .phone-field input {
    font-size: 1.2rem;
  }

  .consent {
    margin-top: 1.05rem;
    font-size: 0.93rem;
  }

  .submit-btn {
    min-height: 3.9rem;
    border-radius: 1.15rem;
    font-size: 1.08rem;
  }

  .otp-grid {
    gap: 0.6rem;
  }

  .otp-input {
    border-radius: 0.85rem;
    font-size: 1.65rem;
  }

  .loading-box {
    padding: 1.35rem 1rem;
  }

  .loading-ring {
    width: 4.2rem;
    height: 4.2rem;
  }

  .survey-option {
    padding: 0.95rem;
    gap: 0.75rem;
  }
}

@media (max-width: 420px) {
  .page {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .logo-wrap {
    width: 5.2rem;
    height: 5.2rem;
  }

  .logo-mark {
    font-size: 2.35rem;
  }

  h1 {
    font-size: 1.72rem;
  }

  .subtitle {
    font-size: 0.96rem;
  }

  .phone-form,
  .step-form {
    padding: 0.9rem;
  }

  .field-label {
    font-size: 0.95rem;
  }

  .code {
    font-size: 1rem;
  }

  .phone-field input {
    font-size: 1.08rem;
  }

  .otp-grid {
    gap: 0.5rem;
  }

  .otp-input {
    font-size: 1.45rem;
  }
}
