:root {
  --blue: #007aff;
  --text: #060708;
  --muted: rgba(6, 7, 8, 0.52);
  --icon: rgba(6, 7, 8, 0.84);
  --field: rgba(9, 9, 9, 0.05);
  --chip: rgba(13, 13, 13, 0.04);
  --err: #e5484d;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, system-ui, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.sky, .pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.sky {
  background: linear-gradient(28deg, #99d5d7 8.03%, #80bcff 91.51%);
}
.pattern {
  background: linear-gradient(28deg, rgba(0, 122, 255, 0.3) 8.03%, rgba(0, 122, 255, 0.3) 91.51%);
  -webkit-mask-image: url("/pattern_space.svg");
  mask-image: url("/pattern_space.svg");
  -webkit-mask-position: 50% center;
  mask-position: 50% center;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
  -webkit-mask-size: auto;
  mask-size: auto;
}

.auth {
  position: relative;
  z-index: 1;
  width: 580px;
  height: 696px;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 28px;
  background: linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.88));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.auth-head {
  width: 100%;
  height: 84px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}
.icon-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--chip); }

.auth-main {
  width: 360px;
  max-width: 100%;
  padding: 48px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: none;
}

.logo-wrap {
  width: 336px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 24px;
  display: flex;
  justify-content: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
}
.auth-logo {
  width: 38px;
  height: 38px;
  background: url("/authLogo.png") center / contain no-repeat;
  flex: none;
}
.wordmark { color: var(--text); display: block; }

.explainer {
  width: 336px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

h1 {
  margin: 0;
  width: 304px;
  max-width: 100%;
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: normal;
}
.sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 0.15px;
}

.field-block { width: 336px; max-width: 100%; margin: 0 auto; }

.phone-box {
  position: relative;
  width: 336px;
  max-width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--field);
}
.cc-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  margin: 0 8px 0 0;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
}
.chevron {
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: var(--text);
}
.flag {
  width: 20px;
  height: 20px;
  object-fit: cover;
  flex: none;
  display: block;
}
#phone {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
  outline: none;
  padding: 0;
}
#phone::placeholder { color: var(--muted); }

.cc-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  text-align: left;
  z-index: 5;
  padding: 6px;
}
.cc-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.cc-item:hover { background: var(--field); }
.cc-item .iso { color: var(--muted); margin-left: auto; }
.cc-item .flag { border-radius: 2px; }

.hint {
  width: 336px;
  max-width: 100%;
  margin: 0;
  padding: 4px 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.2px;
  text-align: left;
}

input[type="text"]:not(.otp-cell), #firstName {
  width: 336px;
  max-width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--field);
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  text-align: left;
  margin: 0 auto;
  display: block;
}
#step-recover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}
#step-recover.is-out {
  animation: recoverOut 0.48s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
#step-phone.is-in {
  animation: authIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes recoverOut {
  to {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
    filter: blur(4px);
  }
}
@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.recover-lead {
  max-width: 304px;
}

.timer-block {
  width: 336px;
  max-width: 100%;
  padding: 8px 0 4px;
  text-align: center;
}
.timer-digits {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.timer-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.15px;
}

