/* Telas de acesso (login, vínculo com o E//even).
   Mesma identidade do oxente-idp: ciano #00AFEF, preto e branco.
   Texto sobre o ciano é PRETO (branco sobre #00AFEF não atinge contraste AA). */

:root {
  --brand: #00afef;
  --brand-hover: #0099d4;
  --brand-ink: #000000;
  --brand-soft: rgba(0, 175, 239, 0.22);
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f6;
  --text: #0a0a0a;
  --muted: #5b6470;
  --border: #e4e7eb;
  --border-strong: #cfd5dc;
  --link: #0079a6;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --success: #067647;
  --success-bg: #ecfdf3;
  --success-border: #abefc6;
  --warning: #93370d;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0f0f10;
    --surface-2: #18181a;
    --text: #f5f5f5;
    --muted: #a1a1aa;
    --border: #232326;
    --border-strong: #3a3a3f;
    --brand-soft: rgba(0, 175, 239, 0.3);
    --link: #33c3f5;
    --danger: #fda29b;
    --danger-bg: rgba(122, 39, 26, 0.35);
    --danger-border: rgba(240, 68, 56, 0.35);
    --success: #75e0a7;
    --success-bg: rgba(6, 118, 71, 0.25);
    --success-border: rgba(23, 178, 106, 0.35);
    --warning: #fec84b;
  }
}

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

body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.auth-body a { color: var(--link); text-decoration: none; }
.auth-body a:hover { text-decoration: underline; }
/* :where() zera a especificidade para as classes abaixo poderem mudar a margem */
:where(.auth-body) p { margin: 0 0 12px; }
.auth-body img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
   Layout: painel da marca + painel do formulário
   --------------------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 48px;
  color: #fff;
  background: #000;
}

/* Chevrons ciano inspirados no "X" do logo, no canto inferior direito.
   A ponta aponta para dentro do painel: apontando para fora, o overflow cortaria tudo. */
.auth__brand::before,
.auth__brand::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transform: rotate(45deg);
}
.auth__brand::before {
  width: 360px;
  height: 360px;
  right: -190px;
  bottom: -70px;
  border: 46px solid var(--brand);
  border-top-color: transparent;
  border-right-color: transparent;
  opacity: 0.9;
}
.auth__brand::after {
  width: 520px;
  height: 520px;
  right: -300px;
  bottom: -150px;
  border: 10px solid var(--brand);
  border-top-color: transparent;
  border-right-color: transparent;
  opacity: 0.55;
}
.auth__brand > * { position: relative; z-index: 1; }

.auth__brand-logo img { height: 38px; width: auto; display: block; }

.auth__pitch h2 {
  font-size: 2.2rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  max-width: 19ch;
}
.auth__pitch h2 em { font-style: normal; color: var(--brand); }
.auth__pitch p { color: rgba(255, 255, 255, 0.78); max-width: 42ch; font-size: 1.05rem; }

.auth__features {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 14px;
}
.auth__features li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.92); }
.auth__features svg { width: 20px; height: 20px; flex: none; color: var(--brand); }

.auth__powered {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}
.auth__powered img { height: 20px; width: auto; display: block; }

.auth__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth__panel { width: 100%; max-width: 400px; }

.auth__mobile-logo { display: none; }
.auth__mobile-logo img { height: 32px; width: auto; display: block; }

.auth__header { margin-bottom: 28px; }
.auth__header h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.auth__header p { color: var(--muted); margin: 0; }

.auth__help {
  margin-top: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Celular e tablet: uma coluna, logo compacto no topo. */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__main { align-items: flex-start; padding: 40px 16px; }
  .auth__mobile-logo { display: flex; margin-bottom: 32px; }
}

/* ---------------------------------------------------------------------------
   Entrar com E//even (caminho principal)
   --------------------------------------------------------------------------- */

.auth-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-ink) !important;
  font-weight: 700;
  font-size: 1.06rem;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(0, 175, 239, 0.28);
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.auth-sso:hover { background: var(--brand-hover); box-shadow: 0 10px 28px rgba(0, 175, 239, 0.36); }
.auth-sso:active { transform: translateY(1px); }
.auth-sso:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.auth-sso img { height: 21px; width: auto; display: block; }
.auth-sso[aria-busy="true"] { pointer-events: none; opacity: 0.85; }

.auth-sso__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-note {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.875rem;
}
.auth-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--link); }

/* ---------------------------------------------------------------------------
   Login com usuário e senha (alternativa, recolhida)
   --------------------------------------------------------------------------- */

.auth-alt { margin-top: 28px; }

.auth-alt > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.auth-alt > summary::-webkit-details-marker { display: none; }
.auth-alt > summary::before,
.auth-alt > summary::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.auth-alt > summary span { display: inline-flex; align-items: center; gap: 6px; }
.auth-alt > summary svg { width: 16px; height: 16px; transition: transform 0.15s; }
.auth-alt[open] > summary svg { transform: rotate(180deg); }
.auth-alt > summary:hover span { color: var(--text); }
.auth-alt > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }

.auth-alt__body { padding-top: 20px; }
.auth-alt__note { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }

/* ---------------------------------------------------------------------------
   Campos e botões
   --------------------------------------------------------------------------- */

.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 6px;
}

.auth-field__control { position: relative; }

.auth-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field__control--toggle input { padding-right: 48px; }
.auth-field input::placeholder { color: var(--muted); opacity: 0.7; }
.auth-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.auth-field--error input { border-color: var(--danger); }

.auth-field__error { margin: 6px 0 0; color: var(--danger); font-size: 0.85rem; }
.auth-field__hint { margin: 6px 0 0; font-size: 0.825rem; color: var(--warning); }

.auth-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.auth-toggle:hover { background: var(--surface-2); color: var(--text); }
.auth-toggle:focus-visible { outline: 2px solid var(--brand); }
.auth-toggle svg { width: 20px; height: 20px; }
.auth-toggle .icon-hide { display: none; }
.auth-toggle[aria-pressed="true"] .icon-show { display: none; }
.auth-toggle[aria-pressed="true"] .icon-hide { display: block; }

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.auth-btn:hover { background: var(--surface-2); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.auth-btn[disabled] { opacity: 0.7; cursor: progress; }

.auth-btn--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.auth-btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: var(--brand-ink);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
.auth-btn:not(.auth-btn--primary) .auth-spinner { border-color: var(--border-strong); border-top-color: var(--text); }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Mensagens
   --------------------------------------------------------------------------- */

.auth-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.925rem;
}
.auth-alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.auth-alert--success { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }

/* Quem é a pessoa que acabou de entrar no E//even (tela de vínculo) */
.auth-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.auth-identity__avatar {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
}
.auth-identity__name { font-weight: 700; line-height: 1.25; }
.auth-identity__meta { color: var(--muted); font-size: 0.85rem; }

.auth-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-steps li { display: flex; gap: 10px; align-items: flex-start; }
.auth-steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation-duration: 2s; }
  .auth-body * { transition: none !important; }
}
