/* ==========================================================================
   PORTAL DO ASSINANTE - OBJETIVO FIBRA
   Design System & Custom Animations
   ========================================================================== */

:root {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-light: #ffedd5;
  --primary-gradient: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  --dark-bg: #0f172a;
  --dark-card: #1e293b;
  --dark-border: #334155;
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --light-border: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-gradient-brand {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
}

.bg-gradient-subtle {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

/* Glowing Accent Shadows */
.shadow-brand {
  box-shadow: 0 10px 25px -5px rgba(234, 88, 12, 0.25), 0 8px 10px -6px rgba(234, 88, 12, 0.2);
}

.shadow-brand-sm {
  box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.2);
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}

/* Pulse animation for online indicator */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.pulse-online {
  animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Card hover animation */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08), 0 8px 16px -6px rgba(0, 0, 0, 0.04);
}

/* Desktop Sidebar Tab Transitions */
aside .nav-tab-btn {
  position: relative;
  transition: all 0.2s ease-in-out;
}

aside .nav-tab-btn.active {
  color: #ea580c;
  background-color: #fff7ed;
  font-weight: 700;
}

aside .nav-tab-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background-color: #ea580c;
  border-radius: 0 4px 4px 0;
}

/* Mobile Bottom Navigation Bar (Bottom horizontal bar indicator) */
.mobile-nav-bar {
  /* Comprehensive safe-area support for iOS Home Indicator, Android Gestures and on-screen soft navigation keys */
  padding-top: 6px;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  padding-left: calc(0.5rem + env(safe-area-inset-left, 0px));
  padding-right: calc(0.5rem + env(safe-area-inset-right, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  /* Fix GPU layer & prevent clipping behind native browser/OS bottom bars */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.mobile-nav-bar .nav-tab-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 4px 2px;
  min-height: 48px;
  border-radius: 12px;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

/* Ensure inactive tab buttons stay hidden without breaking Tailwind's responsive system */
.mobile-nav-bar .nav-tab-btn.hidden,
.mobile-nav-bar .nav-tab-btn[hidden],
aside .nav-tab-btn.hidden,
aside .nav-tab-btn[hidden],
[data-tab="support"] {
  display: none !important;
}

.mobile-nav-bar .nav-tab-btn::before {
  display: none !important; /* Disables the cramped left vertical bar */
}

.mobile-nav-bar .nav-tab-btn.active {
  color: #ea580c !important;
  background-color: #fff7ed !important;
  font-weight: 800;
}

/* Orange bar placed cleanly at the bottom */
.mobile-nav-bar .nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  border-radius: 4px;
}

.mobile-nav-bar .nav-tab-btn:active {
  transform: scale(0.95);
}

@media (max-width: 767px) {
  #app-screen > .max-w-7xl {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #1e293b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-left: 4px solid #22c55e;
}

.toast.toast-error {
  border-left: 4px solid #ef4444;
}

.toast.toast-info {
  border-left: 4px solid #3b82f6;
}

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

@keyframes toast-out {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* OTP Code Box */
.otp-input {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.otp-input:focus {
  border-color: #ea580c;
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}

/* QR Code Container Styling */
#pix-qrcode-container img,
#pix-qrcode-container canvas {
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
