@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg-color:       #0f172a;
  --bg-secondary:   #1e293b;
  --glass-bg:       rgba(30, 41, 59, 0.7);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --text-main:      #f8fafc;
  --text-muted:     #94a3b8;
  --primary:        #6366f1;
  --primary-hover:  #4f46e5;
  --primary-glow:   rgba(99, 102, 241, 0.25);
  --success:        #10b981;
  --warning:        #fbbf24;
  --danger:         #ef4444;
  --accent-gold:    #fbbf24;
  --accent-silver:  #94a3b8;
  --accent-bronze:  #fb923c;
}

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

html, body {
  height: 100%;
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at top right, rgba(30, 27, 75, 0.8), transparent 50%),
    radial-gradient(circle at bottom left, rgba(49, 46, 129, 0.6), transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── App Layout ────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 32px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ── Navbar ────────────────────────────────────────────────────── */
.app-navbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 64px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.app-nav-link:hover, .app-nav-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-main);
}

.app-nav-link.active { color: #818cf8; }

/* Dropdown */
.app-nav-dropdown { position: relative; }

/* Bridge: invisible pseudo-element fills the gap so mouse doesn't leave the parent */
.app-nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px; /* matches the gap */
  display: none;
}

.app-nav-dropdown:hover::after { display: block; }
.app-nav-dropdown:hover .app-dropdown-menu { display: block; }
.app-nav-dropdown:focus-within .app-dropdown-menu { display: block; }

.app-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: rgba(11, 17, 36, 0.99);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px;
  list-style: none;
  box-shadow: 0 20px 48px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  /* Keep open when mouse enters the menu */
}

.app-dropdown-menu:hover { display: block; }

.app-dropdown-menu.app-dropdown-right { left: auto; right: 0; }

.app-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.15s;
}

.app-dropdown-item:hover, .app-dropdown-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-main);
}

/* User section */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-greeting {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nav-user-greeting strong { color: var(--text-main); }

.nav-avatar-dropdown { position: relative; cursor: pointer; }

/* Bridge: fills gap between avatar and dropdown so hover doesn't break */
.nav-avatar-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 12px; /* matches the gap (top: calc(100% + 8px) = 8px gap + some buffer) */
  display: none;
}

.nav-avatar-dropdown:hover::after { display: block; }
.nav-avatar-dropdown:hover .app-dropdown-menu { display: block; }
.nav-avatar-dropdown .app-dropdown-menu:hover { display: block; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #000;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Glass Panel ───────────────────────────────────────────────── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* ── Login Page ────────────────────────────────────────────────── */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  text-align: center;
  animation: slideUp 0.6s ease-out;
}

