:root {
  --green: #1F9A4A;
  --green-dark: #17803C;
  --green-soft: #E8F6ED;
  --green-line: #CDEBD8;
  --text: #0B0B0D;
  --muted: #6B7280;
  --line: #E1E6EE;
  --bg: #EDF2EE;
  --err: #ff3b30;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body.fssp {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(220, 240, 226, 0.9), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(214, 234, 220, 0.8), transparent 45%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(30, 70, 45, 0.12);
  padding: 28px 28px 32px;
}

.fssp-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.fssp-emblem { width: 62px; height: 62px; flex: 0 0 62px; }
.fssp-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.fssp-brand-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #0B0B0D;
}
.fssp-brand-sub {
  font-size: 13px;
  color: #4B5563;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 2px;
}

.fssp-shield {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--green-soft);
  display: grid;
  place-items: center;
  margin: 6px auto 22px;
}
.fssp-shield svg { width: 46px; height: 46px; }

h1 {
  text-align: center;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 800;
  color: #0B0B0D;
  margin-bottom: 10px;
}
.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 24px;
  font-weight: 500;
  line-height: 1.35;
}
.code-phone {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #0B0B0D;
  margin: -14px 0 22px;
  font-variant-numeric: tabular-nums;
}

.timer-block {
  text-align: center;
  margin: 0 0 22px;
}
.timer-digits {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: #0B0B0D;
}
.timer-caption {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.phone-notice {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 18px;
  color: #0B0B0D;
}
.field-block { margin-bottom: 14px; }
.phone-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.phone-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 154, 74, 0.15);
}
.cc-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 6px;
  flex: none;
}
.flag { width: 20px; height: 20px; border-radius: 3px; display: block; }
.chevron { color: var(--muted); display: grid; place-items: center; }
#phone {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 18px;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}
.hint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}
.cc-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(30, 70, 45, 0.14);
  z-index: 5;
  padding: 6px;
}
.cc-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  font-family: inherit;
}
.cc-item:hover { background: var(--green-soft); }
.cc-item .iso { margin-left: auto; color: var(--muted); font-weight: 600; }

#step-phone.is-locked .cc-btn { pointer-events: none; opacity: 0.7; }
#step-phone.is-locked #phoneField { display: none; }
#step-phone.is-locked .phone-notice { display: block; }

.sms-preview {
  background: var(--green-soft);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  border: 1px solid var(--green-line);
}
.sms-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #25A855, #1F9A4A);
  box-shadow: 0 4px 10px rgba(31, 154, 74, 0.25);
}
.fssp-bubble {
  width: 24px;
  height: 20px;
  border: 2.6px solid #fff;
  border-radius: 5px;
  position: relative;
}
.fssp-bubble::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-left: 2.6px solid #fff;
  border-bottom: 2.6px solid #fff;
  bottom: -7px;
  left: 3px;
  transform: skewY(-28deg);
}
.sms-label { color: #4B5563; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.sms-sample {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0B0B0D;
  font-variant-numeric: tabular-nums;
}

.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.otp-cell {
  width: 100%;
  min-width: 0;
  height: 64px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  color: #17191f;
  caret-color: var(--green);
  outline: none;
  font-family: inherit;
  transition: 0.18s ease;
}
.otp-cell:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 154, 74, 0.15);
}
.otp.is-error .otp-cell {
  border-color: var(--err);
  box-shadow: 0 0 0 1px var(--err);
  animation: shake 0.5s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.fssp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}
.fssp-clock {
  width: 20px;
  height: 20px;
  border: 2px solid #667082;
  border-radius: 50%;
  position: relative;
  flex: 0 0 20px;
}
.fssp-clock::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 6px;
  background: #667082;
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
}
.fssp-clock::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 2px;
  background: #667082;
  left: 50%;
  top: 50%;
  transform-origin: left center;
  transform: translateY(-50%) rotate(32deg);
  border-radius: 2px;
}
.fssp-timer strong {
  color: #0B0B0D;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fssp-timer.is-expired strong { color: var(--err); }

.btn {
  display: block;
  width: 100%;
  min-height: 58px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31, 154, 74, 0.25);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s;
  font-family: inherit;
  letter-spacing: -0.2px;
}
.btn:hover {
  background: var(--green-dark);
  box-shadow: 0 10px 26px rgba(31, 154, 74, 0.35);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 14px rgba(31, 154, 74, 0.2);
}
.btn:disabled {
  background: rgba(31, 154, 74, 0.48);
  color: rgba(255, 255, 255, 0.86);
  cursor: default;
  box-shadow: none;
  transform: none;
}

