/* Autenticação e Gestão de Contas — Neotropical */

:root {
  --auth-bg: #f4f7f4;
  --auth-surface: #ffffff;
  --auth-forest-dark: #1b3d2e;
  --auth-forest-mid: #244c36;
  /* Borda/accent: limiar de 3:1 para componentes de UI — #388f64 passa. */
  --auth-forest-light: #388f64;
  /* Texto: #388f64 dava 3,98:1 no branco e 3,54:1 sobre --auth-accent-soft,
     abaixo dos 4,5:1 do AA. Este tom passa nos dois fundos com margem. */
  --auth-forest-text: #2d7250;
  --auth-accent-soft: #e8f5ed;
  --auth-mint: #8cc9a9;
  --auth-text-main: #192720;
  --auth-text-muted: #5b6e63;
  --auth-border: #d4e0d7;
  --auth-radius-lg: 18px;
  --auth-radius-md: 12px;
}

body.auth-page {
  margin: 0;
  padding: 0;
  min-width: 320px;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--auth-bg);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--auth-text-main);
  line-height: 1.5;
}

body.auth-page > main {
  width: 100%;
  height: 100%;
  overflow: hidden;
  animation: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(440px, 1.15fr) minmax(400px, 0.85fr);
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

.auth-layout-dragonfly {
  grid-template-columns: minmax(500px, 1.08fr) minmax(430px, 0.92fr);
}

/* Painel Visual Hero (Esquerda) */
.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 64px);
  min-height: 0;
  overflow: hidden;
  background: var(--auth-forest-dark);
  color: #ffffff;
}

.auth-visual-media {
  position: absolute;
  z-index: -3;
  inset: 0;
  display: block;
  overflow: hidden;
  background: #041f1e;
  pointer-events: none;
}

.auth-visual-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  transform: scale(1.02);
  transform-origin: 62% 46%;
  filter: saturate(.94) contrast(1.03);
  animation: auth-dragonfly-breathe 22s ease-in-out infinite;
  will-change: transform;
}

@keyframes auth-dragonfly-breathe {
  0%, 100% { transform: scale(1.02) translate3d(0, 0, 0); }
  50% { transform: scale(1.055) translate3d(-.25%, .18%, 0); }
}

.auth-visual-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 143, 100, 0.35) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(27, 61, 46, 0.8) 0%, transparent 70%),
    linear-gradient(135deg, #1b3d2e 0%, #0d2118 100%);
}

.auth-layout-dragonfly .auth-visual-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(1, 28, 27, .96) 0%, rgba(2, 29, 28, .78) 38%, rgba(2, 28, 27, .2) 72%, rgba(2, 25, 24, .04) 100%),
    linear-gradient(0deg, rgba(1, 22, 21, .78) 0%, rgba(1, 24, 23, .08) 47%, rgba(1, 24, 23, .5) 100%);
}

.auth-layout-dragonfly .auth-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -12%;
  top: 18%;
  width: 62%;
  aspect-ratio: 1;
  border: 1px solid rgba(194, 255, 211, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(194, 255, 211, .025), 0 0 0 108px rgba(194, 255, 211, .018);
  pointer-events: none;
}

