/* ============================================
   ASTRORACOLO - Pagine di Autenticazione
   (login, registrazione, password dimenticata,
   reimpostazione password)
   Palette coerente con il design system elegant v3:
   crema + verde scuro + oro.
   Questo file va caricato SOLO dai template auth.
   ============================================ */

/* ---------- Sezione e contenitore ---------- */

.auth-section {
  padding: 3rem 1rem;
  background: var(--bg-primary);
  min-height: calc(100vh - 420px);
}

.auth-container {
  max-width: 960px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

/* ---------- Header ---------- */

.auth-header {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(212, 168, 67, 0.3) 0%, transparent 55%),
    linear-gradient(135deg, var(--dark-teal) 0%, var(--dark-teal-light) 100%);
  padding: 2.5rem 2rem;
  text-align: center;
}

.auth-header h1 {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-header p,
.auth-header .lead {
  color: rgba(245, 240, 232, 0.85);
  font-size: 1.1rem;
  margin: 0;
}

/* ---------- Alert (dentro il contenitore) ---------- */

.auth-container > .alert {
  margin: 1.5rem 2rem 0;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-weight: 500;
}

.alert-error,
.alert-danger {
  background: #fdecec;
  border: 1px solid #f5c2c7;
  color: #991b1b;
}

.alert-success {
  background: #eefaf1;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

/* ---------- Layout a due colonne ---------- */

.auth-form-container {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
}

.auth-form {
  padding: 2.5rem;
  border-right: 1px solid #eae2d2;
  background: #ffffff;
  margin: 0;
}

/* ---------- Form ---------- */

.form-group {
  margin-bottom: 1.4rem;
  position: relative;
}

.form-group label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #d8cbb3;
  border-radius: 10px;
  font-size: 1rem;
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input::placeholder {
  color: #a39a86;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.form-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.forgot-password-link {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: block;
  text-align: right;
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent-gold);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
  margin: 0;
  color: var(--text-secondary);
}

.form-actions {
  margin-top: 1.75rem;
}

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 48px;
}

.auth-form .btn-primary {
  background: linear-gradient(135deg, var(--dark-teal) 0%, var(--dark-teal-light) 100%);
  color: #ffffff;
  width: 100%;
  padding: 1rem;
}

.auth-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid #d8cbb3;
}

.btn-secondary:hover {
  background: #f0e9db;
  color: var(--text-primary);
}

.btn-loading {
  display: none;
  align-items: center;
  gap: 8px;
}

/* ---------- Divider e Google ---------- */

.divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5dcc8;
}

.divider span {
  padding: 0 0.75rem;
}

.btn-google {
  background: #ffffff;
  border: 1px solid #d8cbb3;
  color: var(--text-primary);
  width: 100%;
}

.btn-google:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Footer del form ---------- */

.auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eae2d2;
}

.auth-footer p {
  margin: 0.4rem 0;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ---------- Colonna features ---------- */

.auth-features {
  padding: 2.5rem 2rem;
  background: linear-gradient(160deg, rgba(184, 134, 11, 0.07) 0%, rgba(212, 168, 67, 0.02) 100%);
}

.auth-features h3 {
  color: var(--dark-teal);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(184, 134, 11, 0.12);
}

.features-list li:last-child {
  border-bottom: none;
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1.3;
}

.feature-text h4 {
  margin: 0 0 0.25rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.feature-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-illustration {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(184, 134, 11, 0.15);
}

.login-illustration p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Password dimenticata ---------- */

.form-description {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.09) 0%, rgba(212, 168, 67, 0.03) 100%);
  border-radius: 10px;
  border-left: 4px solid var(--accent-gold);
}

.form-description p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.process-steps {
  margin: 1.5rem 0;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h4 {
  margin: 0 0 0.35rem;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.step-content p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.92rem;
}

.security-notice {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.4rem;
  margin: 1.5rem 0;
}

.security-notice h4 {
  color: var(--dark-teal);
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.security-features {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.security-features li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.help-tip {
  background: rgba(184, 134, 11, 0.08);
  padding: 0.9rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.9rem;
}

.help-tip ul {
  margin: 0.5rem 0 0 1.1rem;
  padding: 0;
}

.help-tip li {
  margin-bottom: 0.25rem;
}

.contact-support {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-light);
  text-align: center;
}

.contact-support h4 {
  color: var(--text-primary);
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
}

.contact-support p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.support-button {
  margin: 1rem 0;
}

.support-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0 !important;
}

/* ---------- Animazioni ---------- */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .auth-section {
    padding: 2rem 0.75rem;
  }

  .auth-form-container {
    grid-template-columns: 1fr;
  }

  .auth-form {
    border-right: none;
    border-bottom: 1px solid #eae2d2;
    padding: 2rem 1.5rem;
  }

  .auth-features {
    padding: 2rem 1.5rem;
  }

  .auth-header {
    padding: 2rem 1.5rem;
  }

  .auth-header h1 {
    font-size: 1.8rem;
  }

  .step-item {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .step-number {
    margin-bottom: 0.5rem;
  }
}
