/* ============================================================
   MED ANGEL — AUTH CSS · "Doctor House Light"
   Telas de Login, Cadastro, Primeiro Acesso
   Realinhado com o tema claro/índigo do app (achado em auditoria
   QA/UX 06/09/2026: a tela de login era uma TERCEIRA identidade
   visual — foto de centro cirúrgico + dourado sobre preto — que não
   combinava nem com o app (claro/índigo) nem tinha função de
   marketing como a landing. Também havia um bug real de contraste:
   .auth-form-title usava var(--text-primary), que desde a introdução
   do tema claro é um cinza-escuro (#1E293B) — quase ilegível sobre o
   fundo #0D0F17 do painel de formulário antigo.) Reaproveita as
   variáveis do app-theme.css (carregado depois, mesmas var(--brand-*)).
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   Tokens de marca ESCOPADOS à tela de autenticação.

   O app interno usa "Doctor House Light" (branco + índigo, ver
   css/app-theme.css), que sobrescreve o Obsidian Clinic de propósito.
   Mas a tela de login é a ÚLTIMA do percurso de marca, não a primeira
   do app: quem vem da landing precisa reconhecer o mesmo produto.
   Por isso aqui vale o dourado — e só aqui. O tema do app segue
   intacto; a transição é uma porta escura abrindo para uma sala clara.
   ───────────────────────────────────────────────────────────── */
.auth-screen {
  --brand-primary:   #8B6914;
  --brand-secondary: #C9A030;
  --brand-accent:    #E8CC78;
  --brand-gradient:  linear-gradient(135deg, #8B6914 0%, #C9A030 50%, #E8CC78 100%);
  --gold:            #C9A030;
  --gold-light:      #E8CC78;
  --gold-gradient:   linear-gradient(135deg, #8B6914 0%, #C9A030 45%, #E8CC78 100%);
  --gold-border:     rgba(201, 160, 48, 0.22);
  --gold-dim:        rgba(201, 160, 48, 0.10);
  /* --border é usado em estilo inline dentro do seletor de perfil */
  --border:          rgba(201, 160, 48, 0.16);
  --border-hover:    rgba(201, 160, 48, 0.40);
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  background: var(--bg-base, #EEF2FF);
}

/* ─────────────────────────────────────────────────────────────
   Painel de marca — Obsidian Clinic, a mesma identidade da landing.
   Era um gradiente índigo (#4F46E5→#818CF8) que não existe em lugar
   nenhum do produto: quem vinha do site batia numa marca diferente
   no passo seguinte. A porta é escura; a sala (o app) é clara.
   ───────────────────────────────────────────────────────────── */
.auth-brand-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;      /* coluna à esquerda, não tudo centralizado */
  justify-content: center;
  padding: var(--space-3xl) clamp(32px, 6vw, 88px);
  position: relative;
  z-index: 1;
  background: #08090E;
}
/* Halo dourado muito baixo — dá profundidade sem virar gradiente de SaaS */
.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(201, 160, 48, 0.10), transparent 58%),
    linear-gradient(180deg, #0D0F17 0%, #08090E 100%);
}
.auth-brand-panel > * { position: relative; z-index: 1; }

/* Filete dourado na divisa dos dois painéis */
.auth-brand-panel::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(201, 160, 48, 0.45), transparent);
  z-index: 2;
}

.auth-brand-logo {
  width: 54px;
  height: 54px;
  margin-bottom: var(--space-lg);
}

.auth-brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 600;
  color: #EDE9E0;
  margin-bottom: 10px;
  text-align: left;
  letter-spacing: -0.015em;
  line-height: 1;
}

.auth-brand-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  color: #C9A030;
  font-size: clamp(1.0625rem, 1.7vw, 1.375rem);
  font-weight: 500;
  text-align: left;
  max-width: 22ch;
  line-height: 1.35;
}

.auth-brand-features {
  margin-top: clamp(28px, 5vh, 52px);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 30rem;
  border-top: 1px solid rgba(201, 160, 48, 0.22);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(201, 160, 48, 0.14);
  transition: border-color 0.25s;
}
.auth-feature:hover { border-bottom-color: rgba(201, 160, 48, 0.4); }

.auth-feature-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8B6914;
}
.auth-feature-icon .icon,
.auth-feature-icon svg { width: 16px; height: 16px; }

.auth-feature span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  font-weight: 400;
  color: #8A8479;
  line-height: 1.45;
}
.auth-feature:hover span { color: #EDE9E0; }

/* Right panel — form, branco como o resto do app */
.auth-form-panel {
  width: 460px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  background: #FFFFFF;
  border-left: 1px solid rgba(201, 160, 48, 0.18);
  position: relative;
  z-index: 1;
  overflow-y: auto;
}
.auth-form-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201, 160, 48, 0.55), transparent);
}

.auth-form-container {
  width: 100%;
  max-width: 380px;
}

.auth-form-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.auth-form-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-xl);
}

/* Password field */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-control {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--transition);
}
.password-toggle:hover { color: var(--text-secondary); }

/* Auth submit button */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--brand-gradient);
  color: white;
  border-radius: var(--radius-lg);
  letter-spacing: 0.03em;
  margin-top: var(--space-sm);
  box-shadow: 0 4px 20px rgba(201, 160, 48, 0.28);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.auth-submit-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
