@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html, body, #root {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: #0d0d0f;
  color: #fff;
}

/* ── Page background ─────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #0a0a0c;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(88,101,242,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 110%, rgba(88,101,242,0.08) 0%, transparent 60%);
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: #111214;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 0 1px rgba(88,101,242,0.08), 0 24px 60px rgba(0,0,0,0.55);
  animation: popIn 0.35s cubic-bezier(0.16,1,0.3,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Card icon ────────────────────────────────────────────────── */
.card-icon {
  width: 56px;
  height: 56px;
  background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.55;
}

/* ── Form (left-align fields within card) ─────────────────────── */
form {
  width: 100%;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input {
  background: #1a1b1e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 0.72rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #4b5563; }
.input:focus { border-color: #5865f2; box-shadow: 0 0 0 3px rgba(88,101,242,0.15); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important; }

/* ── Password ─────────────────────────────────────────────────── */
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 2.75rem; }

.pass-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}
.pass-toggle:hover { color: #9ca3af; border-color: transparent; }

/* ── Error ────────────────────────────────────────────────────── */
.error-text { font-size: 0.82rem; color: #f87171; }

/* ── Status bar ───────────────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(88,101,242,0.07);
  border: 1px solid rgba(88,101,242,0.18);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  color: #818cf8;
  margin-bottom: 1rem;
  animation: fadeIn 0.2s ease;
}

.fp-inline {
  margin-left: auto;
  font-family: monospace;
  font-size: 0.72rem;
  color: #4ade80;
}

/* ── Fingerprint chip ─────────────────────────────────────────── */
.fp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.18);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.73rem;
  font-family: monospace;
  color: #4ade80;
  margin-bottom: 1rem;
}

.fp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

/* ── Token box ────────────────────────────────────────────────── */
.token-box {
  width: 100%;
  background: #0c0d0f;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: #d1d5db;
  word-break: break-all;
  line-height: 1.6;
  max-height: 110px;
  overflow-y: auto;
  text-align: left;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-shadow: 0 4px 14px rgba(88,101,242,0.3);
}
.btn-primary:hover:not(:disabled) { background: #4752c4; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  width: 100%;
  background: transparent;
  color: #6b7280;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 0.7rem;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: #d1d5db; border-color: transparent; }

/* ── Timer bar ────────────────────────────────────────────────── */
.timer-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(88,101,242,0.08);
  border: 1px solid rgba(88,101,242,0.2);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  color: #818cf8;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.timer-bar strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-urgent {
  background: rgba(251,191,36,0.08) !important;
  border-color: rgba(251,191,36,0.3) !important;
  color: #fbbf24 !important;
  animation: urgentPulse 0.8s ease infinite;
}
.timer-dead {
  background: rgba(239,68,68,0.08) !important;
  border-color: rgba(239,68,68,0.25) !important;
  color: #f87171 !important;
  justify-content: center;
  gap: 0.4rem;
}
.link-btn {
  background: none; border: none; color: #818cf8;
  cursor: pointer; font-size: inherit; padding: 0;
  text-decoration: underline;
}

/* ── Spinner ──────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block; flex-shrink: 0;
}
.spinner.sm {
  width: 13px; height: 13px;
  border-color: rgba(129,140,248,0.3);
  border-top-color: #818cf8;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes pulse  { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }
@keyframes popIn  { from{opacity:0;transform:scale(.95) translateY(10px)} to{opacity:1;transform:none} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes urgentPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
