/* =====================================================================
   [CDD] Tela de login / cadastro / recuperação (digitacao/login.php)
   Layout split 50/50 ocupando 100vh no desktop, sem rolagem.
   Ver documentation/login.md.

   Tudo fica sob .lg para vencer em especificidade os estilos globais de
   style-typing.css (h1/h2/p com padding, input/button/label genéricos,
   .login_box/.register_box com fundo cinza e sombra, img#logo 250px).
   ===================================================================== */

:root {
  --lg-bg: #f5f7fb;
  --lg-surface: #ffffff;
  --lg-ink: #0f172a;
  --lg-ink-2: #475569;
  --lg-ink-3: #94a3b8;
  --lg-line: #e2e8f0;
  --lg-field: #f8fafc;
  --lg-brand: #1d6fe6;
  --lg-brand-dark: #1557b8;
  --lg-brand-soft: #e8f0fd;
  --lg-accent: #e8336d;
  --lg-radius: 12px;
}

/* ---- Fundo neutro: ignora a cor escolhida no seletor do rodapé ----
   js_background_footer.php aplica body.backgroundColorN via cookie; o seletor
   (#backgroundcolorselect) é só escondido, não removido, porque aquele JS faz
   getElementById(...).addEventListener nele e quebraria sem o elemento. */
body,
body.backgroundColor1,
body.backgroundColor2,
body.backgroundColor3,
body.backgroundColor4 {
  background: var(--lg-bg) !important;
  margin: 0;
}

#backgroundcolorselect,
.lg ~ br,
.lg ~ p {
  display: none !important;
}

.container {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.content {
  padding: 0;
}

/* ---- Estrutura ---- */
.lg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--lg-ink);
  text-align: left;
}

.lg *,
.lg *::before,
.lg *::after {
  box-sizing: border-box;
}

.lg h1,
.lg h2,
.lg h3,
.lg p {
  margin: 0;
  padding: 0;
  text-align: inherit;
  color: inherit;
}

.lg a:link,
.lg a:visited {
  color: var(--lg-brand);
  text-decoration: none;
  font-weight: 500;
}

.lg a:hover,
.lg a:focus {
  color: var(--lg-brand-dark);
  text-decoration: underline;
}

/* ---- Coluna da marca ---- */
.lg-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(29, 111, 230, 0.10), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(232, 51, 109, 0.08), transparent 45%),
    var(--lg-surface);
  border-right: 1px solid var(--lg-line);
}

.lg-brand-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 48px 36px;
}

.lg .lg-logo div#logo {
  width: auto;
  max-height: none;
  margin: 0;
}

.lg .lg-logo img#logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 140px;
  margin: 0;
  object-fit: contain;
}

.lg-pitch {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lg-kicker {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--lg-brand-soft);
  color: var(--lg-brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lg .lg-title {
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lg-ink);
}

.lg-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--lg-brand), var(--lg-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg .lg-subtitle {
  font-size: 16px;
  line-height: 1.55;
  color: var(--lg-ink-2);
}

.lg-subtitle strong {
  color: var(--lg-ink);
}

.lg-tips {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lg-tips li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  background: rgba(255, 255, 255, 0.75);
}

.lg-tip-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--lg-brand-soft);
  font-size: 17px;
}

.lg-tips strong {
  display: block;
  font-size: 14px;
  color: var(--lg-ink);
  line-height: 1.3;
}

.lg-tips small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--lg-ink-2);
  line-height: 1.35;
}

.lg .lg-more {
  font-size: 13px;
  color: var(--lg-ink-3);
}

/* ---- Coluna do formulário ---- */
.lg-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.lg-card {
  width: 100%;
  max-width: 420px;
}

.lg .lg-box {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  max-width: none;
  text-align: left;
}

.lg-head {
  margin-bottom: 22px;
}

.lg .lg-head h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--lg-ink);
}

.lg .lg-head p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lg-ink-2);
}

.lg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lg .lg-field label,
.lg .lg-label-row label {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--lg-ink);
  list-style: none;
}

.lg-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.lg .lg-label-row .lg-link {
  font-size: 13px;
}

.lg .lg-field input,
.lg .lg-field select,
.lg .lg-field select#estado {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--lg-line);
  border-radius: 10px;
  background: var(--lg-field);
  color: var(--lg-ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* select#estado: style-typing.css tem regra com ID (margin-top/padding/radius) — precisa de ID aqui também */
.lg .lg-field select,
.lg .lg-field select#estado {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.lg .lg-field input::placeholder,
.lg .lg-field select:invalid {
  color: var(--lg-ink-3);
}

.lg .lg-field select option {
  color: var(--lg-ink);
}

.lg .lg-field input:focus,
.lg .lg-field select:focus,
.lg .lg-field select#estado:focus {
  outline: none;
  border-color: var(--lg-brand);
  background-color: var(--lg-surface);
  box-shadow: 0 0 0 4px rgba(29, 111, 230, 0.14);
}

