:root {
  --bg: #121212;
  --card: #0a0a0a;
  --card-border: #7a6525;
  --input: rgba(0, 0, 0, 0.35);
  --input-focus: rgba(0, 0, 0, 0.5);
  --text: #e8e8e8;
  --muted: rgba(255, 255, 255, 0.62);
  --eye: #d4af37;
  --required: #d4af37;
  --danger: #ff8b96;
  --accent: #d4af37;
  --shadow: 0 0 15px 2px rgba(160, 130, 40, 0.4), 0 0 40px 5px rgba(160, 130, 40, 0.2), inset 0 0 60px rgba(0, 0, 0, 0.5);
  --radius-card: 16px;
  --radius-control: 8px;
}

* {
  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: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(ellipse at center, rgba(90, 18, 18, 0.55), transparent 58%),
    var(--bg);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  gap: 0;
}

.brand {
  width: min(100%, 300px);
  margin: 4px auto 18px;
  line-height: 0;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
}

.form-title {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.card {
  width: min(100%, 440px);
  background: linear-gradient(180deg, #0a0a0a 0%, #1a0a0a 50%, #2d0a0a 100%);
  border: 2px 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 {
  color: var(--accent);
  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: 52px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-control);
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control input::placeholder {
  color: rgba(230, 230, 230, 0.42);
}

.control input:focus {
  background: var(--input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.55);
}

.control input[readonly] {
  color: #e6e6e6;
  background: #101010;
  cursor: default;
  box-shadow: none;
}

.control input[readonly]:focus {
  background: #101010;
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: none;
}

.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, #d4af37 0%, #a08b3a 100%);
  color: #1a1200;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  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 #d4af37;
  outline-offset: 2px;
}

.notice {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.16);
  color: #ffe2cc;
  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: min(100%, 260px);
  }
}

.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(212, 175, 55, 0.7);
  border-radius: var(--radius-control);
  background: transparent;
  color: #d4af37;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.otp-send:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.12);
}

.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: #ffffff;
}

.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(212, 175, 55, 0.45);
  border-radius: 14px;
  background: #101010;
}

.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: linear-gradient(180deg, #d4af37 0%, #a08b3a 100%);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  color: #1a1200;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}
