/* =====================================================================
   auth-modern.css — login/cadastro CashMAQ, estilo app premium.
   Paleta ancorada no logo: navy #1f2e44 ("Cash") + verde gradiente
   #5fc341→#2fa32b ("Maq") sobre superficie clara #f6f7f9.
   Mesmas classes/estrutura de sempre — so a camada visual mudou.
   ===================================================================== */
* {
  box-sizing: border-box;
}

:root {
  /* navy do logo */
  --cash-navy: #1f2e44;
  --cash-navy-2: #283b57;
  --cash-navy-3: #33496b;
  /* verde gradiente do logo */
  --cash-green: #2fa32b;
  --cash-green-light: #5fc341;
  --cash-green-dark: #1f8c22;
  --cash-green-soft: rgba(47, 163, 43, 0.10);
  --cash-green-ring: rgba(47, 163, 43, 0.16);
  /* neutros */
  --cash-bg: #f6f7f9;
  --cash-surface: #ffffff;
  --cash-soft: #f7f9fb;
  --cash-ink: #1c2940;
  --cash-muted: #5b6b7f;
  --cash-line: rgba(15, 30, 55, 0.10);
  --cash-line-strong: rgba(15, 30, 55, 0.16);
  --cash-red: #dc2626;
  --cash-yellow: #b45309;
  /* compat com codigo antigo que referencia azul */
  --cash-blue: var(--cash-navy-2);
  --cash-blue-dark: var(--cash-navy);
  --cash-blue-soft: var(--cash-green-soft);
  --cash-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  min-height: 100%;
  background: var(--cash-bg);
}

body.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--cash-ink);
  background:
    radial-gradient(720px 420px at 88% -60px, rgba(95, 195, 65, 0.09), transparent 62%),
    radial-gradient(820px 520px at -140px 104%, rgba(31, 46, 68, 0.07), transparent 60%),
    var(--cash-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* faixa azul antiga removida — fundo limpo e leve */
body.auth-page::before {
  content: none;
}

/* ------------------------------------------------------------------ */
/* Topbar — navy do logo, com vidro                                    */
/* ------------------------------------------------------------------ */
.auth-topbar {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 clamp(16px, 4vw, 42px);
  background: linear-gradient(120deg, var(--cash-navy) 0%, var(--cash-navy-2) 70%, var(--cash-navy-3) 120%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 12px 34px rgba(18, 30, 48, 0.22);
}

.auth-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.auth-brand img {
  height: 40px;
  width: auto;
  max-width: 170px;
  display: block;
  object-fit: contain;
}

.auth-nav {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.auth-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.2s var(--cash-ease), color 0.2s var(--cash-ease);
}

.auth-nav a.is-active,
.auth-nav a:hover {
  background: #ffffff;
  color: var(--cash-navy);
}

/* ------------------------------------------------------------------ */
/* Shell + card                                                        */
/* ------------------------------------------------------------------ */
.auth-shell {
  width: 100%;
  min-height: calc(100vh - 112px);
  min-height: calc(100svh - 112px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 44px;
}

.auth-shell-wide {
  align-items: flex-start;
}

.auth-card {
  position: relative;
  width: min(100%, 460px);
  overflow: hidden;
  background: var(--cash-surface);
  border: 1px solid var(--cash-line);
  border-radius: 26px;
  box-shadow:
    0 1px 2px rgba(18, 30, 48, 0.04),
    0 12px 32px rgba(18, 30, 48, 0.07),
    0 32px 80px rgba(18, 30, 48, 0.10);
  padding: clamp(26px, 4.5vw, 38px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--cash-navy), var(--cash-green) 60%, var(--cash-green-light));
}

.auth-card-signup {
  width: min(100%, 840px);
}

.auth-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 18px;
}

.auth-logo {
  width: min(240px, 82%);
  max-height: 118px;
  display: block;
  object-fit: contain;
}

.auth-logo-small {
  width: 118px;
  max-height: 70px;
  flex-shrink: 0;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--cash-green-soft);
  color: var(--cash-green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cash-green);
  box-shadow: 0 0 0 3px var(--cash-green-soft);
}

