/* ============================================================
   ClubMasSalud - auth.css
   Estilos das páginas de autenticação (login, cadastro, recuperar senha)
   ============================================================ */

body.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
body.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(14,165,233,.2) 0%, transparent 70%);
  pointer-events: none;
}
body.auth-page::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,.15) 0%, transparent 70%);
  pointer-events: none;
}

/* Partículas decorativas */
.auth-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.auth-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* ── Wrapper principal ──────────────────────────────────── */
.auth-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}

/* ── Logo no topo ────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.auth-logo img {
  height: 52px;
  filter: drop-shadow(0 4px 12px rgba(14,165,233,.4));
}
.auth-logo-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .01em;
}
.auth-logo-tagline {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  font-weight: 500;
}

/* ── Card de autenticação ────────────────────────────────── */
.auth-card {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 32px 64px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.15);
  overflow: hidden;
}
.auth-card-header {
  padding: 28px 32px 0;
  text-align: center;
}
.auth-card-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}
.auth-card-header p {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
}
.auth-card-body { padding: 24px 32px 32px; }

/* ── Seletor de portal (login) ───────────────────────────── */
.portal-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.portal-option {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  background: #f8fafc;
  position: relative;
}
.portal-option:hover {
  border-color: #0ea5e9;
  background: #eff6ff;
  transform: translateY(-2px);
}
.portal-option.selected {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  box-shadow: 0 4px 12px rgba(14,165,233,.2);
}
.portal-option.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 6px; right: 8px;
  font-size: .65rem;
  color: #0ea5e9;
}
.portal-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 8px;
  transition: all .25s;
}
.portal-option:hover .portal-icon,
.portal-option.selected .portal-icon {
  transform: scale(1.1);
}
.portal-icon.membro   { background: #eff6ff; color: #0ea5e9; }
.portal-icon.prestador{ background: #f0fdf4; color: #10b981; }
.portal-icon.captador { background: #fff7ed; color: #f59e0b; }
.portal-icon.admin    { background: #fef2f2; color: #ef4444; }
.portal-label {
  font-size: .78rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.portal-sublabel {
  font-size: .65rem;
  color: #94a3b8;
}
.portal-option.selected .portal-label { color: #0284c7; }

/* ── Formulário de login ─────────────────────────────────── */
.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
}
.auth-form .form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: .9rem;
  color: #0f172a;
  background: #fff;
  transition: all .2s;
  outline: none;
}
.auth-form .form-control:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.auth-form .form-control::placeholder { color: #94a3b8; }

/* Input com ícone */
.auth-input-group { position: relative; }
.auth-input-group .form-control { padding-left: 42px; }
.auth-input-group .input-icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .9rem;
  pointer-events: none;
}
.auth-input-group .input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .9rem;
  cursor: pointer;
  transition: color .2s;
  background: none;
  border: none;
  padding: 0;
}
.auth-input-group .input-icon-right:hover { color: #0ea5e9; }

/* Row de opções */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: .8rem;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #475569;
}
.auth-remember input { accent-color: #0ea5e9; cursor: pointer; }
.auth-forgot {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
}
.auth-forgot:hover { text-decoration: underline; }

/* Botão submit */
.btn-auth {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(14,165,233,.3);
}
.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(14,165,233,.4);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth.loading { pointer-events: none; opacity: .8; }

/* Footer do card */
.auth-card-footer {
  padding: 16px 32px 24px;
  text-align: center;
  border-top: 1px solid #f1f5f9;
}
.auth-card-footer p {
  font-size: .83rem;
  color: #64748b;
  margin: 0;
}
.auth-card-footer a {
  color: #0ea5e9;
  font-weight: 700;
  text-decoration: none;
}
.auth-card-footer a:hover { text-decoration: underline; }

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #94a3b8;
  font-size: .75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ── Formulário de cadastro ──────────────────────────────── */
.register-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.register-type-option {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f8fafc;
}
.register-type-option:hover { border-color: #0ea5e9; }
.register-type-option.selected {
  border-color: #0ea5e9;
  background: #eff6ff;
}
.register-type-option i { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.register-type-option.selected i { color: #0ea5e9; }
.register-type-option span { font-size: .78rem; font-weight: 600; color: #374151; }

/* Cupom de desconto */
.coupon-field { position: relative; }
.coupon-status {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .78rem;
  font-weight: 600;
}
.coupon-status.valid { color: #10b981; }
.coupon-status.invalid { color: #ef4444; }
.coupon-info-box {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .78rem;
  color: #15803d;
  margin-top: 6px;
  display: none;
}
.coupon-info-box.show { display: flex; align-items: center; gap: 6px; }

/* Termos */
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .8rem;
  color: #475569;
  line-height: 1.5;
}
.terms-check input { margin-top: 2px; accent-color: #0ea5e9; cursor: pointer; }
.terms-check a { color: #0ea5e9; font-weight: 600; }

/* ── Password strength ───────────────────────────────────── */
.password-strength { margin-top: 6px; }
.strength-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: all .3s;
}
.strength-fill.weak   { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: #10b981; }
.strength-text { font-size: .7rem; color: #64748b; }

/* ── Recuperar senha ─────────────────────────────────────── */
.auth-icon-hero {
  text-align: center;
  margin-bottom: 20px;
}
.auth-icon-hero i {
  font-size: 3rem;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Flash messages na auth ──────────────────────────────── */
.auth-flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-flash.success { background: #dcfce7; color: #15803d; }
.auth-flash.error   { background: #fee2e2; color: #dc2626; }
.auth-flash.info    { background: #eff6ff; color: #1d4ed8; }

/* ── Responsive auth ─────────────────────────────────────── */
@media (max-width: 520px) {
  body.auth-page { padding: 16px; }
  .auth-card-header { padding: 24px 20px 0; }
  .auth-card-body   { padding: 20px 20px 28px; }
  .auth-card-footer { padding: 14px 20px 20px; }
  .portal-selector  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .auth-logo-name   { font-size: 1.1rem; }
  .auth-options     { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 360px) {
  .portal-selector { grid-template-columns: 1fr 1fr; }
  .portal-option { padding: 10px 6px; }
  .portal-icon { width: 36px; height: 36px; font-size: 1rem; }
}