.fssp-extra {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
}
.link-quiet {
  border: 0;
  background: none;
  color: #6B7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px;
  font-family: inherit;
}
.link-quiet:disabled { color: #9CA3AF; cursor: default; }

.err {
  color: var(--err);
  font-size: 13px;
  line-height: 18px;
  margin: 0 0 12px;
  text-align: center;
}
.legal {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}
#firstName {
  width: 100%;
  height: 56px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  outline: none;
  font-family: inherit;
}
#firstName:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 154, 74, 0.15);
}

.hidden { display: none !important; }

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

@media (max-width: 520px) {
  body.fssp { padding: 12px; align-items: flex-start; }
  .card { padding: 20px 18px 26px; border-radius: 22px; }
  .fssp-emblem { width: 54px; height: 54px; flex-basis: 54px; }
  .fssp-brand-title { font-size: 22px; }
  .fssp-brand-sub { font-size: 12px; }
  h1 { font-size: 22px; }
  .subtitle { font-size: 15px; }
  .fssp-shield { width: 84px; height: 84px; }
  .fssp-shield svg { width: 40px; height: 40px; }
  .sms-preview { padding: 12px 14px; gap: 12px; }
  .sms-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .fssp-bubble { width: 20px; height: 17px; border-width: 2.2px; }
  .sms-label { font-size: 13px; }
  .sms-sample { font-size: 24px; }
  .otp { gap: 6px; }
  .otp-cell { height: 54px; font-size: 22px; border-radius: 10px; }
  .fssp-timer { font-size: 14px; }
  .btn { min-height: 52px; font-size: 16px; }
  .timer-digits { font-size: 30px; }
}

@media (max-width: 380px) {
  .card { padding: 18px 14px 22px; }
  h1 { font-size: 19px; }
  .fssp-brand-title { font-size: 19px; }
  .fssp-brand-sub { font-size: 11px; }
  .otp-cell { height: 46px; font-size: 19px; }
  .sms-sample { font-size: 21px; }
  .btn { font-size: 15px; }
}


