/* ============================================================
   Conecta Coopatos — Login Page
   Paleta: #0B326B (azul primário) | #A9BE2F (verde lima)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900: #061a38;
  --blue-800: #0B326B;
  --blue-700: #0d3d84;
  --blue-600: #1050a8;
  --blue-400: #3a7bd5;
  --blue-200: #a8c8f0;
  --green:    #A9BE2F;
  --green-d:  #8fa026;
  --green-l:  #c8de52;
  --white:    #ffffff;
  --gray-100: #f4f6fb;
  --gray-300: #d0d8e8;
  --gray-500: #7a8bac;
  --font:     'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --radius:   16px;
  --shadow-card: 0 32px 80px rgba(6, 26, 56, 0.45);
}

html, body {
  height: 100%;
  font-family: var(--font);
  overflow: hidden;
}

/* ── Background ───────────────────────────────────────────── */

.login-bg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 45%, #0e4a9e 100%);
  overflow: hidden;
}

/* Orbs animados de fundo */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: float linear infinite;
  pointer-events: none;
}
.orb-1 {
  width: 520px; height: 520px;
  background: var(--green);
  top: -120px; right: -80px;
  animation-duration: 18s;
}
.orb-2 {
  width: 380px; height: 380px;
  background: var(--blue-400);
  bottom: -100px; left: -60px;
  animation-duration: 22s;
  animation-direction: reverse;
}
.orb-3 {
  width: 260px; height: 260px;
  background: var(--green-l);
  top: 55%; left: 42%;
  animation-duration: 14s;
  opacity: 0.09;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -40px) scale(1.08); }
  66%  { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Grade de pontos */
.grid-dots {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

/* Linha decorativa verde */
.deco-line {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--green), var(--green-l), transparent);
  pointer-events: none;
}

/* ── Layout wrapper ───────────────────────────────────────── */

.login-wrapper {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1000px;
  width: 96%;
  min-height: 580px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Lado esquerdo (brand) ────────────────────────────────── */

.login-brand {
  background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  backdrop-filter: blur(4px);
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  gap: 32px;
  text-align: center;
}

.brand-logo {
  animation: fadeIn 1s 0.3s both;
}
.brand-logo img {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(169,190,47,0.3));
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.brand-tagline {
  animation: fadeIn 1s 0.5s both;
}
.brand-tagline h2 {
  color: var(--white);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.brand-tagline h2 span {
  color: var(--green);
}
.brand-tagline p {
  margin-top: 10px;
  color: var(--blue-200);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Icones de recursos */
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  animation: fadeIn 1s 0.7s both;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  transition: background 0.2s;
}
.feature-item:hover { background: rgba(255,255,255,0.1); }

.feature-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-d) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.feature-item p {
  color: var(--blue-200);
  font-size: 0.82rem;
  line-height: 1.4;
}
.feature-item strong { color: var(--white); display: block; font-size: 0.87rem; }

/* ── Lado direito (formulário) ────────────────────────────── */

.login-form-side {
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 44px;
  animation: fadeIn 0.8s 0.2s both;
}

.form-header { width: 100%; margin-bottom: 32px; }
.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -0.5px;
}
.form-header p {
  margin-top: 6px;
  color: var(--gray-500);
  font-size: 0.9rem;
}
.form-header .accent { color: var(--green-d); font-weight: 600; }

/* Alerta de erro */
.alert-error {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.875rem;
  margin-bottom: 20px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-6px); }
  40%,80%  { transform: translateX(6px); }
}
.alert-error svg { flex-shrink: 0; }

/* Formulário */
.login-form { width: 100%; display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-800);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--gray-500);
  pointer-events: none;
  transition: color 0.2s;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 2px solid var(--gray-300);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--blue-900);
  background: var(--gray-100);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.input-wrap input::placeholder { color: var(--gray-500); }
.input-wrap input:focus {
  border-color: var(--blue-800);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(11, 50, 107, 0.1);
}
.input-wrap input:focus + svg,
.input-wrap:focus-within svg { color: var(--blue-800); }

/* Ícone à direita (olho da senha) */
.toggle-pw {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.toggle-pw:hover { color: var(--blue-800); }

/* Link esqueceu senha */
.forgot-link {
  text-align: right;
  font-size: 0.82rem;
}
.forgot-link a {
  color: var(--blue-700);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.forgot-link a:hover { color: var(--green-d); }

/* Botão principal */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 100%);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 24px rgba(11, 50, 107, 0.35);
}
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.12) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(11, 50, 107, 0.45); }
.btn-login:hover::before { opacity: 1; }
.btn-login:active { transform: translateY(0); }

/* Barra de progresso do botão */
.btn-login .btn-bar {
  position: absolute;
  bottom: 0; left: -100%;
  height: 3px;
  width: 100%;
  background: var(--green);
  transition: left 0.4s ease;
}
.btn-login.loading .btn-bar { left: 0; }
.btn-login.loading { pointer-events: none; opacity: 0.85; }

/* Divisor */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-500);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-300);
}

/* Rodapé */
.form-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-500);
}
.form-footer a { color: var(--blue-700); text-decoration: none; font-weight: 600; }
.form-footer a:hover { color: var(--green-d); }

/* Versão */
.version-badge {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--gray-500);
}
.version-badge span {
  padding: 2px 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 20px;
}

/* ── Responsivo ───────────────────────────────────────────── */

@media (max-width: 720px) {
  html, body { overflow: auto; }
  .login-bg  { align-items: flex-start; min-height: 100svh; padding: 24px 0; }
  .login-wrapper {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: unset;
  }
  .login-brand {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 36px 28px;
    gap: 24px;
  }
  .brand-logo img { width: 180px; }
  .brand-tagline h2 { font-size: 1.25rem; }
  .brand-features { display: none; }
  .login-form-side { padding: 36px 28px; }
}
