/* ========== Reset / Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  color: #1f2937;
  background: #f3f5fb;
  -webkit-text-size-adjust: 100%; /* evita zoom estranho no iOS */
}

/* ========== Wrapper / Layout ========== */
.login-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* HEADER (mantém cor/identidade) */
.login-header {
  position: relative;
  flex: 1;
  background: linear-gradient(135deg, #2148C0 0%, #1f5be0 40%, #2148C0 100%);
  color: #fff;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 80px) 16px;
  overflow: hidden;
}

/* elementos decorativos moderninhos (não essenciais) */
.bg-decor::before,
.bg-decor::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .25;
  pointer-events: none;
}
.bg-decor::before {
  width: 52vmin; height: 52vmin;
  background: #00C6FF;
  top: -12vmin; left: -8vmin;
}
.bg-decor::after {
  width: 60vmin; height: 60vmin;
  background: #0072FF;
  bottom: -18vmin; right: -10vmin;
}

/* Card “glass” central */
.login-card {
  width: min(860px, 96vw);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px);
  text-align: center;
}
.logo-top { width: 350px; height: auto; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.login-card h1 {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: .2px;
}
.login-card p { font-size: clamp(14px, 2vw, 16px); opacity: .95; margin-bottom: 18px; line-height: 1.45; }

/* Mensagem inline (além do modal) */
.inline-error {
  background: rgba(255, 74, 74, 0.14);
  border: 1px solid rgba(255, 74, 74, 0.35);
  color: #fff;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 auto 10px;
  width: min(520px, 92%);
}

/* FORM modernizado (mantém layout central) */
.login-box {
  margin: 0 auto;
  width: min(520px, 92%);
  display: grid;
  gap: 12px;
}

/* Grupo com ícone à esquerda */
.input-group { position: relative; }
.input-group input {
  width: 100%;
  min-height: 48px; /* alvo de toque confortável */
  padding: 14px 48px 14px 48px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 14px;
  font-size: 16px; /* >=16px evita zoom no iOS */
  color: #0b1a3a;
  background: rgba(255,255,255,.9);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  text-align: left;
}
.input-group input::placeholder { color: #9aa7c7; }
.input-group input:focus-visible {
  border-color: #8ec5ff;
  box-shadow: 0 0 0 4px rgba(142, 197, 255, .35);
  background: #fff;
}

/* Ícones dos campos */
.input-icon-left {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; opacity: .75;
}

/* Toggle de senha à direita */
.input-icon {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; cursor: pointer;
  opacity: .9; transition: opacity .2s ease, transform .1s ease;
  touch-action: manipulation;
}
.input-icon:hover { opacity: 1; }
.input-icon:active { transform: translateY(-50%) scale(.97); }

/* Linha do reCAPTCHA (reservada caso reative) */
.captcha-row {
  display: flex; justify-content: center; margin: 4px 0 8px;
}

/* Link “Esqueci minha senha” */
.forgot {
  display: inline-block;
  color: #EAF2FF;
  text-decoration: underline;
  font-size: 14px;
  margin: 4px 0 2px;
}

/* Botão entrar com feedback de loading */
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 8px auto 0;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00C6FF, #0072FF);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(0,0,0,0.25);
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
  min-height: 48px; /* alvo de toque */
  width: 100%; /* mobile: full width por padrão */
}
.btn-login:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-login.is-loading {
  pointer-events: none;
  opacity: .9;
}
.btn-login.is-loading::after {
  content: "";
  width: 16px; height: 16px; margin-left: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.75);
  border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* FOOTER */
.login-footer {
  background: #fff;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
}
.login-footer img { width: 340px; max-width: 92vw; opacity: .9; height: auto; }
.login-footer .legal {
  margin-top: 8px;
  font-size: 14px;
  color: #4b5563;
}

/* ======= Modal ======= */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center; justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-content {
  background: linear-gradient(135deg, #2148C0, #0072FF);
  padding: 24px 28px;
  border-radius: 20px;
  max-width: 360px; width: 96%;
  text-align: center; position: relative;
  color: #fff; box-shadow: 0 18px 36px rgba(0,0,0,0.35);
}
.modal-content p { font-size: 16px; line-height: 1.45; }
.modal-content a { color: #fff; font-weight: 700; text-decoration: underline; }
.close {
  position: absolute; top: 10px; right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff; font-size: 22px; border: 0; cursor: pointer;
  touch-action: manipulation;
}
.close:hover { filter: brightness(1.08); }

/* ======= Preferências do usuário ======= */
@media (prefers-reduced-motion: reduce) {
  .btn-login,
  .input-icon { transition: none; }
  .btn-login.is-loading::after { animation: none; }
}

/* ======= Responsivo ======= */
@media (max-width: 520px) {
  .logo-top { width: 96px; }
  .login-card { padding: 18px 14px; border-radius: 22px; }
  .inline-error { width: 100%; }
}

@media (max-width: 380px) {
  .login-card h1 { font-size: 18px; }
  .login-card p { font-size: 14px; }
  .input-group input { padding: 14px 46px; }
  .input-icon { width: 26px; height: 26px; }
}
