*, *::before, *::after { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════════════
   Layout a due colonne — pagine login e register
   ══════════════════════════════════════════════════════════════ */

.auth-body {
  margin: 0;
  min-height: 100vh;
  background: #f0f2f5;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: #333;
}

.auth-page {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: 100vh;
}

/* ── Colonna sinistra: form ── */
.auth-left {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
  box-shadow: 4px 0 24px rgba(0,0,0,.08);
}

.auth-inner {
  width: 100%;
  max-width: 380px;
}

/* ── Colonna destra: slider ── */
.auth-slider {
  position: relative;
  overflow: hidden;
  background: #1a1040;
}

.auth-slider-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.auth-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
  background: var(--slide-bg, #1a1040);
}

.auth-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Media: immagine */
.auth-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Media: video iframe */
.auth-slide-media {
  position: absolute;
  inset: 0;
}

.auth-slide-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Overlay testo sopra media */
.auth-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,5,30,.85) 40%, rgba(10,5,30,.15) 100%);
  display: flex;
  align-items: flex-end;
  padding: 48px 40px;
}

.auth-slide-content { color: #fff; max-width: 490px; }

.auth-slide-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.3;
  text-wrap: balance;
}

.auth-slide-text {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 20px;
  color: rgba(255,255,255,.82);
}

.auth-slide-cta {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background .15s;
}

.auth-slide-cta:hover { background: #6d28d9; }

/* Dots carousel */
.auth-slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}

.auth-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

/* Logo watermark in alto */
.auth-slider-logo {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 10;
}

.auth-slider-logo img {
  height: 50px;
  width: auto;
  opacity: .7;
  filter: brightness(0) invert(1);
}

/* Fallback senza slide: nasconde colonna destra */
.auth-page:not(:has(.auth-slider)) {
  grid-template-columns: 1fr;
}

/* Responsive: sotto 768px colonna destra nascosta */
@media (max-width: 768px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-slider {
    display: none;
  }
  .auth-left {
    box-shadow: none;
    min-height: 100vh;
  }
}

/* ── Pagine messaggio (verifica email, controlla email) ── */
.auth-message-box {
  max-width: 480px;
  margin: 80px auto;
  padding: 0 20px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  background-color: #fff;
}

.auth-message-icon { font-size: 3rem; margin-bottom: 16px; }

.auth-message-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 10px;
}

.auth-message-title--error { color: #dc2626; }

.auth-message-text {
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}

.auth-message-hint {
  color: #94a3b8;
  font-size: .82rem;
  margin: 0;
}

.auth-btn {
  display: inline-block;
  background: #4f46e5;
  color: white;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 8px;
}

.auth-btn:hover { opacity: .9; }

.auth-link { color: #4f46e5; }

.auth-back-link {
  display: inline-block;
  margin-top: 24px;
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
}

/* Pagine messaggio usano body generico (no .auth-body) */
body:not(.auth-body) {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #333;
}

.auth-container {
  max-width: 420px;
  margin: 60px auto;
  padding: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo img {
  height: 48px;
  width: auto;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

.auth-logo p {
  color: #6b7280;
  margin: 0;
  font-size: 0.875rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #111;
}

.form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: #4f46e5;
  color: white;
  margin-top: 8px;
}

.btn-primary:hover { background: #4338ca; }

.btn-google {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 500;
}

.btn-google:hover { background: #f9fafb; }

.btn-google svg { flex-shrink: 0; }

.divider {
  text-align: center;
  color: #9ca3af;
  font-size: 0.8rem;
  margin: 20px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e5e7eb;
}

.divider span {
  background: white;
  padding: 0 14px;
  position: relative;
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Honeypot anti-bot: visivamente fuori schermo, ignorato da utenti reali */
.auth-bot-trap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #4f46e5;
}

.checkbox-group label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 400;
  margin: 0;
}

.checkbox-group a { color: #4f46e5; }

.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.875rem;
  color: #6b7280;
}

.auth-forgot-link{
    color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  margin-top: 8px;
  display: inline-block;
  font-size: .9rem;
}

.auth-footer a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }
