:root {
  --red: #e30613;
  --red-dark: #b8000a;
  --ink: #191919;
  --muted: #5f6368;
  --line: #e7e7e7;
  --soft: #f7f7f7;
  --ok: #177245;
  --error: #b42318;
  --focus: #111111;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 18px 16px 32px;
}

.card {
  width: min(100%, 640px);
  padding: 10px 0 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  margin-bottom: 18px;
}

.logo {
  width: 132px;
  height: auto;
  object-fit: contain;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.intro-copy {
  margin-top: 18px;
}

h1,
legend {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.08;
  font-weight: 800;
}

.intro-copy p,
.helper,
.result p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.helper.small {
  font-size: 14px;
}

.primary {
  width: 100%;
  min-height: 56px;
  margin-top: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  transition: background .16s ease, transform .16s ease;
}

.primary:hover {
  background: var(--red-dark);
}

.primary:active {
  transform: translateY(1px);
}

.primary:disabled {
  cursor: not-allowed;
  background: #9b9b9b;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.trust span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.progress-wrap {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  margin-bottom: 10px;
}

.back {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.back[hidden] {
  display: block;
  visibility: hidden;
}

.progress-text {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.bar {
  height: 4px;
  margin-bottom: 28px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.bar span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width .2s ease;
}

form,
fieldset {
  margin: 0;
}

fieldset {
  border: 0;
  padding: 0;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.options button {
  width: 100%;
  min-height: 62px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.options button:hover {
  border-color: #bbbbbb;
  background: var(--soft);
}

.options button[aria-pressed="true"] {
  border-color: var(--red);
  background: #fff2f3;
  color: var(--red-dark);
}

.fields {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 14px 15px;
  color: var(--ink);
  background: #ffffff;
  font-size: 17px;
}

input:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.error {
  min-height: 20px;
  margin: 0 0 4px;
  color: var(--error);
  font-size: 14px;
  line-height: 1.35;
}

.server {
  margin-top: 12px;
}

.secondary {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #ffffff;
  color: var(--red-dark);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.secondary:hover {
  background: #fff2f3;
}

.secondary:disabled {
  cursor: not-allowed;
  border-color: #cfcfcf;
  color: #8a8a8a;
  background: #f6f6f6;
}

.otp-send {
  margin-top: 4px;
}

.otp-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.otp-panel[hidden] {
  display: none;
}

.otp-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.text-button {
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.otp-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

@media (max-width: 460px) {
  .otp-actions {
    grid-template-columns: 1fr;
  }
}

.result h1 {
  font-size: 31px;
}

.result ul {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.result li {
  padding-left: 22px;
  position: relative;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.result li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.result strong {
  display: block;
  margin-top: 20px;
  color: var(--red-dark);
  font-size: 18px;
}

@media (min-width: 700px) {
  .shell {
    place-items: center;
    padding: 40px 24px;
  }

  .card {
    padding: 8px 0;
  }

  .logo {
    width: 148px;
  }

  h1,
  legend {
    font-size: 42px;
  }

  .result h1 {
    font-size: 38px;
  }
}


.otp-panel {
  position: relative;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.otp-header {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.otp-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #fff3f4;
  border: 1px solid #ffd4d8;
  overflow: hidden;
}

.otp-icon {
  position: relative;
  z-index: 2;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--red-dark);
}

.otp-ring {
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 2px solid rgba(227, 6, 19, 0.18);
  opacity: 0;
}

.otp-copy strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.otp-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.otp-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.otp-step {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4f4f4;
  color: #70757a;
  font-size: 12px;
  font-weight: 700;
}

.otp-step--active {
  background: #fff0f1;
  color: var(--red-dark);
}

.otp-step--done {
  background: #ebf8f0;
  color: var(--ok);
}

.otp-input {
  letter-spacing: 0.12em;
  font-weight: 800;
  text-transform: uppercase;
}

.otp-panel.is-sending .otp-badge,
.otp-panel.is-verifying .otp-badge {
  background: #fff8e8;
  border-color: #ffe0a3;
}

.otp-panel.is-sending .otp-icon,
.otp-panel.is-verifying .otp-icon {
  animation: otpBlink 1s ease-in-out infinite;
  color: #9a6700;
}

.otp-panel.is-sending .otp-ring,
.otp-panel.is-verifying .otp-ring {
  animation: otpPulse 1.4s ease-out infinite;
}

.otp-panel.is-sent {
  border-color: #ffd4d8;
  background: linear-gradient(180deg, #fffefe 0%, #fff8f8 100%);
}

.otp-panel.is-verified {
  border-color: #b6e2c4;
  background: linear-gradient(180deg, #ffffff 0%, #f4fcf7 100%);
}

.otp-panel.is-verified .otp-badge {
  background: #ebf8f0;
  border-color: #b6e2c4;
}

.otp-panel.is-verified .otp-icon {
  color: var(--ok);
  animation: otpPop .35s ease-out;
}

.otp-panel.is-verified .otp-ring {
  animation: otpPulseSuccess 1.1s ease-out 1;
}

.otp-panel.is-error {
  border-color: #f3b4ae;
  background: linear-gradient(180deg, #ffffff 0%, #fff6f5 100%);
}

.otp-panel.is-error .otp-badge {
  background: #fff2f0;
  border-color: #f3b4ae;
}

.otp-panel.is-error .otp-icon {
  color: var(--error);
}

.otp-status {
  min-height: 20px;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
}

@keyframes otpPulse {
  0% { opacity: .55; transform: scale(.92); }
  100% { opacity: 0; transform: scale(1.22); }
}

@keyframes otpPulseSuccess {
  0% { opacity: .4; transform: scale(.9); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes otpBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .65; transform: scale(.92); }
}

@keyframes otpPop {
  0% { transform: scale(.5); }
  72% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@media (max-width: 460px) {
  .otp-header {
    grid-template-columns: 48px 1fr;
  }

  .otp-badge {
    width: 48px;
    height: 48px;
  }

  .otp-icon {
    font-size: 21px;
  }
}
