:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17213a;
  --ink: #17213a;
  --muted: #667085;
  --green: #138876;
  --green-bright: #22b88d;
  --line: #d7dce5;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 2% 2%, rgba(219, 233, 249, 0.96) 0 14rem, transparent 31rem),
    radial-gradient(circle at 99% 98%, rgba(250, 220, 235, 0.78) 0 12rem, transparent 29rem),
    linear-gradient(135deg, #edf1f8 0%, #f2eef8 55%, #f8eff5 100%);
  background-attachment: fixed;
}

.page-shell {
  width: min(100%, 600px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 28px 20px 24px;
}

.brand { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink); }
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  box-shadow: 0 10px 24px rgba(223, 46, 70, 0.2);
}
.brand-copy { display: grid; line-height: 1; }
.brand-name { font-size: 1.42rem; font-weight: 900; letter-spacing: -0.055em; }
.brand-subtitle { margin-top: 7px; color: #778198; font-size: 0.56rem; font-weight: 900; letter-spacing: 0.28em; }

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  padding: 13px 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 30px rgba(68, 71, 103, 0.06);
  backdrop-filter: blur(12px);
}
.progress-step { display: grid; gap: 6px; color: #9299aa; font-size: 0.73rem; font-weight: 800; text-align: center; }
.progress-line { height: 5px; border-radius: 99px; background: #d8dce5; transition: background 180ms ease; }
.progress[data-step="loading"] .step-phone,
.progress[data-step="phone"] .step-phone,
.progress[data-step="otp"] .step-phone,
.progress[data-step="otp"] .step-otp,
.progress[data-step="authenticated"] .progress-step { color: #176d5f; }
.progress[data-step="loading"] .step-phone .progress-line,
.progress[data-step="phone"] .step-phone .progress-line,
.progress[data-step="otp"] .step-phone .progress-line,
.progress[data-step="otp"] .step-otp .progress-line,
.progress[data-step="authenticated"] .progress-line { background: linear-gradient(90deg, var(--green), var(--green-bright)); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-card {
  padding: 38px 42px 35px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(54, 58, 92, 0.13);
}
.eyebrow { margin: 0; color: var(--green); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.21em; }
h1 { margin: 0; color: var(--ink); font-size: clamp(1.95rem, 5vw, 2.5rem); line-height: 1.04; letter-spacing: -0.05em; }
p { color: var(--muted); line-height: 1.55; }
.intro { max-width: 34rem; margin: 3px 0 7px; font-size: 0.95rem; }
.state { display: grid; gap: 15px; }
.state[hidden], .status[hidden], [hidden] { display: none !important; }

label { margin-bottom: -10px; color: #344054; font-size: 0.92rem; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #fafbfc;
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input::placeholder { color: #98a2b3; }
input:focus, select:focus { border-color: #3aad96; box-shadow: 0 0 0 4px rgba(31, 184, 140, 0.13); background: #fff; }
.country-select {
  position: relative;
  width: 124px;
  min-height: 56px;
  flex: 0 0 124px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafbfc;
}
.country-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 850;
}
.country-display span { color: #7d8698; font-size: 0.95rem; }
.country-select select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.country-select:focus-within { border-color: #3aad96; box-shadow: 0 0 0 4px rgba(31, 184, 140, 0.13); background: #fff; }
.phone-row { display: flex; gap: 12px; }
.privacy-note {
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid #dceaf0;
  border-radius: 16px;
  background: #f2f8fa;
  color: #52697a;
  font-size: 0.87rem;
}
.note-icon, .secure-badge span {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #d9f3e9;
  color: #147b68;
  font-size: 0.75rem;
  font-weight: 900;
}
.note-icon--plain { background: transparent; font-size: 1rem; }
.secure-badge { display: flex; align-items: center; gap: 9px; color: #477067; font-size: 0.86rem; font-weight: 750; }

button {
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #128775, #24b58e);
  box-shadow: 0 12px 24px rgba(26, 155, 124, 0.18);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 15px 28px rgba(26, 155, 124, 0.23); }
button:focus-visible { outline: 3px solid rgba(31, 184, 140, 0.3); outline-offset: 3px; }
button:disabled { cursor: not-allowed; background: #d1d8e3; box-shadow: none; opacity: 1; transform: none; }
button.secondary { border: 1px solid #d3d8e2; background: #fff; box-shadow: none; color: #344054; }
.inline-actions, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.text-button {
  width: auto;
  min-height: 42px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #176d5f;
  font-size: 0.87rem;
}
.text-button:hover { transform: none; box-shadow: none; text-decoration: underline; }
.text-button:disabled { background: transparent; color: #8b93a3; }
.result-heading { align-items: flex-start; }
.result-heading > div { display: grid; gap: 8px; }
.subscription-loading { display: flex; align-items: center; gap: 12px; min-height: 92px; color: var(--muted); }
.summary-grid { display: grid; gap: 13px; }
.summary-card { padding: 19px; border: 1px solid #e0e5ec; border-radius: 18px; background: #fafbfc; }
.summary-card p { margin: 0; }
.summary-label { color: #727c90 !important; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.16em; }
.summary-value { margin-top: 7px !important; color: var(--ink) !important; font-size: 1.18rem; font-weight: 900; }
.summary-value.active { color: #147a67 !important; }
.summary-value.inactive { color: #8b3544 !important; }
.summary-detail { margin-top: 6px !important; font-size: 0.9rem; }
.notice { margin-top: 12px !important; padding: 11px 13px; border-radius: 12px; background: #fff1f3; color: #8b3544 !important; font-size: 0.88rem; }
.notice.neutral { background: #eef8f5; color: #176b57 !important; }
.button-link {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #128775, #24b58e);
  box-shadow: 0 12px 24px rgba(26, 155, 124, 0.18);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}
.button-link:focus-visible { outline: 3px solid rgba(31, 184, 140, 0.3); outline-offset: 3px; }
.rpc-error { padding: 18px; border: 1px solid #f1aeb8; border-radius: 16px; background: #fff7f8; }
.rpc-error p { margin: 0 0 14px; color: #8b3544; }
.status { margin: 22px 0 0; padding: 14px 16px; border: 1px solid #f1aeb8; border-radius: 14px; background: #fff4f5; color: #9f3345; }
.status.success { border-color: #a8dfd0; background: #effaf6; color: #176b57; }
.help { margin: 0; color: #737e94; font-size: 0.88rem; text-align: center; }
.help a { color: #08758a; font-weight: 800; }
.loader {
  width: 28px;
  height: 28px;
  border: 3px solid #dcebe7;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .page-shell { justify-content: flex-start; gap: 13px; padding: 20px 12px; }
  .brand-logo { width: 44px; height: 44px; border-radius: 12px; }
  .brand-name { font-size: 1.32rem; }
  .progress { gap: 7px; padding: 13px 12px 12px; border-radius: 18px; }
  .progress-step { gap: 6px; font-size: 0.69rem; }
  .progress-line { height: 5px; }
  .portal-card { padding: 28px 22px 25px; border-radius: 24px; }
  h1 { font-size: clamp(1.9rem, 10vw, 2.35rem); }
  .intro { font-size: 0.94rem; }
  .phone-row { gap: 8px; }
  .country-select { width: 118px; min-height: 58px; flex-basis: 118px; }
  input, select, button { min-height: 58px; }
}
@media (max-width: 370px) {
  .progress-step { font-size: 0.62rem; }
  .portal-card { padding-inline: 18px; }
  .country-select { width: 108px; flex-basis: 108px; }
  .result-heading { display: grid; }
  .result-heading .text-button { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