.auth-submit-btn:hover::after { left: 100%; }
.auth-submit-btn:hover { opacity: 0.95; transform: translateY(-1px); }

/* Role selector */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.role-option {
  position: relative;
}
.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.role-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.role-option label span:first-child { font-size: 1.5rem; }
.role-option label span:last-child {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.role-option input:checked + label {
  border-color: var(--brand-secondary);
  background: rgba(201, 160, 48, 0.07);
  box-shadow: 0 0 0 2px rgba(201, 160, 48, 0.22);
}
.role-option input:checked + label span:last-child { color: var(--brand-secondary); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* First access step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition);
}
.step-dot.active {
  background: var(--brand-accent);
  width: 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(201, 160, 48, 0.45);
}
.step-dot.done { background: var(--success); }

/* Photo upload */
.photo-upload-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 auto var(--space-md);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  background: var(--bg-input);
}
.photo-upload-circle:hover {
  border-color: var(--brand-secondary);
  background: rgba(201, 160, 48, 0.05);
}
.photo-upload-circle input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}
.photo-upload-circle img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── Profile Selector ─────────────────────────────────────── */

.profile-selector-panel {
  width: 520px;
  padding: var(--space-3xl) var(--space-2xl);
}

.profile-selector-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.profile-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  animation: cardSlideIn 0.4s ease both;
}

.profile-card:nth-child(1) { animation-delay: 0.05s; }
.profile-card:nth-child(2) { animation-delay: 0.10s; }
.profile-card:nth-child(3) { animation-delay: 0.15s; }
.profile-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

.profile-card:hover {
  border-color: rgba(201, 160, 48, 0.45);
  transform: translateX(4px) translateY(-2px);
  box-shadow: 0 12px 28px rgba(8, 9, 14, 0.10);
}

.profile-card:active {
  transform: translateX(2px) scale(0.99);
}

/* Glow effect — cor por papel (índigo é o padrão do paciente) */
.profile-card-glow {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-primary));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  transition: width 0.25s ease;
}
.profile-card:hover .profile-card-glow { width: 6px; }

/* Um papel, um peso — não três marcas diferentes na mesma tela. */
.profile-card-glow--blue   { background: linear-gradient(180deg, #8A8479, #504C44); }
.profile-card-glow--purple { background: linear-gradient(180deg, #C9A030, #8B6914); }
.profile-card-glow--gold   { background: linear-gradient(180deg, #E8CC78, #C9A030); }

/* Icon bubble */
.profile-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(201, 160, 48, 0.09);
  border: 1px solid rgba(201, 160, 48, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--brand-primary);
}
.profile-card-icon .icon { width: 26px; height: 26px; }
.profile-card:hover .profile-card-icon { transform: scale(1.08); }

.profile-card-icon--blue   { background: rgba(138,132,121,0.10); border-color: rgba(138,132,121,0.26); color: #6E6961; }
.profile-card-icon--purple { background: rgba(201,160,48,0.10);  border-color: rgba(201,160,48,0.26);  color: #8B6914; }
.profile-card-icon--gold   { background: rgba(201,160,48,0.14);  border-color: rgba(201,160,48,0.34);  color: #A8801F; }

/* Content */
.profile-card-content { flex: 1; min-width: 0; }

.profile-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.profile-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Arrow */
.profile-card-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.profile-card:hover .profile-card-arrow {
  color: var(--brand-secondary);
  transform: translateX(4px);
}

/* Footer */
.profile-selector-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ─── Login com Role ───────────────────────────────────────── */

.login-role-panel {
  animation: panelSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Back button */
.back-to-profiles-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  margin-bottom: var(--space-xl);
  transition: all var(--transition);
}
.back-to-profiles-btn:hover {
  background: var(--bg-input);
  color: var(--text-secondary);
  border-color: var(--brand-secondary);
  transform: translateX(-3px);
}

/* Role badge */
.login-role-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 18px;
  background: rgba(201, 160, 48, 0.06);
  border: 1px solid var(--role-color, var(--brand-accent));
  border-radius: var(--radius-full);
  box-shadow: 0 0 20px -6px var(--role-color, var(--brand-accent));
  animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.login-role-badge-icon {
  font-size: 1.25rem;
  display: inline-flex;
  color: var(--role-color, var(--brand-accent));
}
.login-role-badge-icon .icon { width: 18px; height: 18px; }
.login-role-badge-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--role-color, var(--brand-accent));
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Mobile */
@media (max-width: 768px) {
  .auth-screen { flex-direction: column; }
  .auth-brand-panel {
    padding: var(--space-xl) var(--space-lg);
    min-height: auto;
  }
  .auth-brand-logo { width: 72px; height: 72px; }
  .auth-brand-name { font-size: 1.875rem; }
  .auth-brand-features { display: none; }
  .auth-form-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: var(--space-xl) var(--space-lg);
  }
  .profile-selector-panel { padding: var(--space-xl) var(--space-lg); }
  .profile-card { padding: var(--space-sm) var(--space-md); }
  .profile-card-icon { width: 44px; height: 44px; font-size: 1.25rem; }
}
