:root {
  --bg: #222d4b;
  --card: #1b253e;
  --card-border: rgba(186, 206, 232, 0.16);
  --input: #2b3a59;
  --input-focus: #33466c;
  --text: #ffffff;
  --muted: #c5d0e4;
  --eye: #c5d0e2;
  --required: #d16b78;
  --danger: #ff8b96;
  --shadow: 0 24px 50px rgba(8, 12, 24, 0.45);
  --radius-card: 18px;
  --radius-control: 10px;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 56px;
  gap: 42px;
}

.brand {
  width: 196px;
  line-height: 0;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
}

.card {
  width: min(100%, 440px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 28px 26px 26px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field[hidden] {
  display: none;
}

.field label {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.req {
  color: var(--required);
  margin-left: 2px;
}

.control {
  position: relative;
}

.control input {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 0 16px;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.control input::placeholder {
  color: rgba(197, 208, 226, 0.45);
}

.control input:focus {
  background: var(--input-focus);
  box-shadow: inset 0 0 0 1px rgba(126, 168, 255, 0.45);
}

.control input[readonly] {
  color: #d5e2f7;
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(186, 206, 232, 0.18);
}

.control input[readonly]:focus {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(186, 206, 232, 0.18);
}

.has-toggle input {
  padding-right: 48px;
}

.toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--eye);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.toggle:hover,
.toggle:focus-visible {
  color: #ffffff;
  outline: none;
}

.toggle .eye-off {
  display: none;
}

.toggle.is-visible .eye-on {
  display: none;
}

.toggle.is-visible .eye-off {
  display: block;
}

.error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.3;
}

.error:empty {
  display: none;
}

.submit {
  margin-top: 6px;
  height: 52px;
  border: 0;
  border-radius: var(--radius-control);
  background: linear-gradient(180deg, #75a0f3 0%, #5076e0 100%);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(62, 112, 230, 0.28);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.submit:hover {
  filter: brightness(1.06);
}

.submit:active {
  transform: translateY(1px);
}

.submit:focus-visible {
  outline: 2px solid #d7e6ff;
  outline-offset: 2px;
}

.notice {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(79, 130, 243, 0.16);
  color: #d7e6ff;
  font-size: 14px;
  line-height: 1.45;
}

.notice.is-visible {
  display: block;
}

@media (max-width: 520px) {
  .page {
    justify-content: flex-start;
    padding-top: 36px;
    gap: 28px;
  }

  .card {
    padding: 22px 18px 20px;
  }

  .brand {
    width: 142px;
  }
}

.notice.is-error {
  background: rgba(209, 107, 120, 0.18);
  color: #ffd5da;
}

.submit:disabled,
.otp-send:disabled {
  opacity: 0.7;
  cursor: wait;
}

.otp-send {
  margin-top: 8px;
  height: 46px;
  width: 100%;
  border: 1px solid rgba(126, 168, 255, 0.45);
  border-radius: var(--radius-control);
  background: transparent;
  color: #d7e6ff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.otp-send:hover:not(:disabled) {
  background: rgba(80, 118, 224, 0.16);
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step[hidden] {
  display: none;
}

.otp-timer {
  margin: 2px 0 4px;
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: #d7e6ff;
}

.otp-timer.is-expired {
  color: var(--danger);
}

.otp-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 2px;
}

.otp-back:hover {
  color: #ffffff;
}

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 36px;
  padding-bottom: 34px;
}

.success-mark {
  color: #3dcc7a;
  line-height: 0;
}

.success h1 {
  margin: 4px 0 0;
  max-width: 16ch;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.success-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 16px 14px 12px;
  border: 1px solid rgba(186, 206, 232, 0.28);
  border-radius: 14px;
  background: rgba(43, 58, 89, 0.45);
}

.success-login-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.success-login-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.success-login-name strong {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1;
}

.success-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  cursor: pointer;
}

.success-copy:hover {
  background: var(--input-focus);
}

.success-copy.is-copied {
  color: #3dcc7a;
  border-color: rgba(61, 204, 122, 0.5);
}

.success-login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.success-copy-note {
  margin: 0;
  color: #3dcc7a;
  font-size: 13px;
  font-weight: 650;
}

.success-copy-note:empty {
  display: none;
}

.success-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: #3d74e0;
  box-shadow: 0 8px 18px rgba(41, 86, 184, 0.35);
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}