.lg .password-field {
  position: relative;
}

.lg .password-field input {
  padding-right: 46px;
}

.lg .toggle-password,
.lg .toggle-password:hover {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lg-ink-3);
  cursor: pointer;
}

.lg .toggle-password:hover,
.lg .toggle-password:focus-visible {
  color: var(--lg-ink);
  background: var(--lg-brand-soft);
}

/* ---- Botões ---- */
.lg .lg-btn {
  display: block;
  width: 100%;
  height: 46px;
  min-width: 0;
  margin: 0;
  padding: 0 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.lg .lg-btn:active {
  transform: translateY(1px);
}

.lg .lg-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.lg .lg-btn-primary {
  margin-top: 4px;
  border: 0;
  background: var(--lg-brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 111, 230, 0.25);
}

.lg .lg-btn-primary:hover {
  background: var(--lg-brand-dark);
}

.lg .lg-btn-ghost {
  border: 1px solid var(--lg-line);
  background: var(--lg-surface);
  color: var(--lg-ink);
}

.lg .lg-btn-ghost:hover {
  border-color: #cbd5e1;
  background: var(--lg-field);
}

.lg .lg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(29, 111, 230, 0.25);
}

/* ---- Divisor, Google, termos ---- */
.lg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--lg-ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lg-divider::before,
.lg-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--lg-line);
}

.lg .google-login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.lg .google-login-box > div[id^="g_id_signin"] {
  min-height: 44px;
}

.lg .google-login-note {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--lg-ink-3);
  text-align: center;
}

.lg .lg-terms,
.lg .lg-switch {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--lg-ink-2);
  text-align: center;
}

.lg .lg-switch {
  font-size: 14px;
}

/* ---- Cadastro ---- */
.lg-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 18px;
  padding: 0;
}

.lg-facts li {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--lg-brand-soft);
  color: var(--lg-ink-2);
  font-size: 12px;
  line-height: 1.3;
}

.lg-facts strong {
  color: var(--lg-ink);
}

.lg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lg .register_box .lg-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--lg-ink-2);
  cursor: pointer;
}

.lg .lg-check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--lg-brand);
}

.lg .lg-check em {
  font-style: normal;
}

/* ---- Alertas de erro.php (span.error / span.info) ---- */
.lg .lg-card span.alert {
  display: block;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.lg .lg-card span.alert.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.lg .lg-card span.alert.info {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

/* ---- Desktop com pouca altura (notebooks 1366x768 / 1280x720) ---- */
@media (min-width: 901px) and (max-height: 820px) {
  .lg-brand-inner {
    padding: 24px 40px 24px;
    gap: 16px;
  }

  .lg .lg-logo img#logo {
    max-width: 180px;
    max-height: 110px;
  }

  .lg-pitch {
    gap: 14px;
  }

  .lg .lg-title {
    font-size: clamp(24px, 2.1vw, 30px);
  }

  .lg .lg-subtitle {
    font-size: 15px;
  }

  .lg-tips li {
    padding: 10px 12px;
  }

  .lg-main {
    padding: 20px 24px;
  }

  .lg-head {
    margin-bottom: 16px;
  }

  .lg .lg-head h2 {
    font-size: 23px;
  }

  .lg-form {
    gap: 11px;
  }

  .lg-grid {
    gap: 10px;
  }

  .lg .lg-field input,
  .lg .lg-field select,
  .lg .lg-field select#estado {
    height: 40px;
  }

  .lg .lg-btn {
    height: 42px;
  }

  .lg-divider {
    margin: 14px 0 10px;
  }

  .lg .lg-terms,
  .lg .lg-switch {
    margin-top: 12px;
  }

  .lg .google-login-note {
    display: none;
  }
}

@media (min-width: 901px) and (max-height: 680px) {
  .lg-tips,
  .lg .lg-subtitle {
    display: none;
  }
}

/* ---- Tablet / celular: empilha, rolagem permitida ---- */
@media (max-width: 900px) {
  .lg {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .lg-brand {
    border-right: 0;
    border-bottom: 1px solid var(--lg-line);
  }

  .lg-brand-inner {
    gap: 14px;
    max-width: 480px;
    padding: 20px 16px;
    align-items: center;
    text-align: center;
  }

  .lg .lg-logo img#logo {
    max-width: 160px;
    max-height: 100px;
  }

  .lg-pitch {
    align-items: center;
  }

  .lg .lg-title {
    font-size: 21px;
  }

  .lg-kicker,
  .lg .lg-subtitle,
  .lg-tips,
  .lg .lg-more {
    display: none;
  }

  .lg-main {
    align-items: flex-start;
    padding: 24px 16px 32px;
  }

  .lg-card {
    max-width: 480px;
  }
}

@media (max-width: 480px) {
  .lg-grid {
    grid-template-columns: 1fr;
  }

  .lg .lg-head h2 {
    font-size: 22px;
  }
}
