/* Cabinet auth — modern standalone skin */
.auth-body {
  --auth-bg: #070b14;
  --auth-surface: rgba(255, 255, 255, 0.06);
  --auth-surface-solid: #111827;
  --auth-border: rgba(255, 255, 255, 0.1);
  --auth-text: #f1f5f9;
  --auth-muted: #94a3b8;
  --auth-accent: #6366f1;
  --auth-accent-2: #22d3ee;
  --auth-glow: rgba(99, 102, 241, 0.45);
  --auth-yellow: #fbbf24;
  --auth-radius: 16px;
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--auth-text);
  background: var(--auth-bg);
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(34, 211, 238, 0.12), transparent 50%),
    var(--auth-bg);
  pointer-events: none;
}
.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  max-width: 520px;
  margin: 0 auto;
}
.auth-shell.wide { max-width: 580px; }

.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-text);
}
.auth-logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-2));
  box-shadow: 0 0 16px var(--auth-glow);
}
.auth-tagline { margin: 8px 0 0; font-size: 0.9rem; color: var(--auth-muted); }

.auth-panel {
  width: 100%;
  background: var(--auth-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 28px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}
.auth-panel.flash-wrap { padding-top: 20px; }

.auth-flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid;
}
.auth-flash.error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.auth-flash.success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.auth-flash.info { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); color: #a5b4fc; }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--auth-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-decoration: none;
  transition: color 0.15s;
}
.auth-back:hover { color: var(--auth-text); text-decoration: none; }

.auth-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.auth-lead { margin: 0 0 24px; color: var(--auth-muted); font-size: 0.9rem; line-height: 1.55; }

/* Hub — two action cards */
.auth-hub { display: flex; flex-direction: column; gap: 14px; }
.auth-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--auth-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--auth-text);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}
.auth-action:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  color: var(--auth-text);
}
.auth-action.primary {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.08));
}
.auth-action.primary:hover {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 12px 40px var(--auth-glow);
}
.auth-action-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08);
}
.auth-action.primary .auth-action-icon {
  background: linear-gradient(135deg, var(--auth-accent), #4f46e5);
  box-shadow: 0 4px 16px var(--auth-glow);
}
.auth-action-text strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.auth-action-text span { font-size: 0.82rem; color: var(--auth-muted); }
.auth-action-arrow { margin-left: auto; color: var(--auth-muted); font-size: 1.2rem; }

/* Forms */
.auth-field { margin-bottom: 20px; }
.auth-field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--auth-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.auth-input-wrap { position: relative; max-width: 100%; }
.auth-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 14px 48px 14px 16px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--auth-text);
  font-size: 1.05rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: rgba(148, 163, 184, 0.45); letter-spacing: 0.1em; }
.auth-input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.auth-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; border-radius: 8px;
  background: transparent; color: var(--auth-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.auth-toggle:hover { color: var(--auth-text); background: rgba(255,255,255,0.06); }

.auth-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.875rem; color: var(--auth-muted); cursor: pointer;
}
.auth-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--auth-accent); flex-shrink: 0; }

.auth-submit {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--auth-accent), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 20px var(--auth-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 28px var(--auth-glow); }
.auth-submit:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Register generation animation */
.gen-stage { text-align: center; padding: 12px 0 8px; }
.gen-stage.hidden { display: none; }

.gen-orb {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto 28px;
}
.gen-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--auth-accent-2);
  border-right-color: var(--auth-accent);
  animation: gen-spin 1.2s linear infinite;
}
.gen-ring:nth-child(2) {
  inset: 12px;
  border-top-color: var(--auth-accent);
  border-right-color: transparent;
  animation-duration: 1.8s;
  animation-direction: reverse;
}
.gen-core {
  position: absolute; inset: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(34,211,238,0.15));
  display: flex; align-items: center; justify-content: center;
  animation: gen-pulse 2s ease-in-out infinite;
}
@keyframes gen-spin { to { transform: rotate(360deg); } }
@keyframes gen-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.85; } }

.gen-status {
  font-size: 0.95rem;
  color: var(--auth-text);
  margin-bottom: 16px;
  min-height: 1.4em;
  transition: opacity 0.3s;
}
.gen-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 24px;
}
.gen-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--auth-accent), var(--auth-accent-2));
  transition: width 0.4s ease;
}
.gen-digits {
  display: flex; justify-content: center; gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.05em;
}
.gen-digit-group {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--auth-border);
  min-width: 72px;
  animation: gen-flicker 0.15s infinite alternate;
}
.gen-digit-group.settled { animation: none; border-color: rgba(34,211,238,0.4); color: var(--auth-accent-2); }
@keyframes gen-flicker { from { opacity: 0.7; } to { opacity: 1; } }

.gen-intro .auth-submit { margin-top: 8px; }

/* Account reveal */
.reveal-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 16px;
}
.account-reveal {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  padding: 28px 16px;
  margin: 20px 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.35);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  color: var(--auth-text);
  animation: reveal-in 0.6s ease-out;
}
@keyframes reveal-in {
  from { opacity: 0; transform: scale(0.96); letter-spacing: 0.3em; }
  to { opacity: 1; transform: scale(1); letter-spacing: 0.16em; }
}

.kit-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.kit-btn {
  flex: 1; min-width: 130px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: var(--auth-yellow);
  font-weight: 600; font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.kit-btn:hover { background: rgba(251, 191, 36, 0.22); transform: translateY(-1px); text-decoration: none; color: #fde68a; }

.auth-doc-link {
  margin-top: 22px;
  text-align: center;
  font-size: 0.82rem;
}
.auth-doc-link a {
  color: var(--auth-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.auth-doc-link a:hover {
  color: var(--auth-text);
  border-bottom-color: var(--auth-border);
  text-decoration: none;
}

/* Documentation page */
.auth-doc { display: flex; flex-direction: column; gap: 22px; }
.auth-doc-block h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--auth-text);
}
.auth-doc-block p { margin: 0; color: var(--auth-muted); font-size: 0.9rem; line-height: 1.6; }
.auth-doc-block ul { margin: 0; padding-left: 18px; color: var(--auth-muted); font-size: 0.9rem; line-height: 1.6; }
.auth-doc-block li { margin-bottom: 6px; }
.auth-doc-block strong { color: var(--auth-text); font-weight: 600; }
.auth-doc-sample {
  margin-top: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  color: var(--auth-accent-2);
}
.auth-submit-link {
  display: block;
  margin-top: 26px;
  text-align: center;
  text-decoration: none;
}
.auth-submit-link:hover { text-decoration: none; color: #fff; }

.hidden { display: none !important; }
