:root {
  --bg: #0b1224;
  --bg-soft: #0f172a;
  --card: #0f172a;
  --ink: #ffffff;
  --muted: #e5e7eb;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --accent-ink: #0e7490;
  --danger: #ef4444;
  --green: #34d399;
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(40% 40% at 15% 20%, rgba(34, 211, 238, 0.14), transparent),
              radial-gradient(35% 35% at 80% 15%, rgba(59, 130, 246, 0.16), transparent),
              radial-gradient(45% 50% at 50% 85%, rgba(52, 211, 153, 0.12), transparent),
              var(--bg);
  font-family: var(--font);
  color: var(--ink);
}

.page-bg { display: none; }

.frame {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 18px 56px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  border: 1px solid var(--border);
}

.card__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.logo-wrap {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1f2937, #0b1224);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-fallback {
  display: none;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1.6rem;
}

.card__header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0;
  color: var(--ink);
}

.muted {
  color: var(--muted);
  margin: 0;
}

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  margin-bottom: 24px;
}

.alert__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.alert__title {
  margin: 0 0 6px;
  font-weight: 700;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
  color: #ffffff;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step__title {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #111827;
  padding: 12px 12px;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}

.input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #ffffff;
}

.input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.input-wrap input:disabled {
  color: rgba(255, 255, 255, 0.45);
}

.input-wrap:has(input:disabled) {
  opacity: 0.6;
}

.chip {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  transition: transform 120ms ease, box-shadow 180ms ease, filter 120ms ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.25);
}

.btn-danger {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.otp-wrap input {
  width: 100%;
  letter-spacing: 8px;
  text-align: center;
  font-size: 1.15rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 14px 12px;
  background: #0b1224;
  color: #ffffff;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 0.95rem;
}

.consent input {
  margin-top: 3px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.link-muted {
  text-align: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.status {
  min-height: 1.4em;
  font-weight: 600;
  color: var(--muted);
}

.status.success { color: var(--green); }
.status.error { color: var(--danger); }
.status.info { color: #2563eb; }

.footer-note {
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
  margin-top: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-left-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .card { padding: 24px; }
  .input-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