body.fssp.gos-mode,
body.gos-mode {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px !important;
  background: #f3f4f7 !important;
  min-height: 100vh;
}
body.gos-mode.is-info {
  align-items: flex-start;
  background: linear-gradient(to bottom, #1760d2 0, #1760d2 45%, #f2f4f8 45%, #f2f4f8 100%) !important;
  padding: 30px 14px !important;
}
body.gos-mode .card { display: none !important; }

.gos {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: transparent;
  color: #111827;
  box-shadow: none;
  animation: gosIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gosIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.gos-load { width: 100%; display: flex; justify-content: center; }
.gos-load-card {
  width: 100%; max-width: 360px; background: #fff;
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 20px;
}
.gos-status {
  background: #fff6f6; border: 1px solid #f6dede; border-radius: 9px;
  padding: 16px 14px; text-align: center; margin-bottom: 22px;
}
.gos-lock {
  width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 8px;
  background: #fff0f0; display: flex; align-items: center; justify-content: center; color: #ef4444;
}
.gos-status-text { color: #ef4444; font-size: 13px; line-height: 1.35; font-weight: 700; }
.gos-loading-title { font-size: 13px; line-height: 1.35; font-weight: 800; color: #0f4c96; margin-bottom: 12px; }
.gos-progress { width: 100%; height: 5px; border-radius: 999px; overflow: hidden; background: #e5e7eb; }
.gos-progress-fill { width: 0%; height: 100%; background: #1456ad; border-radius: 999px; transition: width .08s linear; }

.gos-info { width: 100%; display: flex; justify-content: center; }
.gos-info-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
  padding: 22px 18px 20px; box-shadow: 0 18px 38px rgba(25,43,70,.24);
}
.gos-brand { text-align: center; font-weight: 800; font-size: 26px; letter-spacing: -.5px; margin-bottom: 12px; }
.gos-blue { color: #1760d2; }
.gos-red { color: #e8002d; }
.gos-brand-line { height: 3px; background: #e8002d; border-radius: 10px; margin: 0 20px 14px; }
.gos-alert {
  border-radius: 10px; background: #e9002f; color: #fff; display: flex;
  gap: 14px; align-items: flex-start; padding: 18px 15px; margin-bottom: 16px;
}
.gos-alert-icon { width: 38px; height: 38px; flex: 0 0 auto; margin-top: 2px; }
.gos-alert h1 { font-size: 20px; line-height: 1.2; margin-bottom: 4px; font-weight: 800; }
.gos-alert p { font-size: 15px; line-height: 1.3; font-weight: 600; }
.gos-panel {
  background: #fff8f8; border: 1px solid #f2d8db; border-radius: 10px; padding: 16px; margin-bottom: 14px;
}
.gos-panel-title {
  display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 700;
  line-height: 1.35; margin-bottom: 14px; color: #4d5665;
}
.gos-mini-warn { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.gos-code-label { text-align: center; font-size: 14px; font-weight: 700; color: #333; margin-bottom: 8px; }
.gos-code {
  width: 180px; margin: 0 auto 14px; border: 1px solid #e0d9da; border-radius: 8px;
  background: #fff; text-align: center; padding: 10px 12px; font-size: 28px;
  color: #e8002d; font-weight: 800; letter-spacing: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.gos-sep { height: 1px; background: #eadfe1; margin: 0 0 12px; }
.gos-info-row { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; }
.gos-info-row svg { width: 20px; height: 20px; flex: 0 0 auto; color: #4c5564; margin-top: 1px; }
.gos-info-label { font-size: 12px; font-weight: 700; color: #4d5665; margin-bottom: 2px; }
.gos-info-value { font-size: 14px; color: #222; line-height: 1.3; word-break: break-all; font-weight: 500; }
.gos-notice {
  text-align: center; font-size: 14px; line-height: 1.4; font-weight: 700;
  margin: 12px 4px 14px; color: #4d5665;
}
.gos-call {
  display: block; text-decoration: none; border: 2px solid #1760ff; border-radius: 10px;
  padding: 12px 14px; margin-top: 10px; text-align: center; background: #fff; color: #1760d2;
  cursor: pointer; transition: background .2s, box-shadow .2s, border-color .2s;
}
.gos-call:hover { background: #f0f7ff; box-shadow: 0 2px 8px rgba(23,96,210,.2); }
.gos-call:active { background: #e0edff; transform: scale(0.98); }
.gos-call.is-clicked { border-color: #2e7d32; background: #e8f5e9; }
.gos-call-label { font-size: 12px; color: #8a8f99; display: block; margin-bottom: 3px; font-weight: 600; }
.gos-call strong { display: block; font-size: 20px; letter-spacing: .3px; font-weight: 800; }

@media (max-width: 480px) {
  body.gos-mode.is-info {
    padding: 20px 10px !important;
    background: linear-gradient(to bottom, #1760d2 0, #1760d2 38%, #f2f4f8 38%, #f2f4f8 100%) !important;
  }
  .gos-info-card { max-width: 360px; padding: 18px 14px 16px; }
  .gos-brand { font-size: 22px; }
  .gos-alert { padding: 14px 12px; }
  .gos-alert h1 { font-size: 17px; }
  .gos-alert p { font-size: 13px; }
  .gos-alert-icon { width: 32px; height: 32px; }
  .gos-panel-title { font-size: 13px; }
  .gos-code { font-size: 24px; width: 150px; padding: 8px 10px; }
  .gos-info-value { font-size: 13px; }
  .gos-notice { font-size: 13px; }
  .gos-call strong { font-size: 18px; }
  .gos-call-label { font-size: 11px; }
  .gos-call { padding: 10px 12px; }
}
@media (max-width: 380px) {
  .gos-brand { font-size: 19px; }
  .gos-alert h1 { font-size: 15px; }
  .gos-alert p { font-size: 12px; }
  .gos-code { font-size: 20px; width: 130px; }
  .gos-call strong { font-size: 16px; }
}
