* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0d1119;
  --panel: #171d2b;
  --panel-2: #111827;
  --border: #2c3548;
  --text: #f7f9ff;
  --muted: #b8c2d8;
  --accent: #78a6ff;
  --good: #4ade80;
  --bad: #ff6b6b;
  --warn: #facc15;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #1a2340, var(--bg) 45%);
  color: var(--text);
}

a {
  color: var(--accent);
}

.container {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.card {
  width: min(760px, 100%);
  background: rgba(23, 29, 43, 0.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #26314a;
  color: #d5e1ff;
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.05;
}

h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: #d8e1f7;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  background: #0c111d;
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120, 166, 255, 0.18);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

button,
.button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  background: #f7f9ff;
  color: #111827;
}

button.secondary,
.button.secondary {
  background: #26314a;
  color: var(--text);
}

button.danger {
  background: #3a1720;
  color: #ffd6d6;
  border: 1px solid #6a2b3a;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notice {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 16px;
  white-space: pre-wrap;
}

.notice.good {
  border-color: rgba(74, 222, 128, 0.5);
  color: #c9f8d8;
}

.notice.bad {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffd6d6;
}

.status-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0f1726;
  color: #d7e1ff;
  border: 1px solid var(--border);
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.75);
}

pre {
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: #080c13;
  color: #d7e1ff;
  min-height: 90px;
}

.small {
  font-size: 13px;
  color: #98a6c2;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.passkey-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.passkey-item {
  padding: 12px;
  border: 1px solid var(--border);
  background: #0f1625;
  border-radius: 14px;
}

/* Login reimaginado: passkey primeiro, senha como fallback. */
.login-page {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(120, 166, 255, 0.24), transparent 31%),
    radial-gradient(circle at 18% 82%, rgba(83, 116, 255, 0.16), transparent 32%),
    linear-gradient(145deg, #070b13 0%, #0d1320 48%, #101827 100%);
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  position: relative;
  isolation: isolate;
  cursor: pointer;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}

.login-shell::before {
  top: -120px;
  right: -90px;
  background: rgba(120, 166, 255, 0.13);
}

.login-shell::after {
  bottom: -160px;
  left: -110px;
  background: rgba(60, 88, 180, 0.18);
}

.login-card {
  width: min(460px, 100%);
  position: relative;
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(154, 180, 255, 0.22);
  border-radius: 34px;
  background:
    linear-gradient(160deg, rgba(19, 27, 44, 0.9), rgba(12, 18, 30, 0.96)),
    rgba(15, 22, 36, 0.92);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  opacity: 0.24;
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.passkey-orb {
  width: clamp(124px, 34vw, 164px);
  height: clamp(124px, 34vw, 164px);
  position: relative;
  display: grid;
  place-items: center;
  margin: 6px auto 28px;
  border: 1px solid rgba(166, 193, 255, 0.34);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.28), transparent 20%),
    linear-gradient(145deg, rgba(120, 166, 255, 0.94), rgba(67, 93, 202, 0.92));
  color: #f9fbff;
  box-shadow:
    0 0 0 12px rgba(120, 166, 255, 0.05),
    0 0 0 24px rgba(120, 166, 255, 0.025),
    0 30px 70px rgba(47, 87, 214, 0.38);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  isolation: isolate;
  cursor: pointer;
}

.passkey-orb:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 0 0 14px rgba(120, 166, 255, 0.07),
    0 0 0 30px rgba(120, 166, 255, 0.03),
    0 34px 86px rgba(47, 87, 214, 0.48);
}

.passkey-orb:focus-visible,
.login-secondary-link:focus-visible {
  outline: 3px solid rgba(120, 166, 255, 0.42);
  outline-offset: 4px;
}

.passkey-orb:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.3);
}

.passkey-orb svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 18px rgba(7, 16, 30, 0.28));
}

.passkey-orb-glow {
  position: absolute;
  inset: 10%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 64%);
  opacity: 0.85;
  animation: passkeyPulse 2.8s ease-in-out infinite;
  z-index: -1;
}

.passkey-orb.is-loading .passkey-orb-glow {
  animation-duration: 800ms;
}

@keyframes passkeyPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 0.95; }
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(120, 166, 255, 0.1);
  color: #d8e4ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 46px);
  letter-spacing: -0.045em;
}

.login-subtitle {
  max-width: 35rem;
  margin: 13px auto 0;
  color: #b7c4dc;
}

.login-fast-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-compact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 22px;
}

.login-secondary-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  justify-self: center;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: #aebbe0;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.login-secondary-link:hover {
  color: #f7f9ff;
  background: rgba(255, 255, 255, 0.06);
}

.login-password-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(154, 180, 255, 0.16);
  border-radius: 24px;
  background: rgba(7, 11, 19, 0.46);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-panel-header {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.login-panel-header strong {
  color: #f7f9ff;
}

.login-panel-header span {
  color: #93a2bf;
  font-size: 13px;
}

.login-password-panel label {
  margin-top: 12px;
}

.login-password-actions {
  margin-top: 16px;
}

.login-password-actions button {
  width: 100%;
}

.login-page .notice {
  margin-top: 18px;
  text-align: left;
  border-color: rgba(154, 180, 255, 0.16);
  background: rgba(8, 12, 22, 0.64);
}

@media (max-width: 520px) {
  .login-shell {
    align-items: center;
    padding: 14px;
  }

  .login-card {
    border-radius: 28px;
  }


  .login-subtitle {
    font-size: 14px;
  }
}