.auth-dragonfly-hotspots {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.auth-dragonfly-hotspot {
  position: absolute;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #d7ffe0;
  background: transparent;
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.auth-dragonfly-hotspot::before,
.auth-dragonfly-hotspot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.auth-dragonfly-hotspot::before {
  width: 23px;
  height: 23px;
  border: 1px solid rgba(229, 255, 235, .9);
  background: rgba(2, 43, 37, .34);
  box-shadow: 0 0 0 5px rgba(121, 240, 148, .1), 0 0 22px rgba(121, 240, 148, .2);
  backdrop-filter: blur(5px);
  animation: auth-hotspot-pulse 3.6s ease-in-out infinite;
}

.auth-dragonfly-hotspot::after {
  width: 7px;
  height: 7px;
  background: #79f094;
  box-shadow: 0 0 10px rgba(121, 240, 148, .9);
}

.auth-dragonfly-hotspot:hover::before,
.auth-dragonfly-hotspot:focus-visible::before {
  border-color: #fff;
  background: rgba(4, 69, 55, .68);
  box-shadow: 0 0 0 7px rgba(121, 240, 148, .15), 0 0 30px rgba(121, 240, 148, .36);
}

.auth-dragonfly-hotspot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.auth-dragonfly-hotspot-wings { left: 83%; top: 29%; }
.auth-dragonfly-hotspot-flight { left: 74%; top: 41%; }
.auth-dragonfly-hotspot-vision { left: 58%; top: 36%; }
.auth-dragonfly-hotspot-flight::before { animation-delay: -1.2s; }
.auth-dragonfly-hotspot-vision::before { animation-delay: -2.4s; }

@keyframes auth-hotspot-pulse {
  0%, 100% { opacity: .74; box-shadow: 0 0 0 4px rgba(121, 240, 148, .08), 0 0 18px rgba(121, 240, 148, .15); }
  50% { opacity: 1; box-shadow: 0 0 0 7px rgba(121, 240, 148, .14), 0 0 28px rgba(121, 240, 148, .3); }
}

.auth-dragonfly-tip {
  position: absolute;
  top: 50%;
  left: 38px;
  display: grid;
  width: 238px;
  padding: 13px 15px 14px;
  border: 1px solid rgba(214, 255, 223, .28);
  border-radius: 13px;
  color: #f6fff7;
  background: linear-gradient(145deg, rgba(3, 35, 32, .94), rgba(4, 28, 27, .84));
  box-shadow: 0 16px 44px rgba(0, 17, 16, .34), inset 0 1px rgba(255, 255, 255, .08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-align: left;
  transform: translateY(calc(-50% + 7px));
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1), visibility 180ms;
  backdrop-filter: blur(14px) saturate(1.15);
}

.auth-dragonfly-tip-left {
  right: 38px;
  left: auto;
}

.auth-dragonfly-tip small,
.auth-dragonfly-tip strong,
.auth-dragonfly-tip > span { display: block; }
.auth-dragonfly-tip small {
  margin-bottom: 6px;
  color: #79f094;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.2;
  text-transform: uppercase;
}
.auth-dragonfly-tip strong {
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}
.auth-dragonfly-tip > span {
  margin-top: 5px;
  color: rgba(243, 251, 244, .76);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.auth-dragonfly-hotspot:hover .auth-dragonfly-tip,
.auth-dragonfly-hotspot:focus-visible .auth-dragonfly-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
}

.auth-visual-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}

.auth-visual-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
}

.auth-visual-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 150ms ease;
  width: fit-content;
}

.auth-visual-back:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
  transform: translateX(-3px);
}

.auth-visual-brand .logo-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-visual-copy {
  margin-top: auto;
  max-width: 580px;
  padding: 60px 0 20px;
}

.auth-layout-dragonfly .auth-visual-copy {
  max-width: 520px;
  text-shadow: 0 2px 28px rgba(0, 18, 17, .38);
}

.auth-overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(140, 201, 169, 0.15);
  border: 1px solid rgba(140, 201, 169, 0.3);
  color: var(--auth-mint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-visual-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: #ffffff;
}

.auth-visual-copy p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.6;
}

.auth-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 32px;
}

.auth-capabilities span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-photo-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.auth-layout-dragonfly .auth-photo-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(241, 255, 245, .74);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-layout-dragonfly .auth-photo-note span {
  width: 28px;
  height: 1px;
  background: #79f094;
}

/* Painel de Formulário (Direita) */
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--auth-bg);
}

.auth-card {
  width: min(100%, 420px);
  margin: auto 0;
  background: var(--auth-surface);
  padding: 36px 38px;
  border-radius: var(--auth-radius-lg);
  box-shadow: 0 12px 36px rgba(27, 61, 46, 0.06);
  border: 1px solid var(--auth-border);
}

.auth-card-wide { width: min(100%, 480px); }
.profile-fieldset { min-width: 0; padding: 0; border: 0; }
.profile-fieldset legend {
  margin-bottom: 7px;
  color: var(--auth-text-main);
  font-size: 13px;
  font-weight: 600;
}
.profile-card-opt input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--auth-forest-light);
  flex: none;
}
.auth-alt-action {
  margin-top: 22px;
  color: var(--auth-text-muted);
  text-align: center;
  font-size: 14px;
}
.auth-alt-action a { color: var(--auth-forest-text); font-weight: 700; }
.auth-alt-action a,
.field-label-row a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.auth-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  gap: 6px;
  color: var(--auth-text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease;
}

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

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--auth-text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.auth-mobile-brand .logo-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--auth-accent-soft);
  color: var(--auth-forest-text);
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-forest-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 12px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--auth-text-main);
}

