/* ============================================================
   Registro do Compositor — Login V1
   Camada visual isolada. O contrato funcional permanece em
   login.html + auth.js e não depende destas classes.
   ============================================================ */

.login-page {
  --login-bg: #030508;
  --login-surface: #0a101c;
  --login-surface-strong: #0d1627;
  --login-primary: #3b82f6;
  --login-primary-hover: #60a5fa;
  --login-text: #f8fafc;
  --login-muted: #9aa5b5;
  --login-muted-dim: #778294;
  --login-border: rgb(255 255 255 / 0.1);
  --login-border-blue: rgb(59 130 246 / 0.34);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--login-bg);
  color: var(--login-text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow-x: clip;
}

.login-page::before {
  display: none;
}

.login-page main,
.login-page footer {
  position: relative;
  z-index: auto;
}

.login-layout {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 32px 24px 48px;
  overflow: hidden;
  border-top: 1px solid rgb(255 255 255 / 0.05);
  background: #030508;
}

.login-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.15;
  background-image: radial-gradient(circle at center, #fff 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.login-glow-primary {
  top: 50%;
  left: 50%;
  width: 800px;
  height: 600px;
  background: rgb(30 58 138 / 0.2);
  transform: translate(-50%, -50%);
}

.login-glow-secondary {
  display: none;
}

.login-shell {
  display: flex;
  width: min(100%, 448px);
  flex-direction: column;
  align-items: center;
  margin-block: 0;
  margin-inline: auto;
}

.login-brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  margin: 0 auto 28px;
  color: var(--login-text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  text-shadow: 0 10px 15px rgb(0 0 0 / 0.35);
  text-decoration: none;
}

.login-brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgb(59 130 246 / 0.25);
  border-radius: 50%;
  background: rgb(59 130 246 / 0.1);
}

.login-brand-mark svg {
  width: 20px;
  height: 20px;
  stroke: url("#login-fingerprint-gradient");
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-back {
  display: inline-flex;
  align-items: center;
  width: 100%;
  margin: 0 0 24px;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 160ms ease;
}

.login-back:hover {
  color: var(--login-text);
}

.login-card-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 32px;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5), 0 0 50px rgb(59 130 246 / 0.1);
  transition: box-shadow 500ms ease;
}

.login-card-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgb(59 130 246 / 0.1);
  filter: blur(60px);
  pointer-events: none;
  transition: background 700ms ease;
}

.login-card-border {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.login-card-border::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0% 35%, rgb(96 165 250 / 0.6) 50%, transparent 65% 100%);
  filter: blur(2px);
  animation: login-border-spin 6s linear infinite;
}

.login-card-frame:hover {
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5), 0 0 70px rgb(59 130 246 / 0.2);
}

.login-card-frame:hover::before {
  background: rgb(59 130 246 / 0.2);
}

.login-card-frame:hover .login-card-border {
  opacity: 1;
}

.login-card {
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgb(255 255 255 / 0.05);
  border-radius: calc(32px - 1px);
  padding: 32px;
  background: rgb(10 16 28 / 0.84);
  box-shadow: inset 0 0 30px rgb(255 255 255 / 0.03);
}

@supports (backdrop-filter: blur(18px)) {
  .login-card {
    background: rgb(10 16 28 / 0.6);
    backdrop-filter: blur(64px);
    -webkit-backdrop-filter: blur(64px);
  }
}

.login-card-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgb(59 130 246 / 0.5), transparent);
  pointer-events: none;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  border: 1px solid rgb(59 130 246 / 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgb(59 130 246 / 0.1);
  color: #60a5fa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.login-eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--login-primary);
  box-shadow: 0 0 8px rgb(59 130 246 / 0.8);
}

.login-card h1 {
  margin: 0 0 12px;
  color: var(--login-text);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.login-code-input {
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-size: 28px !important;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
}

.login-confirm-link {
  display: block;
  margin: -2px 0 18px;
  border: 1px solid rgb(96 165 250 / 0.35);
  border-radius: 12px;
  padding: 11px 14px;
  background: rgb(59 130 246 / 0.1);
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.login-lead {
  margin: 0 0 32px;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.65;
}

.login-page .alert {
  margin: 0 0 20px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field label {
  padding-left: 4px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.login-field label span {
  color: #6b7280;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-text-button {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.login-text-button:hover { color: #93c5fd; text-decoration: underline; }
.login-text-button:disabled { color: #6b7280; cursor: wait; }

.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 82px; }

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  border: 0;
  padding: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-password-toggle:hover { color: #fff; }

.login-alternative-note {
  margin: -8px 0 0;
  color: #778294;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.login-form.hidden,
.login-support.hidden { display: none; }

.login-field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--login-border);
  border-radius: 12px;
  outline: none;
  padding: 14px 16px;
  background: rgb(0 0 0 / 0.4);
  color: var(--login-text);
  caret-color: var(--login-primary-hover);
  font: 500 15px/1.3 "Inter", ui-sans-serif, system-ui, sans-serif;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-field input::placeholder {
  color: #4b5563;
  font-weight: 400;
}

.login-field input:hover {
  border-color: rgb(255 255 255 / 0.17);
}

.login-field input:focus {
  border-color: rgb(59 130 246 / 0.5);
  box-shadow: 0 0 0 1px rgb(59 130 246 / 0.5);
}

.login-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 16px 18px;
  font: 700 14px/1.2 "Inter", ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.login-button-primary {
  margin-top: 8px;
  border: 0;
  background: var(--login-primary);
  color: #fff;
  box-shadow: 0 0 20px rgb(59 130 246 / 0.4);
}

.login-button-primary:hover {
  background: var(--login-primary-hover);
  box-shadow: 0 0 30px rgb(59 130 246 / 0.6);
}

.login-button-secondary {
  border: 1px solid var(--login-border);
  background: transparent;
  color: #fff;
  font-weight: 500;
}

.login-button-secondary:hover {
  border-color: rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.065);
}

.login-button:active {
  transform: scale(0.98);
}

.login-button:focus-visible,
.login-back:focus-visible,
.login-brand:focus-visible,
.login-text-button:focus-visible,
.login-password-toggle:focus-visible,
.login-support a:focus-visible {
  outline: 3px solid rgb(96 165 250 / 0.62);
  outline-offset: 3px;
}

.login-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  color: #4b5563;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: rgb(255 255 255 / 0.05);
}

.login-support {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  text-align: center;
}

.login-support p {
  margin: 0;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.55;
}

.login-support a {
  color: #60a5fa;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 3px;
}

.login-support a:hover {
  color: #93c5fd;
}

.login-footer {
  position: static !important;
  width: max-content;
  max-width: calc(100% - 32px);
  margin-top: 28px;
  color: rgb(255 255 255 / 0.4);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

@keyframes login-border-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (min-width: 768px) {
  .login-layout { padding-block: 48px 64px; }
  .login-card { padding: 40px; }
  .login-card h1 { font-size: 30px; }
}

@media (max-width: 520px) {
  .login-layout {
    padding-inline: 24px;
  }

  .login-card-frame,
  .login-card {
    border-radius: 32px;
  }

  .login-card {
    padding: 32px;
  }
}

@media (max-width: 380px) {
  .login-layout {
    padding-inline: 20px;
  }

  .login-card {
    padding-inline: 24px;
  }

  .login-brand { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card-border::before { animation: none; }

  .login-back,
  .login-button,
  .login-field input {
    transition: none;
  }
}
