/* ============================================================================
 * Gugio — Identidade Visual Definitiva das Telas de Autenticação
 * Reconstrução fiel em HTML/CSS puro:
 * - Canvas azul-marinho escuro (#07131E / #0F1E2D) com efeitos luminosos verdes
 * - Logotipo oficial gugio. + pill Inteligência Empresarial
 * - Título "Entenda hoje o resultado de amanhã." com "amanhã." em verde
 * - Dashboard em perspectiva 3D + 3 cards flutuantes translúcidos animados
 * - Card de formulário branco flutuante com bordas arredondadas
 * Zero inline styles (compatível com CSP style-src 'self').
 * ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }

body {
  font-family: var(--gugio-font);
  background: #06121C;
  color: var(--gugio-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.num { font-variant-numeric: tabular-nums; }

/* ============================================================================
 * Palco Principal — Fundo Azul-Marinho com Luminosidade Verde
 * ============================================================================ */
.auth-stage {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(680px 460px at 56% -4%, rgba(0, 223, 145, 0.24), transparent 62%),
    radial-gradient(540px 380px at 26% 78%, rgba(0, 189, 126, 0.19), transparent 65%),
    radial-gradient(460px 360px at 88% 82%, rgba(0, 92, 80, 0.2), transparent 70%),
    linear-gradient(135deg, #050F18 0%, #0A1A28 52%, #071420 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 3.2vw, 44px) clamp(20px, 4vw, 56px);
  overflow: hidden;
}

/* Textura sutil de pontos no fundo */
.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 80% 75% at 65% 25%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 65% 25%, #000 10%, transparent 75%);
  pointer-events: none;
}

/* Arco luminoso verde decorativo (topo-centro e curva atrás do dashboard) */
.auth-glow-arc {
  position: absolute;
  width: 560px;
  height: 560px;
  left: 36%;
  top: -320px;
  border-radius: 50%;
  border: 2px solid rgba(0, 223, 145, 0.55);
  box-shadow:
    0 0 60px rgba(0, 223, 145, 0.35),
    inset 0 -30px 70px rgba(0, 189, 126, 0.28);
  pointer-events: none;
  opacity: 0.85;
}

.auth-glow-swoosh {
  position: absolute;
  width: 680px;
  height: 360px;
  left: -90px;
  bottom: 40px;
  border-radius: 50%;
  border-top: 2px solid rgba(0, 223, 145, 0.45);
  border-left: 2px solid rgba(0, 223, 145, 0.35);
  transform: rotate(-16deg);
  filter: drop-shadow(0 0 18px rgba(0, 223, 145, 0.45));
  pointer-events: none;
  opacity: 0.72;
}

/* Container central de 2 colunas */
.auth-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 430px);
  align-items: center;
  gap: clamp(28px, 4.2vw, 64px);
}

/* ============================================================================
 * Coluna Esquerda — Marca, Título e Dashboard em Perspectiva 3D
 * ============================================================================ */
.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.auth-logo {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--gugio-white);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}
.auth-logo span { color: var(--gugio-green); }

.auth-pill {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(15, 30, 45, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.auth-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gugio-green-bright);
  box-shadow: 0 0 8px rgba(0, 223, 145, 0.8);
  display: inline-block;
}

.auth-headline {
  margin: 18px 0 12px;
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--gugio-white);
}
.auth-headline .accent {
  color: var(--gugio-green-bright);
}

.auth-lead-hero {
  margin: 0 0 28px;
  max-width: 500px;
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  line-height: 1.55;
  color: #94A3B8;
}

/* Cena 3D do Dashboard em Perspectiva */
.auth-scene {
  position: relative;
  width: 100%;
  max-width: 660px;
  padding: 14px 28px 34px 26px;
}

.auth-tablet-glow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 12px;
  height: 34px;
  background: radial-gradient(ellipse at center, rgba(0, 223, 145, 0.36), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}

.auth-tablet {
  position: relative;
  border-radius: 18px;
  padding: 9px;
  background: linear-gradient(145deg, #132A3E 0%, #0A1824 55%, #07131D 100%);
  border: 1.5px solid rgba(0, 223, 145, 0.34);
  box-shadow:
    -12px 24px 54px rgba(0, 0, 0, 0.62),
    -2px 0 24px rgba(0, 223, 145, 0.22);
  transform: perspective(1250px) rotateY(10deg) rotateX(2.5deg) rotateZ(-0.6deg);
  transform-origin: center center;
}

.auth-tablet-screen {
  border-radius: 12px;
  overflow: hidden;
  background: var(--gugio-bg);
  color: var(--gugio-ink);
  display: grid;
  grid-template-columns: 112px 1fr;
}

/* Sidebar interna do dashboard */
.auth-dash-side {
  background: #0D1E2D;
  color: #94A3B8;
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-dash-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.auth-dash-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.auth-dash-brand {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--gugio-white);
  margin: 0 0 10px 4px;
}
.auth-dash-brand span { color: var(--gugio-green); }

.auth-dash-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  font-weight: 500;
  padding: 5px 7px;
  border-radius: 7px;
  color: #94A3B8;
}
.auth-dash-nav.active {
  background: rgba(0, 189, 126, 0.2);
  color: #FFFFFF;
  font-weight: 700;
}
.auth-dash-nav.active svg { color: var(--gugio-green-bright); }