.auth-card .lead {
  margin: 8px 0 26px;
  color: var(--auth-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.form-auth {
  display: grid;
  gap: 18px;
}

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

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-main);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label-row a {
  color: var(--auth-forest-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.field-label-row a:hover {
  text-decoration: underline;
}

.field .input,
.field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-md);
  background: #ffffff;
  color: var(--auth-text-main);
  font-size: 14px;
  font-family: inherit;
  transition: all 150ms ease;
}

.field .input:focus,
.field select:focus {
  border-color: var(--auth-forest-light);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 143, 100, 0.18);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 90px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--auth-forest-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}

.password-field button:hover {
  background: var(--auth-accent-soft);
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--auth-radius-md);
  background: var(--auth-forest-dark);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
  text-decoration: none;
}

.btn-auth:hover {
  background: var(--auth-forest-mid);
}

.btn-auth:active {
  transform: scale(0.99);
}

.btn-auth-outline {
  background: transparent;
  border: 1px solid var(--auth-border);
  color: var(--auth-text-main);
}

.btn-auth-outline:hover {
  background: var(--auth-accent-soft);
  border-color: var(--auth-forest-light);
  color: var(--auth-forest-dark);
}

/* Alertas & Mensagens de Status */
.auth-alert {
  padding: 12px 16px;
  border-radius: var(--auth-radius-md);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.auth-alert-error {
  background: #fdf2f2;
  border: 1px solid #f8b4b4;
  color: #9b1c1c;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-alert-info {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #115e59;
}

/* Seletor de Perfis no Cadastro */
.profile-cards {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.profile-card-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-md);
  cursor: pointer;
  transition: all 150ms ease;
  background: #ffffff;
}

.profile-card-opt:hover {
  border-color: var(--auth-forest-light);
  background: var(--auth-accent-soft);
}

.profile-card-opt input[type="radio"]:checked + .profile-card-body {
  color: var(--auth-forest-dark);
}

.profile-card-opt:has(input[type="radio"]:checked) {
  border-color: var(--auth-forest-light);
  background: var(--auth-accent-soft);
  box-shadow: 0 0 0 2px var(--auth-forest-light);
}

.profile-card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--auth-accent-soft);
  color: var(--auth-forest-text);
  flex-shrink: 0;
}

.profile-card-body strong {
  display: block;
  font-size: 14px;
  color: var(--auth-text-main);
}

.profile-card-body small {
  display: block;
  font-size: 12px;
  color: var(--auth-text-muted);
}

.dev-link-banner {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px dashed #f59e0b;
  border-radius: var(--auth-radius-md);
  color: #92400e;
  font-size: 12px;
  word-break: break-all;
}

.dev-link-banner a {
  color: #78350f;
  font-weight: 700;
}

/* Responsividade Mobile */
@media (max-width: 860px) {
  body.auth-page {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.auth-page > main {
    height: auto;
    overflow: visible;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }
  .auth-visual {
    min-height: 280px;
    padding: 32px 24px;
  }
  .auth-layout-dragonfly .auth-visual-media img {
    object-position: 50% 38%;
    transform: scale(1.06);
    animation: none;
  }
  .auth-layout-dragonfly .auth-visual-shade {
    background:
      linear-gradient(90deg, rgba(1, 28, 27, .94), rgba(2, 29, 28, .46) 75%, rgba(2, 25, 24, .12)),
      linear-gradient(0deg, rgba(1, 22, 21, .74), rgba(1, 24, 23, .12) 58%, rgba(1, 24, 23, .48));
  }
  .auth-layout-dragonfly .auth-visual::after { display: none; }
  .auth-dragonfly-hotspots { display: none; }
  .auth-visual-copy {
    padding: 20px 0 0;
  }
  .auth-capabilities, .auth-photo-note {
    display: none;
  }
  .auth-panel {
    height: auto;
    overflow: visible;
    padding: 32px 20px;
  }
  .auth-card {
    padding: 28px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual-media img { animation: none; }
  .auth-dragonfly-hotspot::before { animation: none; }
}
