/* ═══════════════════════════════════════════════
   PROJECT AURORA — LOGIN SCREEN (Web / Lara)
   Paleta Oficial HealthTech + Glassmorphism
   Arquivo: aurora-login.css
═══════════════════════════════════════════════ */

/* ── Variáveis da Nova Paleta Aurora ───────────── */
:root {
  --aurora-base:      #3E4EAC; /* Base inferior */
  --aurora-centro:    #9C69E1; /* Centro e topo */
  --aurora-celeste:   #6DA6F2; /* Azul celeste suave */
  --aurora-luzes:     #81EAD8; /* Luzes naturais */
  --aurora-transicao: #C2A4F9; /* Transições */

  /* Componentes RGB (para rgba() sem hardcode) */
  --aurora-base-rgb:      62, 78, 172;
  --aurora-centro-rgb:    156, 105, 225;
  --aurora-celeste-rgb:   109, 166, 242;
  --aurora-luzes-rgb:     129, 234, 216;
  --aurora-transicao-rgb: 194, 164, 249;

  --bg-dark:          #080A1A; /* Fundo principal */

  --glass-bg:         rgba(255, 255, 255, 0.08);
  --glass-border:     rgba(255, 255, 255, 0.15);
  --glass-shadow:     0 8px 48px rgba(0, 0, 0, 0.35);

  --input-bg:         rgba(255, 255, 255, 0.08);
  --input-border:     rgba(255, 255, 255, 0.15);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 40px 16px;
  background: var(--bg-dark);
}

/* ── Fundo: Aurora Boreal animada via CSS ──────── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(var(--aurora-centro-rgb), 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(var(--aurora-celeste-rgb), 0.20) 0%, transparent 55%),
    radial-gradient(ellipse 90% 50% at 50% 80%, rgba(var(--aurora-base-rgb), 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 70% 70% at 10% 80%, rgba(var(--aurora-luzes-rgb), 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #050811 0%, var(--bg-dark) 40%, #03040a 100%);
  animation: auroraShift 12s ease-in-out infinite alternate;
}

/* Estrelas */
.aurora-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 10%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 5%,  rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 20%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 35%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 8%,  rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 5%  50%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 38%, rgba(255,255,255,0.7) 0%, transparent 100%);
}

/* Ondas de luz flutuantes */
.aurora-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 40% at 50% 30%, rgba(var(--aurora-transicao-rgb), 0.10) 0%, transparent 70%);
  animation: auroraWave 8s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0%   { filter: hue-rotate(0deg)   brightness(1.0); }
  50%  { filter: hue-rotate(10deg)  brightness(1.1); }
  100% { filter: hue-rotate(-5deg)  brightness(0.95); }
}

@keyframes auroraWave {
  0%   { transform: scaleX(1)   scaleY(1);   opacity: 0.6; }
  100% { transform: scaleX(1.1) scaleY(1.3); opacity: 1.0; }
}

/* ── Partículas flutuantes ─────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--aurora-luzes-rgb), 0.6), transparent);
  animation: floatParticle linear infinite;
}

.particle:nth-child(1)  { width:3px;  height:3px;  left:10%; animation-duration:18s; animation-delay:0s;   top:80%; }
.particle:nth-child(2)  { width:2px;  height:2px;  left:25%; animation-duration:22s; animation-delay:3s;   top:90%; background: radial-gradient(circle, rgba(var(--aurora-centro-rgb), 0.6), transparent); }
.particle:nth-child(3)  { width:4px;  height:4px;  left:40%; animation-duration:16s; animation-delay:1s;   top:85%; }
.particle:nth-child(4)  { width:2px;  height:2px;  left:60%; animation-duration:24s; animation-delay:5s;   top:95%; }
.particle:nth-child(5)  { width:3px;  height:3px;  left:75%; animation-duration:20s; animation-delay:2s;   top:88%; }
.particle:nth-child(6)  { width:2px;  height:2px;  left:90%; animation-duration:19s; animation-delay:7s;   top:82%; }
.particle:nth-child(7)  { width:5px;  height:5px;  left:15%; animation-duration:26s; animation-delay:4s;   top:92%; background: radial-gradient(circle, rgba(var(--aurora-celeste-rgb), 0.5), transparent); }
.particle:nth-child(8)  { width:2px;  height:2px;  left:50%; animation-duration:21s; animation-delay:9s;   top:78%; }
.particle:nth-child(9)  { width:3px;  height:3px;  left:82%; animation-duration:17s; animation-delay:6s;   top:96%; }
.particle:nth-child(10) { width:2px;  height:2px;  left:35%; animation-duration:23s; animation-delay:11s;  top:87%; background: radial-gradient(circle, rgba(var(--aurora-transicao-rgb), 0.6), transparent); }

@keyframes floatParticle {
  0%   { transform: translateY(0)      translateX(0);    opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* ── Card principal (vidro) ────────────────────── */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 16px;
  margin: auto;
  animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 36px 30px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}

