/* =========================================
   auth.css — Estilo unificado (glass)
   Telas: login, cadastro, esqueci e resetar senha
   ========================================= */

:root {
  /* Cores base */
  --bg: #0b1220;
  --text: #eaf2ff;
  --muted: #9fb0c8;

  /* Marca */
  --brand-1: #4facfe;
  --brand-2: #00f2fe;
  --brand-grad: linear-gradient(120deg, var(--brand-1), var(--brand-2));

  /* Componentes */
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  /* Inputs */
  --input-bg: rgba(255,255,255,.08);
  --input-bd: rgba(255,255,255,.18);
  --ph: #b8c4da;

  /* Abas */
  --tab-active: #4facfe;
  --tab-muted: #bfc9dd;
  --tab-divider: rgba(255,255,255,.12);
}

/* Reset básico */
* { box-sizing: border-box; }
html, body { min-height: 100vh; }
body {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(0,242,254,.12), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(79,172,254,.12), transparent 60%),
    var(--bg);
  margin: 0;
  display: block;         /* evita corte no topo quando o card é alto */
  padding: 24px;
  overflow-y: auto;
}

/* Shell e Card (glass) */
.auth-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 6px;
}
.auth-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 40px);
  box-shadow: var(--shadow);
  margin: 16px 0;         /* respiro topo/rodapé */
}
.auth-card::before {
  content: "";
  position: absolute; inset: -8px;
  border-radius: calc(var(--radius-lg) + 8px);
  border: 2px solid rgba(180,210,255,.28);
  transform: rotate(-1.5deg) skewX(-2deg);
  pointer-events: none;
}

/* Header */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center; /* CENTRALIZA */
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 18px;
  white-space: nowrap;      /* NÃO QUEBRA LINHA */
}
.auth-logo i { color: var(--brand-1); }
.auth-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}
.auth-sub {
  margin: 0 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: .98rem;
}

/* Abas: “texto com sublinhado” */
.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: -4px 0 18px 0;
  border-bottom: 1px solid var(--tab-divider);
}
.auth-tab {
  position: relative;
  padding: 10px 4px 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--tab-muted);
  transition: color .2s ease;
}
.auth-tab:hover { color: #d9e4ff; }
.auth-tab.active { color: var(--tab-active); }
.auth-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px; background: transparent; border-radius: 3px;
  transition: background .2s ease;
}
.auth-tab.active::after { background: var(--tab-active); }

/* Formulários */
.auth-form .field { margin-bottom: 16px; }
.auth-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 10px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-bd);
  font-size: 15px;
  transition: border .25s ease, box-shadow .25s ease;
}
.auth-input::placeholder { color: var(--ph); }
.auth-input:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 2px rgba(79,172,254,.25);
}

/* Botão primário */
.btn-primary {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand-grad);
  color: #0b1525;
  margin-top: 6px;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 25px rgba(79,172,254,.30);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(79,172,254,.40);
}
.btn-primary[disabled] { opacity:.65; cursor:not-allowed; }

/* Mensagens */
.msg {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  display: none;
}
.msg.ok {
  background: rgba(0,255,170,.12);
  border: 1px solid rgba(0,255,170,.35);
  color: #eafff5;
  display: block;
}
.msg.err {
  background: rgba(255,120,120,.12);
  border: 1px solid rgba(255,120,120,.35);
  color: #ffecec;
  display: block;
}
.msg:empty { display: none !important; }

/* Links auxiliares */
.auth-links {
  text-align: center;
  margin-top: 10px;
  font-size: .95rem;
}
.auth-links a { color: var(--brand-1); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Utilidades para grids (DDD/Telefone etc.) */
.inline-row { display: flex; gap: 12px; }
.inline-row .ddd { flex: 0 0 90px; }
.inline-row .fone { flex: 1; }

/* Responsivo base */
@media (max-width: 420px) {
  .inline-row { flex-direction: column; }
  .inline-row .ddd, .inline-row .fone { flex: unset; }
}

/* ===== Ajustes extras para evitar cortes e melhorar responsividade ===== */
@media (max-width: 480px), (max-height: 760px) {
  body {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .auth-card { padding: 24px; margin: 12px 0; }
  .auth-tabs { margin-top: -2px; }
  .auth-logo { font-size: 1.35rem; }       /* um toque menor para caber confortável */
}

/* Desktop largo: mais respiro no topo/rodapé para nunca cortar as abas */
@media (min-width: 992px) {
  body{
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .auth-card{
    margin: 28px 0 44px;
  }
}

/* Fade no rodapé para eliminar qualquer “faixa” */
body::after{
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  pointer-events: none;
  background: linear-gradient(to bottom,
              rgba(11,18,32,0) 0%,
              rgba(11,18,32,0.55) 55%,
              rgba(11,18,32,1) 100%);
  z-index: 0;
}

/* Ajuste reCAPTCHA no mobile estreito */
@media (max-width: 360px) {
  .g-recaptcha { transform: scale(0.90); transform-origin: 0 0; }
  .captcha-wrap { height: 74px; }
}