/* Área principal interna do dashboard */
.auth-dash-main {
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.auth-dash-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gugio-navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.auth-dash-sub {
  font-size: 0.62rem;
  color: var(--gugio-muted);
}
.auth-dash-period {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--gugio-navy);
  background: var(--gugio-white);
  border: 1px solid var(--gugio-border);
  border-radius: 7px;
  padding: 4px 8px;
  white-space: nowrap;
}

.auth-dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.auth-dash-kpi {
  background: var(--gugio-white);
  border: 1px solid var(--gugio-border);
  border-radius: 9px;
  padding: 8px 9px;
}
.auth-dash-kpi small {
  display: block;
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--gugio-muted);
  margin-bottom: 2px;
}
.auth-dash-kpi strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gugio-navy);
  letter-spacing: -0.02em;
}
.auth-dash-kpi em {
  display: block;
  font-style: normal;
  font-size: 0.54rem;
  font-weight: 700;
  color: var(--gugio-pos);
  margin-top: 2px;
}

.auth-dash-bottom {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 8px;
}
.auth-dash-card {
  background: var(--gugio-white);
  border: 1px solid var(--gugio-border);
  border-radius: 9px;
  padding: 9px 10px;
}
.auth-dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.auth-dash-card-title {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--gugio-navy);
}
.auth-dash-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.52rem;
  color: var(--gugio-muted);
}
.auth-dash-legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gugio-green);
  margin-right: 3px;
}
.auth-dash-chart {
  width: 100%;
  height: auto;
  display: block;
}
.auth-dash-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
}
.auth-dash-ring {
  width: 58px;
  height: 58px;
  display: block;
}
.auth-dash-ring-sub {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--gugio-pos);
}

/* Cards Flutuantes Translúcidos (estilo glassmórfico escuro com brilho verde) */
.float-kpi {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(11, 28, 38, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 223, 145, 0.36);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(0, 189, 126, 0.16);
  color: var(--gugio-white);
  will-change: transform;
}

.float-kpi-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(0, 189, 126, 0.16);
  color: var(--gugio-green-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.float-kpi strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.float-kpi small {
  display: block;
  font-size: 0.66rem;
  color: #CBD5E1;
  line-height: 1.25;
}

.float-kpi--top {
  top: -10px;
  right: 8px;
  animation: gugFloatA 5.8s ease-in-out infinite;
}
.float-kpi--left {
  left: -4px;
  bottom: 54px;
  flex-direction: column;
  text-align: center;
  gap: 5px;
  padding: 11px 14px;
  animation: gugFloatB 6.6s ease-in-out infinite;
}
.float-kpi--bottom {
  right: 2px;
  bottom: 2px;
  animation: gugFloatC 6.2s ease-in-out infinite;
}

@keyframes gugFloatA {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}
@keyframes gugFloatB {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(6px); }
}
@keyframes gugFloatC {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .float-kpi { animation: none !important; }
}

/* ============================================================================
 * Coluna Direita — Card Branco Flutuante de Formulário
 * ============================================================================ */
.auth-card {
  width: 100%;
  background: var(--gugio-white);
  color: var(--gugio-ink);
  border-radius: 20px;
  padding: clamp(26px, 3vw, 36px) clamp(22px, 2.8vw, 34px);
  box-shadow:
    0 28px 64px -16px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gugio-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}
.auth-back:hover { color: var(--gugio-navy); }

.auth-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-step-pill {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--gugio-border);
}
.auth-step-pill.on { background: var(--gugio-green); }

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gugio-navy);
  line-height: 1.2;
}

.auth-card .lead {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--gugio-muted);
  line-height: 1.5;
}

