:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #160017;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #160017;
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

.screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.panel {
  width: min(100%, 390px);
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 10px;
}

[hidden] {
  display: none !important;
}

label {
  font-size: 16px;
  line-height: 1.4;
}

input {
  width: 100%;
  min-height: 56px;
  border: 1px solid #c77dff;
  border-radius: 4px;
  background: #25002b;
  color: #fff;
  padding: 0 16px;
  outline: none;
  font-size: 18px;
}

input:focus {
  border-color: #ff7ad9;
  box-shadow: 0 0 0 3px rgba(255, 122, 217, 0.2);
}

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

.otp-input {
  min-height: 68px;
  padding: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}

button {
  min-height: 56px;
  border: 1px solid #ff7ad9;
  border-radius: 4px;
  background: #ff7ad9;
  color: #210020;
  cursor: pointer;
  font-size: 17px;
  touch-action: manipulation;
}

.secondary {
  background: #25002b;
  color: #fff;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.generated {
  min-height: 62px;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0;
}

.result {
  min-height: 112px;
  display: grid;
  gap: 12px;
  justify-items: center;
  align-content: start;
  text-align: center;
  line-height: 1.4;
  font-size: 17px;
}

.icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}

.valid {
  color: #19c37d;
}

.invalid {
  color: #ff4d4f;
}

footer {
  color: #e6b3ff;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 480px) {
  .screen {
    align-items: start;
    padding-top: max(72px, env(safe-area-inset-top));
  }

  .panel {
    width: 100%;
    gap: 14px;
  }

  .generated {
    font-size: 44px;
  }

  .otp {
    gap: 8px;
  }

  .otp-input {
    min-height: 64px;
    font-size: 28px;
  }
}
