/* ==========================================================================
   FiFlow v3 — Tela de Autenticação Padronizada ("Minimal Confidente")
   Alinhada aos tokens de css/fiflow-standard.css e css/design-system.css
   ========================================================================== */

#app-landing.auth-layout {
  height: 100vh;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 8% 0%, rgba(63, 191, 160, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 50% at 96% 100%, rgba(12, 79, 65, 0.08), transparent 70%),
    var(--bg, #F6FAF7);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fi-ink, #12211C);
  margin: 0;
  padding: 28px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-container {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  width: 100%;
  max-width: 1020px;
  margin: auto;
  background: var(--fi-surface, #FFFFFF);
  border: 1px solid var(--fi-line, #E3EAE5);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(18, 33, 28, 0.04),
    0 20px 48px rgba(18, 33, 28, 0.07);
  overflow: hidden;
}

/* Lado Esquerdo: Painel Institucional Claro no Padrão do Sistema */
.auth-branding-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(63, 191, 160, 0.10) 0%, transparent 55%),
    var(--fi-surface-2, #F6F9F7);
  border-right: 1px solid var(--fi-line, #E3EAE5);
  padding: 40px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  color: var(--fi-ink, #12211C);
}

.auth-brand-header {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.auth-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(12, 79, 65, 0.14);
}

.auth-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-brand-copy {
  display: flex;
  flex-direction: column;
}

.auth-brand-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fi-ink, #12211C);
}

.auth-brand-sub {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fi-text-2, #5C6E66);
  margin-top: 2px;
}

.auth-brand-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fi-green-bg, #E3EEE8);
  color: var(--fi-green, #0C4F41);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.auth-branding-body {
  max-width: 480px;
}

.auth-kicker {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fi-green, #0C4F41);
  margin-bottom: 8px;
}

.auth-hero-headline {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fi-ink, #12211C);
  margin: 0 0 12px 0;
}

.auth-hero-headline span {
  color: var(--fi-green, #0C4F41);
}

.auth-hero-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fi-text-2, #5C6E66);
  margin: 0 0 24px 0;
}

.auth-trust-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-trust-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--fi-surface, #FFFFFF);
  border: 1px solid var(--fi-line, #E3EAE5);
  padding: 13px 15px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(18, 33, 28, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-trust-card:hover {
  border-color: #B9CEC4;
  box-shadow: var(--fi-shadow-hover, 0 2px 4px rgba(18, 33, 28, 0.05), 0 10px 24px rgba(12, 79, 65, 0.08));
}

.auth-trust-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--fi-green-bg, #E3EEE8);
  color: var(--fi-green, #0C4F41);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-trust-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fi-ink, #12211C);
  margin-bottom: 2px;
}

.auth-trust-sub {
  font-size: 12px;
  color: var(--fi-text-2, #5C6E66);
  line-height: 1.45;
}

.auth-branding-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--fi-text-3, #8A9A93);
  border-top: 1px solid var(--fi-line, #E3EAE5);
  padding-top: 16px;
}

.auth-footer-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fi-green, #0C4F41);
  font-weight: 600;
}

/* Lado Direito: Formulário de Autenticação */
.auth-form-panel {
  background: var(--fi-surface, #FFFFFF);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 42px;
}

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

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
}

.auth-card-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-card-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fi-text-3, #8A9A93);
  margin-bottom: 1px;
}

.auth-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--fi-ink, #12211C);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.auth-card-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fi-text-2, #5C6E66);
  margin: 0 0 20px 0;
}

/* Botão Social Google — mesmo padrão de controles (altura 38px, raio 10px) */
.btn-google-auth {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--fi-surface, #FFFFFF);
  border: 1px solid var(--fi-line-strong, #D3DFD8);
  border-radius: var(--fi-radius-ctrl, 10px);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
  color: var(--fi-ink, #12211C);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-google-auth:hover {
  background: var(--fi-surface-2, #F6F9F7);
  border-color: #B9CEC4;
}

.btn-google-auth:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--fi-text-3, #8A9A93);
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--fi-line, #E3EAE5);
}

.auth-separator:not(:empty)::before {
  margin-right: 12px;
}

.auth-separator:not(:empty)::after {
  margin-left: 12px;
}

/* Abas de Navegação (Entrar / Criar Conta) */
.auth-tabs {
  display: flex;
  background: var(--fi-neutral-bg, #EEF3F0);
  border: 1px solid var(--fi-line, #E3EAE5);
  border-radius: var(--fi-radius-ctrl, 10px);
  padding: 3px;
  margin-bottom: 18px;
  gap: 3px;
}

.auth-tab-btn {
  flex: 1;
  height: 30px;
  border: none;
  background: transparent;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--fi-text-2, #5C6E66);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn:hover {
  color: var(--fi-ink, #12211C);
}

.auth-tab-btn.active {
  background: var(--fi-surface, #FFFFFF);
  color: var(--fi-green, #0C4F41);
  box-shadow: 0 1px 3px rgba(18, 33, 28, 0.08);
}

/* Campos de Formulário */
.auth-field-group {
  margin-bottom: 14px;
}

.auth-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--fi-ink, #12211C);
  margin-bottom: 5px;
}

.auth-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  color: var(--fi-text-3, #8A9A93);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 36px;
  font-size: 13px;
  border: 1px solid var(--fi-line-strong, #D3DFD8);
  border-radius: var(--fi-radius-ctrl, 10px);
  background: var(--fi-surface, #FFFFFF);
  color: var(--fi-ink, #12211C);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--fi-green, #0C4F41);
  box-shadow: 0 0 0 3px rgba(12, 79, 65, 0.12);
}

.auth-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fi-text-3, #8A9A93);
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
}

.auth-toggle-pwd:hover {
  color: var(--fi-green, #0C4F41);
  background: var(--fi-surface-2, #F6F9F7);
}

.auth-forgot-link {
  font-size: 11.5px;
  color: var(--fi-green, #0C4F41);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

/* Lembrar-me */
.auth-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--fi-text-2, #5C6E66);
}

.auth-remember-row input[type="checkbox"] {
  accent-color: var(--fi-green, #0C4F41);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Botões Principais — idênticos ao padrão .btn-primary / .btn-ghost */
.btn-auth-submit {
  width: 100%;
  height: 38px;
  background: var(--fi-green, #0C4F41);
  color: #FFFFFF;
  border: 1px solid var(--fi-green, #0C4F41);
  border-radius: var(--fi-radius-ctrl, 10px);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-auth-submit:hover {
  background: #083A30;
  border-color: #083A30;
}

.btn-auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-auth-secondary {
  width: 100%;
  height: 36px;
  margin-top: 8px;
  background: var(--fi-surface, #FFFFFF);
  color: var(--fi-ink, #12211C);
  border: 1px solid var(--fi-line-strong, #D3DFD8);
  border-radius: var(--fi-radius-ctrl, 10px);
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-auth-secondary:hover {
  background: var(--fi-surface-2, #F6F9F7);
  border-color: #B9CEC4;
}

/* Alertas Semânticos Padronizados (tons red / green / teal do FiFlow) */
.auth-alert {
  padding: 11px 13px;
  border-radius: var(--fi-radius-ctrl, 10px);
  font-size: 12.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.45;
  animation: authAlertFadeIn 0.2s ease;
}

.auth-alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert-error {
  background: var(--fi-red-bg, #F6E4E0);
  border: 1px solid rgba(162, 59, 46, 0.25);
  color: var(--fi-red, #A23B2E);
}

.auth-alert-success {
  background: var(--fi-green-bg, #E3EEE8);
  border: 1px solid rgba(12, 79, 65, 0.25);
  color: var(--fi-green, #0C4F41);
}

.auth-alert-info {
  background: var(--fi-teal-bg, #DCEDE7);
  border: 1px solid rgba(23, 94, 78, 0.25);
  color: var(--fi-teal, #175E4E);
}

.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 11.5px;
  color: var(--fi-text-3, #8A9A93);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--fi-line, #E3EAE5);
  line-height: 1.4;
}

.auth-security-note svg {
  color: var(--fi-green, #0C4F41);
  flex-shrink: 0;
}

@keyframes authAlertFadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: authSpin 0.75s linear infinite;
  display: inline-block;
}

/* Responsividade Tablet / Mobile */
@media (max-width: 900px) {
  #app-landing.auth-layout {
    align-items: flex-start;
    padding: 16px 12px;
  }
  .auth-container {
    grid-template-columns: 1fr;
  }
  .auth-branding-panel {
    border-right: none;
    border-bottom: 1px solid var(--fi-line, #E3EAE5);
    padding: 26px 22px;
    order: 2;
  }
  .auth-form-panel {
    padding: 28px 22px;
    order: 1;
  }
  .auth-hero-headline {
    font-size: 24px;
  }
}