/* Alertas */
.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.auth-alert.show { display: flex; }
.auth-alert.error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.auth-alert.info { background: #F8FAFC; border-color: var(--gugio-border); color: var(--gugio-navy); }
.auth-alert.ok { background: var(--gugio-mint); border-color: #A7F3D0; color: var(--gugio-teal); }
.auth-alert-ico { flex: none; margin-top: 1px; }

/* Campos */
.field { margin-bottom: 13px; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.field label {
  display: block;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--gugio-navy);
  margin-bottom: 5px;
}
.field-head label { margin-bottom: 0; }
.field-optional {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gugio-muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-ico {
  position: absolute;
  left: 12px;
  color: #94A3B8;
  display: inline-flex;
  pointer-events: none;
  transition: color 0.15s ease;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid var(--gugio-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.89rem;
  color: var(--gugio-ink);
  background: var(--gugio-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap input,
.input-wrap select { padding-left: 37px; }
.input-wrap.has-toggle input { padding-right: 40px; }
.field input::placeholder { color: #94A3B8; }
.field input:hover, .field select:hover { border-color: #CBD5E1; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gugio-green);
  box-shadow: 0 0 0 3px rgba(0, 189, 126, 0.16);
}
.input-wrap:focus-within .input-ico { color: var(--gugio-navy); }

/* Toggle de senha */
.pass-toggle {
  position: absolute;
  right: 6px;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.pass-toggle:hover { background: var(--gugio-bg); color: var(--gugio-navy); }
.pass-toggle .ico-hide { display: none; }
.pass-toggle.is-visible .ico-show { display: none; }
.pass-toggle.is-visible .ico-hide { display: inline-flex; }

/* Medidor de segurança */
.pass-strength { margin-top: 7px; }
.pass-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 4px;
}
.pass-strength-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--gugio-border);
  transition: background 0.2s ease;
}
.pass-strength[data-level="1"] .pass-strength-bar:nth-child(1) { background: var(--gugio-neg); }
.pass-strength[data-level="2"] .pass-strength-bar:nth-child(-n+2) { background: var(--gugio-warn); }
.pass-strength[data-level="3"] .pass-strength-bar:nth-child(-n+3) { background: var(--gugio-green); }
.pass-strength[data-level="4"] .pass-strength-bar { background: var(--gugio-teal); }

.pass-strength-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--gugio-muted);
}
.pass-strength-label { font-weight: 700; }
.pass-strength[data-level="1"] .pass-strength-label { color: var(--gugio-neg); }
.pass-strength[data-level="2"] .pass-strength-label { color: var(--gugio-warn); }
.pass-strength[data-level="3"] .pass-strength-label,
.pass-strength[data-level="4"] .pass-strength-label { color: var(--gugio-teal); }

/* Checkbox termos */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 18px;
  font-size: 0.79rem;
  color: var(--gugio-muted);
  line-height: 1.45;
  cursor: pointer;
}
.field-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--gugio-green);
  flex: none;
  cursor: pointer;
}

.link {
  color: var(--gugio-teal);
  font-weight: 700;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }
.field-head .link { font-size: 0.78rem; font-weight: 600; }

/* Botão principal verde */
.btn-submit {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--gugio-green);
  color: #05261C;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.btn-submit:hover:not(:disabled) { background: var(--gugio-green-bright); }
.btn-submit:active:not(:disabled) { transform: translateY(1px); }
.btn-submit:disabled { opacity: 0.72; cursor: not-allowed; }

.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(5, 38, 28, 0.25);
  border-top-color: #05261C;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  font-size: 0.75rem;
  color: #94A3B8;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gugio-border);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  border: 1px solid var(--gugio-border);
  border-radius: 10px;
  background: var(--gugio-white);
  color: var(--gugio-navy);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: #CBD5E1; background: var(--gugio-bg); }

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--gugio-muted);
}

.auth-legal-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--gugio-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--gugio-muted);
}
.auth-legal-foot a {
  color: var(--gugio-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-legal-foot a:hover { color: var(--gugio-navy); }

/* ============================================================================
 * Responsividade (Tablets e Celulares)
 * ============================================================================ */
@media (max-width: 1040px) {
  .auth-stage {
    align-items: flex-start;
    padding: 28px 18px 40px;
  }
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 460px;
    gap: 24px;
  }
  .auth-hero {
    align-items: flex-start;
  }
  .auth-headline {
    font-size: 1.9rem;
    margin: 14px 0 8px;
  }
  .auth-lead-hero {
    margin-bottom: 0;
    font-size: 0.9rem;
  }
  .auth-scene,
  .auth-glow-swoosh {
    display: none;
  }
}

@media (max-width: 480px) {
  .auth-stage { padding: 20px 14px 32px; }
  .auth-logo { font-size: 1.7rem; }
  .auth-headline { font-size: 1.65rem; }
  .auth-card {
    border-radius: 16px;
    padding: 24px 18px;
  }
  .auth-card h1 { font-size: 1.38rem; }
}
