/* ============================================
   RaspouGanhou - Login & Cadastro
   ============================================ */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(34, 197, 94, 0.12), transparent),
    var(--bg-primary);
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

.auth-shell-split {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 620px;
}

.auth-visual {
  position: relative;
  background: linear-gradient(160deg, #16A34A 0%, #111315 55%, #191C1F 100%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.auth-visual-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #111315;
}

.auth-main-register .auth-head {
  margin-bottom: 24px;
}

.auth-visual:has(.auth-visual-img) {
  background: #111315;
}

.auth-visual:has(.auth-visual-img) .auth-visual-img {
  object-fit: contain;
}

.auth-visual-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 24px;
  z-index: 1;
}

.auth-visual-content h2 {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.auth-visual-content p {
  font-size: 0.875rem;
  color: rgba(245, 245, 245, 0.85);
  line-height: 1.5;
}

.auth-visual-placeholder {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
}

.auth-visual-placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-light);
}

.auth-visual-placeholder-icon svg {
  width: 36px;
  height: 36px;
}

.auth-visual-placeholder p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: 220px;
  line-height: 1.5;
}

.auth-main {
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 28px 28px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: inherit;
}

.auth-logo:hover {
  color: inherit;
  opacity: 0.9;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green-primary), var(--green-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-green);
}

.auth-logo-icon svg {
  width: 22px;
  height: 22px;
}

.auth-logo-text {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-logo-raspou { color: var(--text-primary); }
.auth-logo-ganhou { color: var(--green-primary); }

.auth-logo-image {
  justify-content: flex-start;
}

.auth-logo-img {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(280px, 80vw);
  object-fit: contain;
}

.auth-head {
  margin-bottom: 24px;
}

.auth-head h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-head p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form .btn-block {
  margin-top: 8px;
}

.auth-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 0.8125rem;
  line-height: 1.4;
  display: none;
}

.auth-error.visible {
  display: block;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  font-weight: 600;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  cursor: pointer;
}

.auth-terms input {
  margin-top: 3px;
  accent-color: var(--green-primary);
  flex-shrink: 0;
}

.auth-terms a {
  color: var(--green-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-terms a:hover {
  color: var(--green-light);
}

/* Página legal — Termos e Políticas */
.legal-page-wrap {
  align-items: flex-start;
  padding: 24px 16px 48px;
}

.legal-page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow-lg);
}

.legal-page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.legal-page-header h1 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.legal-updated {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legal-doc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-doc section {
  margin-bottom: 28px;
}

.legal-doc h2 {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.legal-doc p {
  margin-bottom: 12px;
}

.legal-doc ul {
  margin: 0 0 12px 1.25rem;
  padding: 0;
}

.legal-doc li {
  margin-bottom: 6px;
}

.legal-doc a {
  color: var(--green-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc a:hover {
  color: var(--green-light);
}

.legal-lead {
  font-size: 1rem;
  color: var(--text-primary);
}

.legal-section-highlight,
.legal-notice {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
}

.legal-notice ul {
  list-style: none;
  margin-left: 0;
}

.legal-notice li {
  margin-bottom: 10px;
}

.legal-tagline {
  margin-top: 16px;
  margin-bottom: 0;
  color: var(--green-primary);
}

.legal-page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.legal-page-footer .btn {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 640px) {
  .legal-page {
    padding: 22px 18px 28px;
  }

  .legal-page-footer {
    flex-direction: column;
  }

  .legal-page-footer .btn {
    width: 100%;
  }
}

.auth-back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.auth-back-home:hover {
  color: var(--green-primary);
}

.auth-back-home svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 860px) {
  .auth-shell-split {
    grid-template-columns: 1fr;
    max-width: 420px;
    min-height: auto;
  }

  .auth-visual {
    min-height: 200px;
    max-height: 240px;
  }

  .auth-main {
    padding: 28px 24px 24px;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    align-items: flex-start;
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .auth-shell,
  .auth-shell-split {
    max-width: 100%;
    width: 100%;
  }

  .auth-card {
    padding: 28px 20px 22px;
  }

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

  .auth-form .form-input {
    font-size: 16px;
  }
}