/* ── Logo / Header ─────────────────────────────── */
.logo-area {
  text-align: center;
  margin-bottom: 24px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--aurora-celeste), var(--aurora-centro));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(var(--aurora-celeste-rgb), 0.4);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.logo-title {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* ── Seletor de Perfil (3 Perfis: Paciente | Cuidador | Clínica & Hospital) ── */
.profile-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px;
}

.profile-btn {
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  position: relative;
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  line-height: 1.2;
}

.profile-btn.active {
  background: rgba(var(--aurora-centro-rgb), 0.28);
  border: 1px solid rgba(var(--aurora-centro-rgb), 0.55);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(var(--aurora-centro-rgb), 0.25);
}

.profile-btn[data-perfil="CLINICA"].active {
  background: rgba(0, 242, 254, 0.18);
  border: 1px solid rgba(0, 242, 254, 0.5);
  color: #81EAD8;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.2);
}

.profile-btn[data-perfil="PACIENTE"].active {
  background: rgba(109, 166, 242, 0.22);
  border: 1px solid rgba(109, 166, 242, 0.5);
  color: #BAE6FD;
  box-shadow: 0 4px 16px rgba(109, 166, 242, 0.2);
}

.profile-btn[data-perfil="CUIDADOR"].active {
  background: rgba(194, 164, 249, 0.22);
  border: 1px solid rgba(194, 164, 249, 0.5);
  color: #E2D3FD;
  box-shadow: 0 4px 16px rgba(194, 164, 249, 0.2);
}

.profile-btn:not(.active):hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.profile-btn .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-btn .btn-icon svg {
  width: 16px;
  height: 16px;
  color: inherit;
}

.profile-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .profile-selector {
    gap: 4px;
    padding: 3px;
  }
  .profile-btn {
    flex-direction: column;
    font-size: 11px;
    padding: 8px 3px;
    gap: 3px;
    line-height: 1.15;
  }
  .profile-btn .btn-icon svg {
    width: 15px;
    height: 15px;
  }
  .profile-title {
    white-space: normal;
    text-align: center;
    word-break: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ── Banner contextual de perfil ─────────────── */
.profile-info-banner {
  margin-top: 0;
  margin-bottom: 16px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 100%;
}

.info-badge.clinica {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.35);
  color: #81EAD8;
  box-shadow: 0 2px 12px rgba(0, 242, 254, 0.12);
}

.info-badge.cuidador {
  background: rgba(194, 164, 249, 0.1);
  border-color: rgba(194, 164, 249, 0.35);
  color: #E2D3FD;
  box-shadow: 0 2px 12px rgba(194, 164, 249, 0.12);
}

.info-badge.paciente {
  background: rgba(109, 166, 242, 0.1);
  border-color: rgba(109, 166, 242, 0.35);
  color: #BAE6FD;
  box-shadow: 0 2px 12px rgba(109, 166, 242, 0.12);
}

.info-badge-icon {
  flex-shrink: 0;
}

/* ── Help link contextual ─────────────────────── */
.contextual-help {
  margin-top: 10px;
  margin-bottom: 6px;
  text-align: center;
}