.auth-card h1 {
  margin: 0;
  color: var(--cash-ink);
  font-size: clamp(28px, 5vw, 34px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 10px 0 24px;
  color: var(--cash-muted);
  font-size: 14.5px;
  line-height: 1.5;
  font-weight: 500;
}

.auth-card-head .auth-subtitle {
  margin-bottom: 0;
  max-width: 520px;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */
.auth-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-alert {
  display: none;
  padding: 12px 15px;
  border: 1px solid var(--cash-line);
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.auth-alerts .auth-alert,
.auth-alert.visible,
.auth-feedback[style*="block"] {
  display: block;
}

.auth-alert.success {
  background: #f0faee;
  border-color: rgba(47, 163, 43, 0.28);
  color: #1c6b1e;
}

.auth-alert.error {
  background: #fdf1f0;
  border-color: rgba(220, 38, 38, 0.24);
  color: #99241b;
}

.auth-alert.warning {
  background: #fdf7e9;
  border-color: rgba(180, 83, 9, 0.26);
  color: var(--cash-yellow);
}

/* ------------------------------------------------------------------ */
/* Google                                                              */
/* ------------------------------------------------------------------ */
.auth-google {
  min-height: 52px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--cash-line-strong);
  border-radius: 15px;
  background: #ffffff;
  color: var(--cash-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(18, 30, 48, 0.05);
  transition: border-color 0.2s var(--cash-ease), box-shadow 0.2s var(--cash-ease),
    transform 0.16s var(--cash-ease), background 0.2s var(--cash-ease);
}

.auth-google:hover {
  border-color: rgba(15, 30, 55, 0.26);
  background: var(--cash-soft);
  box-shadow: 0 2px 4px rgba(18, 30, 48, 0.05), 0 10px 26px rgba(18, 30, 48, 0.08);
  transform: translateY(-1px);
}

.auth-google:active {
  transform: scale(0.98);
}

.auth-google.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.google-mark {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #8a99ab;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--cash-line);
}

/* ------------------------------------------------------------------ */
/* Formularios                                                         */
/* ------------------------------------------------------------------ */
.auth-form {
  display: grid;
  gap: 17px;
}

.signup-form {
  gap: 22px;
}

.signup-section {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--cash-line);
  border-radius: 18px;
  background: #fbfcfd;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cash-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--cash-green-light), var(--cash-green));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-width {
  grid-column: 1 / -1;
}

.form-group {
  min-width: 0;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: #3d4c60;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.form-group input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--cash-line-strong);
  border-radius: 15px;
  padding: 0 15px;
  color: var(--cash-ink);
  background: var(--cash-soft);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s var(--cash-ease), background 0.18s var(--cash-ease),
    box-shadow 0.18s var(--cash-ease);
}

.form-group input::placeholder {
  color: #93a1b3;
}

.form-group input:focus {
  border-color: var(--cash-green);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--cash-green-ring);
}

.form-group input.input-error {
  border-color: var(--cash-red);
  background: #fff5f5;
}

.field-error-text {
  display: none;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.field-error-text.visible {
  display: block;
}

.form-hint {
  display: none;
  margin-top: 6px;
  color: var(--cash-muted);
  font-size: 12px;
  font-weight: 600;
}

.segment-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.segment-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--cash-line-strong);
  border-radius: 13px;
  padding: 0 14px;
  background: var(--cash-soft);
  color: #3d4c60;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s var(--cash-ease), background 0.18s var(--cash-ease),
    color 0.18s var(--cash-ease);
}

.segment-option:has(input:checked) {
  border-color: var(--cash-green);
  background: var(--cash-green-soft);
  color: var(--cash-green-dark);
  box-shadow: 0 0 0 3px var(--cash-green-ring);
}

/* ------------------------------------------------------------------ */
/* CTA — verde gradiente do logo                                       */
/* ------------------------------------------------------------------ */
.auth-submit {
  min-height: 54px;
  width: 100%;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, var(--cash-green-light) 0%, var(--cash-green) 100%);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 140, 34, 0.28), 0 12px 28px rgba(47, 163, 43, 0.26);
  transition: background 0.2s var(--cash-ease), box-shadow 0.2s var(--cash-ease),
    transform 0.16s var(--cash-ease), filter 0.2s var(--cash-ease);
}

.auth-submit:hover {
  background: linear-gradient(180deg, var(--cash-green) 0%, var(--cash-green-dark) 100%);
  box-shadow: 0 2px 4px rgba(31, 140, 34, 0.30), 0 16px 36px rgba(47, 163, 43, 0.32);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-submit:disabled {
  opacity: 0.6;
  filter: saturate(0.7);
  transform: none;
}

/* ------------------------------------------------------------------ */
/* Rodape do card + pagina                                             */
/* ------------------------------------------------------------------ */
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  color: var(--cash-muted);
  font-size: 14px;
  font-weight: 600;
}

.auth-foot span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c3cdd8;
}

.auth-foot a {
  color: var(--cash-navy);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.18s var(--cash-ease);
}

.auth-foot a:hover {
  color: var(--cash-green-dark);
  text-decoration: underline;
}

.auth-footer {
  padding: 0 16px 20px;
  color: #8a99ab;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.auth-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Mobile — mesma estrutura de breakpoints de antes                    */
/* ------------------------------------------------------------------ */
@media (max-width: 760px) {
  .auth-topbar {
    height: 58px;
    min-height: 58px;
    padding: 0 12px;
  }

  .auth-brand img {
    height: 34px;
    max-width: 140px;
  }

  .auth-nav {
    gap: 3px;
    padding: 3px;
  }

  .auth-nav a {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .auth-shell {
    min-height: calc(100vh - 92px);
    min-height: calc(100svh - 92px);
    align-items: flex-start;
    padding: 0 0 22px;
  }

  .auth-card {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 92px);
    min-height: calc(100svh - 92px);
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 18px 30px;
  }

  .auth-card-signup {
    min-height: auto;
  }

  .auth-card-head {
    align-items: center;
  }

  .auth-logo-wrap {
    margin-top: 2px;
  }

  .auth-logo {
    width: min(216px, 78%);
  }

  .auth-logo-small {
    width: 82px;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .form-grid,
  .segment-group {
    grid-template-columns: 1fr;
  }

  .signup-section {
    padding: 16px;
  }
}
