/**
 * AI Coach Pro — Auth Premium (login + registro)
 * ================================================
 * Split-screen: painel de marca à esquerda (atmosfera aurora, prova
 * social), formulário à direita. No mobile o painel some e o form
 * ocupa a tela — comportamento atual preservado.
 *
 * Identidade teal do site (não Copa). Carregar DEPOIS de theme.css
 * e dos estilos inline da página.
 */

/* ========== SHELL ========== */
@media (min-width: 1024px) {
  .main-container {
    display: grid !important;
    grid-template-columns: minmax(420px, 560px) minmax(420px, 480px);
    gap: 0;
    align-items: stretch !important;
    justify-content: center !important;
    padding: 2.5rem !important;
  }

  /* O card do form vira a metade direita do conjunto */
  .main-container .form-card {
    max-width: none !important;
    border-radius: 0 28px 28px 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Sem painel (tela de acesso rápido do lembrar-me), card fica normal */
  .main-container:not(:has(.auth-side)) {
    display: flex !important;
  }
  .main-container:not(:has(.auth-side)) .form-card {
    max-width: 440px !important;
    border-radius: 28px !important;
  }

  /* Com o painel de marca ao lado, o logo grande do form é redundante */
  .auth-side + .form-card .logo-container {
    display: none;
  }
  .auth-side + .form-card .form-title {
    margin-top: 0;
  }
}

/* ========== PAINEL DE MARCA ========== */
.auth-side {
  display: none;
  position: relative;
  overflow: hidden;
  border-radius: 28px 0 0 28px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(79, 209, 197, 0.16), transparent 55%),
    radial-gradient(70% 60% at 90% 90%, rgba(104, 211, 145, 0.10), transparent 55%),
    radial-gradient(60% 50% at 70% 30%, rgba(99, 179, 237, 0.07), transparent 60%),
    linear-gradient(160deg, #0b0b1e 0%, #10102a 55%, #0d0d22 100%);
  border: 1px solid rgba(79, 209, 197, 0.14);
  border-right: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 1024px) {
  .auth-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3rem 2.5rem;
  }
}

/* Textura de pontos sutil */
.auth-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(240, 240, 255, 0.05) 1px, transparent 1.4px);
  background-size: 22px 22px;
  pointer-events: none;
}

/* Aurora viva */
.auth-side::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.16), transparent 65%);
  top: -140px; right: -120px;
  filter: blur(10px);
  animation: authAurora 9s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes authAurora {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate(-60px, 50px) scale(1.15); opacity: 1; }
}

.auth-side > * { position: relative; z-index: 1; }

/* Topo: logo */
.auth-side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-side__brand img { height: 30px; }

/* Meio: headline + apoio */
.auth-side__main { margin: 2rem 0; }

.auth-side__kicker {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary, #4fd1c5);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-side__kicker::before {
  content: '';
  width: 26px; height: 1px;
  background: var(--primary, #4fd1c5);
}

.auth-side__title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: #f0f0ff;
  margin-bottom: 14px;
}
.auth-side__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary, #4fd1c5), var(--secondary, #68d391));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-side__sub {
  color: rgba(240, 240, 255, 0.55);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}

/* Stats em régua */
.auth-side__stats {
  display: flex;
  gap: 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.5rem;
}
.auth-side__stat {
  flex: 1;
  padding-right: 18px;
}
.auth-side__stat + .auth-side__stat {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-side__stat strong {
  display: block;
  font-family: 'Space Grotesk', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: #f0f0ff;
  line-height: 1;
  margin-bottom: 5px;
}
.auth-side__stat span {
  font-size: 0.7rem;
  color: rgba(240, 240, 255, 0.45);
  line-height: 1.4;
  display: block;
}

/* Base: quote */
.auth-side__quote {
  border-left: 2px solid rgba(79, 209, 197, 0.5);
  padding-left: 16px;
}
.auth-side__quote p {
  color: rgba(240, 240, 255, 0.7);
  font-size: 0.88rem;
  line-height: 1.65;
  font-style: italic;
  margin: 0 0 8px;
}
.auth-side__quote cite {
  font-style: normal;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(240, 240, 255, 0.4);
}
.auth-side__quote cite b {
  color: var(--primary, #4fd1c5);
  font-weight: 700;
}

/* ========== LOGO HORIZONTAL NO CARD ========== */
.auth-logo-h {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto;
  transition: transform .25s ease, filter .25s ease;
}
.auth-logo-h:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 14px rgba(79, 209, 197, 0.35));
}

/* ========== POLISH EXTRA NO FORM ========== */
/* Botão com brilho que varre no hover */
.form-card .btn-primary {
  background: linear-gradient(135deg, var(--primary, #4fd1c5) 0%, var(--secondary, #68d391) 100%) !important;
  color: #0a0a1a !important;
  font-weight: 700 !important;
}
.form-card .btn-primary::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.form-card .btn-primary:hover::after { left: 130%; }

/* Inputs: label flutuante de foco mais viva */
.form-card .form-control:focus {
  border-color: rgba(79, 209, 197, 0.6) !important;
  box-shadow:
    0 0 0 3px rgba(79, 209, 197, 0.12),
    0 0 24px rgba(79, 209, 197, 0.12) !important;
}

/* ========== MOBILE: header compacto de marca acima do card ========== */
@media (max-width: 1023px) {
  .main-container {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
  }

  .auth-side {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(79, 209, 197, 0.14);
    border-bottom: none;
    padding: 1.5rem 1.5rem 1.35rem;
  }

  /* Enxuto: sem logo duplicado (o card tem o dele) e sem quote longa */
  .auth-side__brand { display: none; }
  .auth-side__quote { display: none; }

  .auth-side__main { margin: 0; }

  .auth-side__kicker {
    font-size: 0.6rem;
    margin-bottom: 10px;
  }

  .auth-side__title {
    font-size: 1.3rem;
    line-height: 1.2;
    margin-bottom: 8px;
  }
  .auth-side__title br { display: none; }

  .auth-side__sub {
    font-size: 0.8rem;
    line-height: 1.55;
    max-width: none;
  }

  .auth-side__stats {
    margin-top: 1.1rem;
    padding-top: 1rem;
  }
  .auth-side__stat { padding-right: 12px; }
  .auth-side__stat + .auth-side__stat { padding-left: 12px; }
  .auth-side__stat strong {
    font-size: 1.05rem;
    margin-bottom: 3px;
  }
  .auth-side__stat span {
    font-size: 0.6rem;
    line-height: 1.35;
  }

  /* Card emenda no header — vira uma peça só */
  .auth-side + .form-card {
    max-width: 440px;
    margin: 0 auto;
    border-radius: 0 0 28px 28px !important;
  }
  .auth-side + .form-card::before { display: none; } /* linha animada do topo fica escondida pela emenda */

  /* Logo compacta no card mobile (o header acima já dá contexto de marca) */
  .auth-side + .form-card .logo-container { margin-bottom: 1.1rem; }
  .auth-side + .form-card .auth-logo-h { height: 34px; }
  .auth-side + .form-card .form-section { padding-top: 1.75rem; }
}

/* Telas muito baixas (landscape / SE): header some, form direto */
@media (max-width: 1023px) and (max-height: 640px) {
  .auth-side { display: none; }
  .auth-side + .form-card { border-radius: 28px !important; }
  .auth-side + .form-card::before { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-side::after { animation: none; }
  .form-card .btn-primary::after { display: none; }
}
