/*
 * Tela de autenticação do IdP.
 *
 * Porte da tela de login do Hub de Valor, para que entrar na plataforma e
 * entrar no IdP sejam visualmente a mesma coisa. Os valores vêm dos tokens do
 * front (globals.css, escopo `dark`) e da paleta `graphite` do Tailwind —
 * copiados, não importados: o IdP não tem build de CSS e não deve depender do
 * pipeline do front para renderizar a própria tela.
 *
 * Sem JavaScript, por construção: a CSP destas páginas é `default-src 'none'`
 * sem `script-src`. Por isso não há revelar-senha nem animação de biblioteca —
 * o movimento é `@keyframes`, e os ícones são SVG inline (marcação, não `img`,
 * então passam por `img-src` sem precisar de arquivo).
 */

:root {
  --graphite-950: #080a0f;
  --graphite-900: #0d1118;

  --card: hsl(222 40% 11% / 0.8);
  --card-foreground: hsl(210 40% 98%);
  --border: hsl(217 25% 18%);
  --input: hsl(217 25% 16%);
  --muted: hsl(217 33% 15%);
  --muted-foreground: hsl(215 20% 65%);
  --primary: hsl(199 100% 44%);
  --primary-foreground: hsl(222 47% 8%);

  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --cyan-100: #cffafe;
  --cyan-200: #a5f3fc;

  --destructive: hsl(0 63% 45%);
  --danger-bg: hsl(0 63% 31% / 0.25);
  --danger-border: hsl(0 63% 45% / 0.4);
  --danger-text: #fecaca;

  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--graphite-950);
  color: #fff;
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* As duas luzes de fundo do layout de auth do front. */
.auth {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 34%),
    radial-gradient(circle at 76% 12%, rgba(34, 211, 238, 0.12), transparent 30%);
}

.auth__grid {
  position: relative;
  display: grid;
  min-height: 100dvh;
}

@media (min-width: 1024px) {
  .auth__grid { grid-template-columns: 1.12fr 0.88fr; }
}

/* ── Hero ──────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 24px;
}

@media (min-width: 640px) { .hero { padding-inline: 40px; } }
@media (min-width: 1024px) { .hero { padding-inline: 56px; min-height: 54vh; } }

.hero__logo { display: flex; align-items: center; gap: 12px; }
.hero__logo img { height: 32px; width: auto; display: block; }

.hero__body {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-block: 56px;
  animation: rise 0.65s ease-out both;
}

@media (min-width: 1024px) { .hero__body { padding-block: 80px; } }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(165, 243, 252, 0.2);
  background: rgba(165, 243, 252, 0.1);
  color: var(--cyan-100);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
}

.hero h1 {
  margin: 32px 0 0;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 24px 0 0;
  max-width: 42rem;
  font-size: 18px;
  line-height: 2rem;
  color: var(--slate-300);
}

.nodes {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

@media (min-width: 640px) { .nodes { grid-template-columns: repeat(3, 1fr); } }

.node {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  border-radius: var(--radius);
  padding: 16px;
  animation: rise 0.55s ease-out both;
}

.node:nth-child(2) { animation-delay: 0.12s; }
.node:nth-child(3) { animation-delay: 0.24s; }

.node svg { color: var(--cyan-200); }
.node__name { margin: 16px 0 0; font-size: 14px; font-weight: 500; }
.node__meta { margin: 4px 0 0; font-size: 12px; color: var(--slate-500); }

.sources {
  margin-top: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  padding: 20px;
}

.sources__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) { .sources__grid { grid-template-columns: repeat(6, 1fr); } }

.chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--slate-300);
}

/* ── Painel do formulário ──────────────────────────────────────── */

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 17, 24, 0.75);
  backdrop-filter: blur(16px);
}

@media (min-width: 1024px) {
  .panel { border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.1); }
}

.card {
  width: 100%;
  max-width: 28rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: slide-in 0.55s ease-out both;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card__title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.card__desc { margin: 6px 0 0; font-size: 14px; color: var(--muted-foreground); }

.card__badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: var(--radius);
  color: var(--primary);
}

form { display: grid; gap: 20px; margin-top: 24px; }

.field { display: grid; gap: 8px; }

.field label { font-size: 14px; font-weight: 500; }
.field .req { color: var(--destructive); }

.control { position: relative; display: flex; align-items: center; }

.control svg {
  position: absolute;
  left: 14px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.control input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--card-foreground);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
}

.control input::placeholder { color: var(--muted-foreground); }

.control input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

button[type="submit"]:hover { filter: brightness(1.08); }
button[type="submit"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/*
 * Variante sem hero, para a troca de senha autenticada.
 *
 * Quem chega ali já está dentro e no meio de uma tarefa; a coluna de
 * apresentação da marca seria propaganda fora de hora. Mesmo fundo, mesmo
 * card — só o discurso de venda sai.
 */
.auth--solo .auth__grid { grid-template-columns: 1fr; place-items: center; }
.auth--solo .panel { border: 0; background: none; backdrop-filter: none; width: 100%; }

.auth--solo .solo-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth--solo .solo-brand img { height: 30px; width: auto; display: block; }

.card__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.message {
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted-foreground);
}

.hint {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.alert,
.notice {
  margin-top: 20px;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
}

.alert {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.notice {
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}

.foot {
  margin: 24px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.9;
}

.foot a { color: var(--primary); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .issuer { color: var(--slate-500); font-size: 12px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}

/* Respeita quem pediu menos movimento — a entrada é decorativa. */
@media (prefers-reduced-motion: reduce) {
  .hero__body, .node, .card { animation: none; }
}
