/* ============================================================
   AFP Brasil Gestao - Sistema de design do portal
   Marca AFP: Navy #002B49, CTP Blue #0070C0, FPAC Orange #E8501A
   Tipografia: Inter + IBM Plex Mono. Motivo "/".
   ============================================================ */

:root {
  --navy: #002B49;
  --navy-800: #012540;
  --navy-700: #013a61;
  --navy-600: #0a4d7a;
  --ctp: #0070C0;
  --fpac: #E8501A;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --title: #002B49;
  --text: #3d4a55;
  --muted: #5f6b76;
  --line: rgba(0, 43, 73, 0.10);
  --line-strong: rgba(0, 43, 73, 0.18);
  --danger: #C0392B;
  --danger-bg: #fbeceb;
  --ok: #1b7a3d;
  --shadow-sm: 0 1px 2px rgba(0, 43, 73, 0.06), 0 1px 3px rgba(0, 43, 73, 0.05);
  --shadow-md: 0 8px 26px rgba(0, 43, 73, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

/* o atributo hidden deve sempre esconder, mesmo com display:flex nas classes */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* Foco acessivel e consistente */
:where(a, button, input):focus-visible {
  outline: 3px solid var(--ctp);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===================== TELA DE LOGIN ===================== */

.auth {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* Painel da marca (esquerda) */
.auth__brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--navy-700), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-800) 100%);
  color: #fff;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth__brand-mark {
  position: absolute;
  right: -6%;
  bottom: -14%;
  font-family: var(--mono);
  font-weight: 500;
  font-size: min(62vh, 640px);
  line-height: 1;
  color: #fff;
  opacity: 0.05;
  user-select: none;
  pointer-events: none;
}

.auth__logo {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  height: 130px;
  width: auto;
}

.auth__brand-copy { position: relative; z-index: 1; max-width: 30ch; }
.auth__eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  margin: 0 0 18px;
}
.auth__headline {
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.auth__subhead {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.76);
  margin: 0;
}

/* Painel do formulario (direita) */
.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
  background: var(--surface);
}

.auth__form { width: 100%; max-width: 380px; }

.auth__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--title);
  margin: 0 0 6px;
}
.auth__hint { font-size: 15px; color: var(--muted); margin: 0 0 28px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--title);
  letter-spacing: 0.01em;
}
.field input {
  font-family: var(--font);
  font-size: 15px;
  color: var(--title);
  padding: 13px 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input::placeholder { color: #6b7784; }
.field input:hover { border-color: var(--navy-600); }
.field input:focus { outline: none; border-color: var(--ctp); box-shadow: 0 0 0 4px rgba(0, 112, 192, 0.14); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.btn-primary {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  padding: 14px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--navy);
  cursor: pointer;
  transition: transform 0.14s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-primary:hover { background: var(--navy-700); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.form-error {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(192, 57, 43, 0.22);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-top: 18px;
}
.form-error:focus { outline: none; }
.form-error svg { flex: none; }

.auth__foot {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.58);
  margin: 0;
}

/* ===================== PORTAL (HOME) ===================== */

.app { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__logo { height: 34px; width: auto; display: block; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.topbar__hi { font-size: 11px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.topbar__name { font-size: 14px; font-weight: 600; color: var(--title); }
.btn-ghost {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--title);
  background: transparent;
  border: 1.5px solid var(--line-strong);
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.btn-ghost:hover { border-color: var(--navy); background: rgba(0, 43, 73, 0.04); }

.main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 48px); }

.hero { margin-bottom: clamp(28px, 4vw, 44px); }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.hero__eyebrow::before { content: "/"; color: var(--ctp); font-weight: 700; }
.hero__title {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--title);
  margin: 0 0 10px;
}
.hero__sub { font-size: 16px; color: var(--muted); margin: 0; max-width: 52ch; }

/* Grade de modulos */
.modules {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
  --accent: var(--navy);
}
.module::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
}
.module__watermark {
  position: absolute;
  right: -18px;
  bottom: -44px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 170px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
}
.module__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: var(--accent);
}
.module__icon svg { width: 26px; height: 26px; }
.module__title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--title); margin: 0; }
.module__desc { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0; flex: 1; }
.module__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.module__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.module__cta svg { transition: transform 0.2s var(--ease); }

.badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge--active {
  color: var(--title);
  background: rgba(0, 43, 73, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.badge--active::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
}
.badge--soon { color: #55606b; background: rgba(0, 43, 73, 0.06); }

/* Modulo ativo (clicavel) */
.module--active { cursor: pointer; }
.module--active:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.module--active:hover .module__cta { color: var(--navy-700); }
.module--active:hover .module__cta svg { transform: translateX(4px); }
.module--active:active { transform: translateY(-1px); transition-duration: 0.08s; }

/* Modulo em breve */
.module--soon { cursor: default; background: #FBFBFC; }
.module--soon::before { opacity: 0.35; }
.module--soon .module__icon { filter: grayscale(0.35); }

.footer {
  text-align: center;
  padding: 28px 20px 34px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.footer span { font-family: var(--mono); letter-spacing: 0.03em; }

/* ===================== RESPONSIVO ===================== */

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand {
    padding: 18px 24px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: unset;
  }
  .auth__brand-copy, .auth__foot { display: none; }
  .auth__brand-mark { font-size: 220px; right: -4%; bottom: -70px; }
  .auth__logo { height: 88px; }
  .auth__panel { padding: 40px 24px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
