/**
 * WPDEX / GlassCAM Studio Pro — Estilos de Autenticação e Gestão de Sessão
 * Arquivo: cloudflare_lab/modular/frontend_experimental/css/auth.css
 * 
 * Implementação da TASK-008 (Design System Concept 02 Industrial):
 * - Modal de Login Glassmorphic Dark Mode
 * - Header Pill de Identificação do Operador e Empresa
 * - Indicadores visuais de sessão ativa e renovação silenciosa
 * - Painel de Bloqueio Elegante para Contas/Empresas Suspensas
 * - Sistema de Toasts de Notificação de Telemetria
 */

/* ================= PAINEL DE IDENTIFICAÇÃO DO OPERADOR (HEADER) ================= */
.user-session-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated, #17191D);
  border: 1px solid var(--border-subtle, #303236);
  padding: 4px 12px;
  border-radius: var(--radius-md, 12px);
  font-size: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user-session-pill:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.session-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.session-status-dot.renewing {
  background: var(--accent-amber, #f59e0b);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: pulse-dot 1s infinite alternate;
}

.session-status-dot.disconnected {
  background: var(--accent-rose, #f43f5e);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

@keyframes pulse-dot {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name-tag {
  font-weight: 600;
  color: var(--text-main, #F3F4F5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.org-name-tag {
  font-size: 10px;
  color: var(--text-muted, #95999F);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim, #70757c);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-logout:hover {
  color: var(--accent-rose, #f43f5e);
  background: rgba(244, 63, 94, 0.1);
}

/* ================= MODAL DE AUTENTICAÇÃO (LOGIN OVERLAY) ================= */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 11, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.auth-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface, #111316);
  border: 1px solid var(--border-subtle, #303236);
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.active .auth-card {
  transform: translateY(0) scale(1);
}

.auth-header {
  padding: 32px 32px 20px 32px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-logo-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px auto;
  background: #FFFFFF;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.auth-title {
  font-family: 'Rajdhani', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--text-muted, #95999F);
}

.auth-body {
  padding: 24px 32px 32px 32px;
}

.auth-form-group {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #95999F);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim, #70757c);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  background: var(--bg-surface-elevated, #17191D);
  border: 1px solid var(--border-subtle, #303236);
  color: #FFFFFF;
  font-size: 14px;
  padding: 12px 14px 12px 42px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.auth-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim, #70757c);
  cursor: pointer;
  padding: 4px;
}

.auth-toggle-pwd:hover {
  color: #FFFFFF;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 18px;
  display: none;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.auth-alert.error {
  display: flex;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.auth-alert.warning {
  display: flex;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.auth-alert.success {
  display: flex;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.btn-auth-submit {
  width: 100%;
  background: #FFFFFF;
  color: #08090B;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-auth-submit:hover:not(:disabled) {
  background: #E0E2E5;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.btn-auth-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ================= OVERLAY DE BLOQUEIO DE CONTA SUSPENSA ================= */
.suspended-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 11, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 24px;
}

.suspended-card {
  max-width: 480px;
  width: 100%;
  background: #151214;
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(244, 63, 94, 0.15);
}

.suspended-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid var(--accent-rose, #f43f5e);
  color: var(--accent-rose, #f43f5e);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.suspended-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.suspended-message {
  font-size: 13px;
  color: var(--text-muted, #95999F);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10002;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-elevated, #17191D);
  border: 1px solid var(--border-subtle, #303236);
  border-radius: 10px;
  padding: 12px 18px;
  color: #FFFFFF;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald, #10b981);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-cyan, #38bdf8);
}

.toast.toast-warning {
  border-left: 4px solid var(--accent-amber, #f59e0b);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose, #f43f5e);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= CONCEPT 02 GATEWAY HERO LOGIN INTEGRATION ================= */
.gateway-hero .gateway-login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 19, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  margin: 0 auto 18px auto;
  text-align: left;
  transform: none !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gateway-hero .gateway-login-card .auth-body {
  padding: 24px 28px;
}

.gateway-hint {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--fx-grey, #9FA3A9);
  text-transform: uppercase;
  margin-top: 14px;
  transition: opacity 0.3s ease;
}

@media (max-height: 800px) {
  .gateway-brand-symbol {
    width: 90px !important;
    height: 90px !important;
    margin-bottom: 12px !important;
  }
  .gateway-wordmark-wrap {
    width: 170px !important;
    margin-bottom: 10px !important;
  }
  .gateway-welcome-title {
    font-size: 22px !important;
    margin-bottom: 4px !important;
  }
  .gateway-welcome-sub {
    font-size: 13px !important;
    margin-bottom: 16px !important;
  }
  .gateway-status-pill {
    margin-bottom: 16px !important;
  }
}

/* ================= 3-STAGE TRANSITIONS (APRESENTAÇÃO -> LOGIN -> CAD/CAM) ================= */
.gateway-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fxStageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fxStageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gateway-back-wrap {
  margin-top: 18px;
  text-align: center;
}

.btn-back-welcome {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-subtle, #303236);
  color: var(--text-muted, #95999F);
  padding: 8px 18px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-back-welcome:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(-2px);
}