.login-logo {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.login-logo img {
  filter: brightness(0) invert(1);
  height: 52px;
  object-fit: contain;
}

.login-box h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box > p {
  color: var(--text-muted);
  margin-bottom: 36px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder { color: rgba(148,163,184,0.4); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

/* ── Page Header ───────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }

.page-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
}

.page-header p { color: var(--text-muted); font-size: 1.05rem; }

/* ── Package Cards ─────────────────────────────────────────────── */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.package-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.package-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.package-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
}

.package-card.ouro::before   { background: linear-gradient(to right, #fcd34d, #b45309); }
.package-card.prata::before  { background: linear-gradient(to right, #e2e8f0, #64748b); }
.package-card.bronze::before { background: linear-gradient(to right, #fdba74, #9a3412); }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge.ouro   { background: rgba(251,191,36,0.15);  color: var(--accent-gold);   border: 1px solid rgba(251,191,36,0.3); }
.badge.prata  { background: rgba(148,163,184,0.15); color: var(--accent-silver); border: 1px solid rgba(148,163,184,0.3); }
.badge.bronze { background: rgba(180,83,9,0.15);    color: var(--accent-bronze); border: 1px solid rgba(180,83,9,0.3); }

.package-title  { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; color: var(--text-main); }
.package-status { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ── Progress ──────────────────────────────────────────────────── */
.progress-container { margin-bottom: 24px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.progress-fill.ouro   { background: linear-gradient(to right, #fcd34d, #b45309); }
.progress-fill.prata  { background: linear-gradient(to right, #e2e8f0, #64748b); }
.progress-fill.bronze { background: linear-gradient(to right, #fdba74, #9a3412); }

/* ── Timeline ──────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text-main); }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.timeline-header h2 { font-size: 2rem; font-weight: 800; color: var(--text-main); }
.timeline-header p  { color: var(--text-muted); margin-top: 4px; }

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 24px;
  width: 2px;
  background: var(--glass-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 36px;
  padding-left: 72px;
  opacity: 0;
  animation: slideIn 0.5s forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

.timeline-marker {
  position: absolute;
  left: 12px; top: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.3s;
}

.timeline-item.completed .timeline-marker { background: var(--success); border-color: var(--success); box-shadow: 0 0 15px rgba(16,185,129,0.4); }
.timeline-item.active    .timeline-marker { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 15px rgba(99,102,241,0.4); }

.timeline-content { padding: 20px; }
.timeline-content h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }

.timeline-item.completed h3 { color: var(--success); }
.timeline-item.active    h3 { color: var(--primary); }
.timeline-item.pending   h3 { color: var(--text-muted); }

.timeline-content p { color: var(--text-muted); line-height: 1.6; }

.timeline-meta {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.timeline-meta span { display: flex; align-items: center; gap: 6px; }
.timeline-meta a    { color: var(--primary); display: flex; align-items: center; gap: 6px; }
.timeline-meta a:hover { color: #818cf8; }

/* ── Deliverable Observações ──────────────────────────────────── */
.deliverable-observacoes {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  color: rgba(251, 191, 36, 0.85);
  font-size: 0.875rem;
  line-height: 1.55;
}

.deliverable-observacoes i {
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 2px;
}

/* Admin modal preview (truncated) */
.deliverable-obs-preview {
  font-size: .8rem;
  margin-top: 2px;
}


/* ── Admin Cards ───────────────────────────────────────────────── */
.card {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 16px !important;
  color: var(--text-main) !important;
}

.card-body { color: var(--text-main) !important; }
.card-header { background: transparent !important; border-bottom: 1px solid var(--glass-border) !important; color: var(--text-main) !important; }

/* ── Tables ────────────────────────────────────────────────────── */
.table { color: var(--text-main) !important; }

.table thead th {
  background: rgba(255,255,255,0.04) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  padding: 14px 16px !important;
}

.table tbody td {
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  padding: 16px !important;
  vertical-align: middle !important;
  color: var(--text-main) !important;
}

.table tbody tr:hover td { background: rgba(255,255,255,0.03) !important; }

/* ── Badges (Bootstrap override) ──────────────────────────────── */
.badge.bg-success { background: rgba(16,185,129,0.2)  !important; color: var(--success)  !important; border: 1px solid rgba(16,185,129,0.3);  border-radius: 6px; }
.badge.bg-danger  { background: rgba(239,68,68,0.2)   !important; color: var(--danger)   !important; border: 1px solid rgba(239,68,68,0.3);   border-radius: 6px; }
.badge.bg-dark    { background: rgba(255,255,255,0.06) !important; color: var(--text-main) !important; border: 1px solid var(--glass-border);  border-radius: 6px; }

/* ── Action Buttons ────────────────────────────────────────────── */
.btn-action {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-muted) !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  transition: all 0.2s !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.btn-action:hover { background: var(--primary) !important; border-color: var(--primary) !important; color: white !important; }
.btn-action.btn-danger:hover { background: var(--danger) !important; border-color: var(--danger) !important; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-content.glass-panel {
  background: rgba(11, 17, 36, 0.97) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6) !important;
  color: var(--text-main) !important;
}

.modal-header { border-bottom: 1px solid var(--glass-border) !important; padding: 20px 24px !important; }
.modal-footer { border-top:    1px solid var(--glass-border) !important; padding: 16px 24px !important; }

.modal-title {
  font-weight: 800 !important;
  font-size: 1.3rem !important;
  background: linear-gradient(to right, #818cf8, #c084fc) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* ── Forms (Bootstrap override) ───────────────────────────────── */
.form-label {
  color: var(--text-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 6px !important;
}

.form-control, .form-select {
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-main) !important;
  border-radius: 10px !important;
  padding: 11px 15px !important;
  font-family: inherit !important;
  transition: all 0.25s !important;
}

.form-control::placeholder { color: rgba(148,163,184,0.35) !important; }
.form-select option { background: var(--bg-secondary); }

.form-control:focus, .form-select:focus {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  color: var(--text-main) !important;
}

.modal .btn-primary  { width: auto !important; padding: 10px 28px !important; }
.modal .btn-secondary { width: auto !important; padding: 10px 20px !important; }

#deliverablesList .list-group-item {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--text-main) !important;
  margin-bottom: 6px;
  border-radius: 8px !important;
  transition: background 0.15s;
}

#deliverablesList .list-group-item:hover { background: rgba(255,255,255,0.06) !important; }

/* ── SweetAlert2 ───────────────────────────────────────────────── */
.swal2-popup {
  background: rgba(11, 17, 36, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 20px !important;
  color: var(--text-main) !important;
}

.swal2-title        { color: var(--text-main) !important; }
.swal2-html-container { color: var(--text-muted) !important; }
.swal2-confirm      { background: linear-gradient(135deg, var(--primary), #8b5cf6) !important; border-radius: 10px !important; }
.swal2-cancel       { background: rgba(255,255,255,0.05) !important; border: 1px solid var(--glass-border) !important; border-radius: 10px !important; }

/* SweetAlert2 form inputs and selects */
.swal2-input, .swal2-select, .swal2-textarea {
  background: rgba(11, 17, 36, 0.95) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #f8fafc !important;
  border-radius: 10px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
}

.swal2-input:focus, .swal2-select:focus, .swal2-textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25) !important;
}

.swal2-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.rotating-loader { animation: spin 1s linear infinite; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-navbar { padding: 0 16px; gap: 12px; }
  .app-nav-links { display: none; }
  .nav-user-greeting { display: none; }
  .packages-grid { grid-template-columns: 1fr; }
  .timeline-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .app-content { padding: 24px 16px; }
}