.help-link-clinica {
  font-size: 12px;
  color: #81EAD8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 8px;
}

.help-link-clinica:hover {
  color: #ffffff;
  background: rgba(0, 242, 254, 0.1);
  text-decoration: underline;
}

/* ── Label de seção ────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 16px;
}

/* ── Campos de Input ───────────────────────────── */
.input-group {
  position: relative;
  margin-bottom: 14px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

.input-field {
  width: 100%;
  padding: 13px 14px 13px 42px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: all 0.25s ease;
}

.input-field::placeholder {
  color: rgba(255,255,255,0.30);
  font-weight: 300;
}

.input-field:focus {
  border-color: var(--aurora-celeste);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(var(--aurora-celeste-rgb), 0.15);
}

.input-group:focus-within .input-icon {
  opacity: 0.75;
}

/* Ícone da senha (toggle) */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s;
  background: none;
  border: none;
  padding: 0;
  display: flex;
}
.toggle-password:hover { opacity: 0.7; }

/* ── Link esqueci senha ────────────────────────── */
.forgot-link {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 20px;
}

.forgot-link a {
  font-size: 12px;
  color: var(--aurora-luzes);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.forgot-link a:hover { opacity: 1; }

/* ── Botão principal Entrar ────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--aurora-centro), var(--aurora-base));
  color: white;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(var(--aurora-base-rgb), 0.40);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--aurora-celeste), var(--aurora-centro));
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(var(--aurora-celeste-rgb), 0.35);
}

.btn-primary:active { transform: translateY(0); }

/* Efeito shimmer no hover */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn-primary:hover::after { transform: translateX(100%); }

/* Loading state */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn-primary .btn-text { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-arrow { font-style: normal; font-size: 18px; transition: transform 0.2s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ── Divisor ───────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.10);
}

.divider-text {
  font-size: 12px;
  color: rgba(255,255,255,0.30);
  font-weight: 300;
}

/* ── Botões secundários ────────────────────────── */
.btn-google {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.80);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  margin-bottom: 12px;
}

.btn-google:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-register {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(var(--aurora-celeste-rgb), 0.30);
  border-radius: 12px;
  background: transparent;
  color: var(--aurora-celeste);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.btn-register:hover {
  background: rgba(var(--aurora-celeste-rgb), 0.08);
  border-color: rgba(var(--aurora-celeste-rgb), 0.55);
  transform: translateY(-1px);
}

/* ── Toast de feedback ─────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(8, 10, 26, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 20px;
  color: white;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  backdrop-filter: blur(12px);
  z-index: 999;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast.show  { transform: translateX(-50%) translateY(0); }
.toast.error   { border-color: rgba(239, 68,  68,  0.4); }
.toast.success { border-color: rgba(var(--aurora-luzes-rgb), 0.4); }

/* ── Rodapé ────────────────────────────────────── */
.card-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: rgba(255,255,255,0.20);
  letter-spacing: 0.3px;
}

/* ── Acessibilidade / Responsivo ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .login-wrapper {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

@media (max-width: 480px) {
  body { overflow: auto; }
  .glass-card { padding: 32px 20px; border-radius: 20px; }
  .logo-title { font-size: 20px; }
}

/* ── Escalonamento Padronizado de Logos ─────────────────── */
.logo-sm { max-width: 90px; height: auto; }
.logo-md { max-width: 140px; height: auto; }
.logo-lg { max-width: 200px; height: auto; }
.logo-splash { 
    max-width: 250px;
    height: auto; 
    filter: drop-shadow(0px 4px 12px rgba(0,0,0,0.5));
}

/* Ajuste responsivo para telas menores */
@media (max-width: 768px) {
    .logo-splash { max-width: 180px; }
    .logo-lg { max-width: 160px; }
}

/* ── Scrollbar Suave Aurora ────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #080A1A;
}
::-webkit-scrollbar-thumb {
  background: rgba(156, 105, 225, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 105, 225, 0.7);
}