/* ==========================================================================
   BuscarPDF Web - Estilo Oficial id.castelandia.com
   Fidelidade 100% com a identidade visual de Castelândia
   ========================================================================== */

/* 1. Tela de Login Unauth (Imagem 1) - Oculta por padrão para prevenir flash FOUC */
.unauth-login-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  width: 100%;
  height: 100vh;
  display: none !important;
  flex-direction: column;
  background-image: linear-gradient(135deg, rgba(11, 14, 20, 0.55) 0%, rgba(11, 14, 20, 0.85) 100%), url('../assets/background.JPG') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  overflow-y: auto;
  font-family: var(--font-sans);
}

/* Exibe exclusivamente se confirmado estado não-autenticado */
html.unauth-mode .unauth-login-screen:not(.hidden),
.unauth-login-screen.visible:not(.hidden) {
  display: flex !important;
}

.unauth-login-screen.hidden {
  display: none !important;
}

/* Top Bar de Data, Clima e Crédito */
.login-top-bar {
  width: 100%;
  padding: 0.65rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 14, 20, 0.6);
  backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 500;
  box-sizing: border-box;
}

.login-top-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-top-dev {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.85);
}

.login-top-dev strong {
  background: linear-gradient(135deg, #ffffff 0%, #c7b386 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Logo Oficial Central */
.login-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2.2rem 1rem 1rem;
  text-decoration: none;
}

.login-header-logo img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.login-header-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  margin: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.login-header-text p {
  font-size: 0.72rem;
  color: #c7b386;
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Card de Login Flutuante Central */
.login-card-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.2rem;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(199, 179, 134, 0.25);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  background-color: rgba(21, 28, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.35s ease;
}

.login-shield-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: rgba(199, 179, 134, 0.12);
  color: #c7b386;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 1px solid rgba(199, 179, 134, 0.3);
}

.login-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.4rem 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-card-subtitle {
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0 0 1.5rem 0;
  text-align: center;
}

.login-alert-box {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid #0284c7;
  color: #38bdf8;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.login-form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.login-form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
}

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

.login-input-wrapper svg.field-icon {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border-radius: 8px;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid #232c3d;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: #c7b386;
  box-shadow: 0 0 0 3px rgba(199, 179, 134, 0.2);
}

.login-password-toggle {
  position: absolute;
  right: 0.8rem;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-submit-btn {
  width: 100%;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #c7b386 0%, #b49f72 100%);
  color: #121316;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(199, 179, 134, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #d4af37 0%, #c7b386 100%);
  box-shadow: 0 6px 20px rgba(199, 179, 134, 0.5);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   2. Modal "Quem é você?" (Imagem 2)
   ========================================================================== */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(5, 10, 24, 0.8);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.profile-modal-overlay.hidden {
  display: none !important;
}

/* Moldura com Borda Glow Gradiente */
.profile-modal-rainbow-wrapper {
  position: relative;
  width: 100%;
  max-width: 780px;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.7) 0%, rgba(37, 99, 235, 0.6) 40%, rgba(139, 92, 246, 0.5) 70%, rgba(16, 185, 129, 0.6) 100%);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 35px -5px rgba(37, 99, 235, 0.35);
  box-sizing: border-box;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-modal-inner {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  border-radius: 26px;
  padding: 2.5rem 2.2rem;
  box-sizing: border-box;
  position: relative;
}

.profile-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
  color: #ffffff;
}

.profile-server-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: rgba(199, 179, 134, 0.12);
  border: 1px solid rgba(199, 179, 134, 0.3);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  color: #c7b386;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.profile-modal-title {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.45rem 0;
  letter-spacing: -0.02em;
  text-align: center;
}

.profile-modal-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0 0 2.2rem 0;
  text-align: center;
}

/* Grid de Perfis Estilo Netflix / id.castelandia.com */
.netflix-profiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 2.2rem;
}

.netflix-profile-card {
  position: relative;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.5rem 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.netflix-profile-card:hover {
  transform: translateY(-8px) scale(1.04);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.netflix-profile-card.active-selected {
  border-color: #34d399 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35), inset 0 0 15px rgba(16, 185, 129, 0.08) !important;
}

/* Anéis dos Avatares */
.avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.netflix-profile-card:hover .avatar-ring {
  transform: scale(1.08);
}

.avatar-img-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
}

/* Checkmark Verde para Perfil Selecionado */
.avatar-check-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background-color: #10b981;
  color: #ffffff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

.profile-card-name {
  display: block;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.profile-card-role {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 3px;
  text-align: center;
}

/* Card "+ Adicionar Perfil" Tracejado */
.add-profile-card {
  border: 2px dashed rgba(255, 255, 255, 0.25) !important;
  background: transparent !important;
  justify-content: center;
}

.add-profile-card:hover {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25) !important;
}

.add-plus-ring {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.3s ease;
}

.add-profile-card:hover .add-plus-ring {
  border-color: #38bdf8;
  color: #38bdf8;
  transform: rotate(90deg) scale(1.1);
}

/* Botões Inferiores do Modal */
.profile-modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-manage-profiles {
  padding: 0.7rem 1.8rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-manage-profiles:hover {
  background-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-logout-account {
  padding: 0.7rem 1.8rem;
  border-radius: 12px;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  background-color: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-logout-account:hover {
  background-color: rgba(239, 68, 68, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Toast Lateral Notificação ao Trocar Perfil */
.profile-right-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: none;
  align-items: center;
  gap: 0.9rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 25px -4px rgba(16, 185, 129, 0.3);
  border-radius: 18px;
  padding: 0.9rem 1.4rem;
  max-width: 440px;
  color: #f8fafc;
  animation: toastIn 0.25s var(--ease-spring);
}

@media (max-width: 768px) {
  .netflix-profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Badge de Perfil Bloqueado com PIN */
.profile-pin-locked-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  color: #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
