*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #111626;
  color: #f0ece3;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.card {
  background: #1a2035;
  border: 1px solid #2a3455;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 380px;
}

.logo { width: 180px; height: auto; margin-bottom: 0.5rem; }

h1 { font-size: 1.2rem; color: #f0ece3; text-align: center; font-weight: 600; }
p.subtitle { font-size: 0.85rem; color: #9aa3b8; text-align: center; }

.form { width: 100%; display: flex; flex-direction: column; gap: 1rem; }

label { font-size: 0.8rem; color: #9aa3b8; margin-bottom: 0.25rem; display: block; }

input[type="password"], input[type="text"], input[type="email"] {
  width: 100%; padding: 0.625rem 0.875rem; font-size: 0.95rem;
  background: #111626; border: 1px solid #2a3455; border-radius: 8px;
  color: #f0ece3; outline: none; transition: border-color 0.15s;
}
input:focus { border-color: #fbb040; }
input[readonly] { opacity: 0.6; cursor: not-allowed; }

.btn {
  margin-top: 0.25rem; padding: 0.75rem; border: none; border-radius: 9999px;
  background: linear-gradient(135deg, #fbb040, #d0a153); color: #111626;
  font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: box-shadow 0.2s;
  width: 100%;
}
.btn:hover { box-shadow: 0 0 24px rgba(251,176,64,0.35); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Legal consent row (registration): checkbox + inline links to the web app */
.consent {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.8rem; color: #9aa3b8; margin-bottom: 0; cursor: pointer;
}
.consent input[type="checkbox"] {
  width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.1rem;
  accent-color: #fbb040; cursor: pointer;
}
.consent a { color: #fbb040; text-decoration: underline; }
.consent a:hover { opacity: 0.8; }

/* Inline pending spinner (used by submitJson while a request is in flight) */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.btn .spinner { margin-right: 0.5em; }
.btn.is-loading { cursor: wait; }
.btn-ghost {
  background: transparent; border: 1px solid #2a3455; color: #9aa3b8;
  padding: 0.6rem; border-radius: 9999px; font-size: 0.85rem;
  cursor: pointer; width: 100%; transition: border-color 0.15s;
}
.btn-ghost:hover { border-color: #fbb040; color: #fbb040; }

.otp-inputs { display: flex; gap: 0.5rem; justify-content: center; }
.otp-inputs input {
  width: 42px; height: 50px; text-align: center; font-size: 1.2rem;
  font-weight: 700; padding: 0; border-radius: 8px;
}

.countdown { font-size: 0.8rem; color: #9aa3b8; text-align: center; }
.countdown .time { color: #fbb040; font-weight: 600; }

.error-msg { font-size: 0.8rem; color: #f87171; text-align: center; padding: 0.5rem; }
.success-msg { font-size: 0.8rem; color: #4ade80; text-align: center; padding: 0.5rem; }

.divider { width: 100%; border: none; border-top: 1px solid #2a3455; }

.link-btn {
  background: none; border: none; color: #9aa3b8; font-size: 0.8rem;
  cursor: pointer; text-decoration: underline; padding: 0;
}
.link-btn:hover { color: #fbb040; }

.btn-link {
  display: block; margin-top: 0.75rem; background: none; border: none;
  color: #fbb040; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: opacity 0.15s;
}
.btn-link:hover { opacity: 0.75; }

.method-card {
  width: 100%; padding: 1rem; border: 1px solid #2a3455; border-radius: 10px;
  background: #111626; cursor: pointer; text-align: left; color: #f0ece3;
  transition: border-color 0.15s;
}
.method-card:hover { border-color: #fbb040; }
.method-card .title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.method-card .desc { font-size: 0.8rem; color: #9aa3b8; }

.qr-container { text-align: center; }
.qr-container img { border-radius: 8px; background: white; padding: 8px; }

.recovery-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  width: 100%; padding: 1rem; background: #111626;
  border: 1px solid #2a3455; border-radius: 8px;
}
.recovery-codes code {
  font-family: monospace; font-size: 0.9rem; color: #fbb040;
  text-align: center; padding: 0.25rem;
}