.wait-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--chip);
  color: rgba(6, 7, 8, 0.64);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.15px;
}
.wait-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.55);
  animation: waitPulse 1.6s ease-out infinite;
}
@keyframes waitPulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(0, 122, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

.auth--restoring .auth-main {
  pointer-events: none;
}

#step-phone {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
}
#step-code, #step-name {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.sms-preview {
  width: 336px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--field);
  text-align: left;
}
.sms-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.sms-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  color: var(--text);
}
.sms-sample {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.otp {
  width: 336px;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.otp-cell {
  width: 48px;
  height: 56px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: var(--field);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  outline: none;
  caret-color: var(--blue);
  padding: 0;
}
.otp-cell:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
  background: #fff;
}
.otp.is-error .otp-cell {
  border-color: var(--err);
  animation: otpShake 0.35s ease;
}
@keyframes otpShake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.btn {
  width: 336px;
  max-width: 100%;
  height: 60px;
  border: 0;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.15px;
  cursor: pointer;
  padding: 18px 22px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled {
  background: rgba(0, 122, 255, 0.48);
  color: rgba(255, 255, 255, 0.72);
  cursor: default;
  filter: none;
}

.link-quiet {
  display: block;
  margin: 0 auto;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px;
}
.link-quiet:disabled { color: var(--muted); cursor: default; }

.err {
  width: 336px;
  max-width: 100%;
  color: var(--err);
  font-size: 13px;
  line-height: 18px;
  margin: -8px auto 0;
}

.auth-foot {
  width: 360px;
  max-width: 100%;
  margin-top: auto;
  padding: 24px 12px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
}
.legal {
  margin: 0;
  width: 336px;
  max-width: 100%;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.2px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.hidden { display: none !important; }
.center { text-align: center; }

.spinner {
  width: 28px;
  height: 28px;
  margin: 12px auto 0;
  border: 3px solid rgba(0, 122, 255, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .auth {
    width: calc(100% - 16px);
    height: calc(100vh - 16px);
    max-height: none;
    border-radius: 20px;
  }
}

body.gos-mode {
  display: block;
  background: #f3f4f7;
  align-items: stretch;
}
body.gos-mode .sky,
body.gos-mode .pattern,
body.gos-mode .auth {
  display: none;
}

.gos {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  color: #0b1f33;
  animation: gosIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gosIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.gos-page { padding-bottom: 32px; }
.gos-header {
  padding: 18px 20px 8px;
}
.gos-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f5;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.logo-gos { color: #0d66af; }
.logo-uslugi { color: #e5475a; }
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.burger-icon {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.burger-icon span {
  display: block;
  height: 2px;
  background: #0b1f33;
  border-radius: 2px;
}
.search-icon {
  width: 22px;
  height: 22px;
  color: #0b1f33;
}
.login-btn {
  color: #0d4cd3;
  font-weight: 600;
  font-size: 16px;
}

.status-card, .loading-card, .info-box {
  margin: 16px 20px 0;
  padding: 20px;
  border-radius: 16px;
  background: #f5f7fb;
}
.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lock-icon { color: #0d4cd3; }
.status-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.loading-card { text-align: center; }
.gos-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border: 3px solid rgba(13, 76, 211, 0.18);
  border-top-color: #0d4cd3;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}
.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: #e3e8f2;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #0d4cd3, #3d7dff);
  transition: width 0.35s ease;
}
.info-box {
  display: flex;
  gap: 12px;
  color: #0d4cd3;
}
.info-title {
  font-size: 15px;
  font-weight: 700;
  color: #0b1f33;
}
.info-desc {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(11, 31, 51, 0.64);
}

.gos-content { padding: 16px 16px 40px; }
.alert-banner {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #d8161b;
  color: #fff;
  align-items: flex-start;
}
.alert-icon-wrapper { flex: none; width: 48px; }
.alert-triangle { width: 48px; height: 48px; display: block; }
.alert-text h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.alert-text p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.92;
}
.code-title {
  margin: 22px 4px 10px;
  font-size: 18px;
  font-weight: 700;
}
.info-list { display: flex; flex-direction: column; gap: 4px; }
.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #eef1f5;
}
.item-icon { width: 22px; height: 22px; color: #0d4cd3; flex: none; }
.item-text { display: flex; flex-direction: column; gap: 2px; }
.item-label { font-size: 13px; color: rgba(11, 31, 51, 0.55); }
.item-value { font-size: 16px; font-weight: 600; }
.info-notice {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #eef5ff;
}
.notice-icon { width: 24px; height: 24px; flex: none; }
.notice-text { font-size: 14px; line-height: 1.45; }
.notice-link { color: #0d4cd3; font-weight: 600; }
.call-btn {
  display: block;
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #0d4cd3;
  color: #fff;
  text-decoration: none;
  text-align: center;
}
.call-btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}
.call-btn-main svg { width: 22px; height: 22px; fill: #fff; }
.call-btn-sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.9;
}
.call-btn-sub-last { margin-top: 4px; opacity: 0.8; }
.action-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: #f5f7fb;
}
.action-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-header h3 { margin: 0; font-size: 17px; }
.shield-icon { width: 22px; height: 22px; color: #0d4cd3; }
.action-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: rgba(11, 31, 51, 0.78);
  line-height: 1.5;
}
