* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #eef3fb 0%, #f4f7fc 42%, #e9eef6 100%);
  color: #1e293b;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, rgba(37, 99, 235, 0.08), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(14, 165, 233, 0.07), transparent 30%);
  z-index: -1;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes glow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.top-bar {
  background: #0f172a;
  color: #fff;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 3px solid #2563eb;
  animation: fadeInUp 0.8s ease;
}

.top-bar .container,
.header .container,
.footer .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 20px 0 18px;
  border-bottom: 1px solid #e2e8f0;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-area h1 {
  font-size: 1.78rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.logo-area h1 i {
  color: #2563eb;
  margin-right: 12px;
}

.logo-area p {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 3px;
}

.badge {
  background: #eef2ff;
  color: #2563eb;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.header-logos {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: center;
  gap: 14px;
}

.header-logos img {
  height: 46px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
}

.header-logos .header-logo-usfx,
.header-logos .header-logo-fcee {
  height: 52px;
  max-width: 92px;
}

.header-logos .header-logo-vicerrectorado {
  height: 60px;
  max-width: 106px;
}

.main-container {
  max-width: 1400px;
  margin: 28px auto 40px;
  padding: 0 30px;
}

.main-container > section:first-child .section-title {
  margin-top: 8px;
}

.section-title {
  margin: 40px 0 25px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 15px;
  animation: fadeInLeft 0.8s ease;
}

.section-title i {
  color: #2563eb;
  font-size: 1.8rem;
}

.actor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.actor-card {
  background: #fff;
  border-radius: 12px;
  padding: 25px 15px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: pointer;
  animation: fadeInUp 0.8s ease;
  animation-fill-mode: both;
}

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

.actor-card:hover {
  border-color: #2563eb;
  box-shadow: 0 20px 30px rgba(37, 99, 235, 0.15);
  transform: translateY(-8px);
}

.actor-icon {
  width: 70px;
  height: 70px;
  background: #f8fafc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.actor-card:hover .actor-icon {
  border-color: #2563eb;
  background: #eff6ff;
}

.actor-icon i {
  font-size: 2rem;
  color: #2563eb;
}

.actor-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.actor-card:hover h3 {
  color: #2563eb;
}

.actor-role {
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 30px;
  display: inline-block;
  font-weight: 500;
}

.role-author { background: #fee2e2; color: #b91c1c; }
.role-editor { background: #dbeafe; color: #1e40af; }
.role-reviewer { background: #f3e8ff; color: #6b21a8; }
.role-copyeditor { background: #dcfce7; color: #166534; }
.role-production { background: #fff3cd; color: #856404; }

.filter-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  animation: fadeInUp 0.8s ease 0.3s both;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.filter-label {
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 15px;
  border-right: 2px solid #e2e8f0;
}

.filter-label i { color: #2563eb; }

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.filter-btn i { font-size: 0.9rem; }

.filter-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.timeline {
  position: relative;
  padding: 40px 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #2563eb, #7c3aed, #2563eb);
  opacity: 0.25;
  border-radius: 3px;
  animation: glow 3s infinite;
  pointer-events: none;
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  position: relative;
  margin-bottom: 30px;
  animation: fadeInRight 0.8s ease;
  animation-fill-mode: both;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  animation: fadeInLeft 0.8s ease;
}

.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.3s; }
.timeline-item:nth-child(5) { animation-delay: 0.4s; }
.timeline-item:nth-child(6) { animation-delay: 0.5s; }
.timeline-item:nth-child(7) { animation-delay: 0.6s; }
.timeline-item:nth-child(8) { animation-delay: 0.7s; }
.timeline-item:nth-child(9) { animation-delay: 0.8s; }
.timeline-item:nth-child(10) { animation-delay: 0.9s; }
.timeline-item:nth-child(11) { animation-delay: 1s; }
.timeline-item:nth-child(12) { animation-delay: 1.1s; }
.timeline-item:nth-child(13) { animation-delay: 1.2s; }

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: 3px solid #fff;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.timeline-card {
  width: 45%;
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  position: relative;
  transition: all 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-5px);
  border-color: #2563eb;
  box-shadow: 0 20px 30px rgba(37, 99, 235, 0.1);
}

.phase-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 15px;
}

.timeline-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #0f172a;
}

.timeline-card h3 i {
  color: #2563eb;
  margin-right: 10px;
}

.actor-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #f1f5f9;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.steps-list {
  list-style: none;
  padding: 0;
}

.steps-list li {
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #334155;
  transition: all 0.3s ease;
}

.steps-list li:hover {
  transform: translateX(5px);
  color: #2563eb;
}

.steps-list li i {
  color: #2563eb;
  font-size: 0.9rem;
  margin-top: 4px;
  min-width: 16px;
}

.decision-box {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0 10px;
  transition: background 0.25s ease;
}

.decision-box:hover { background: #eff6ff; }

.decision-title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.decision-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.decision-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.option-yes { color: #059669; }
.option-no { color: #b91c1c; }
.option-maybe { color: #b45309; }

.footer {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid #e2e8f0;
  padding: 40px 0 20px;
  margin-top: 60px;
  animation: fadeInUp 0.8s ease;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 30px;
}

.footer-info {
  flex: 0 1 45%;
}

.footer-info h4 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 5px;
}

.footer-info p {
  color: #64748b;
  font-size: 0.9rem;
}

.footer-info .version {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #2563eb;
}

.visits-widget {
  margin-top: 12px;
  max-width: 320px;
}

.visits-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.5), rgba(148, 163, 184, 0.2));
  margin: 0 0 8px;
}

.visits-row {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}

.visits-title {
  color: #334155;
  font-size: 0.82rem;
  margin: 0;
  white-space: nowrap;
}

.visits-title i {
  color: #2563eb;
  margin-right: 6px;
}

.visits-count {
  margin-top: 0;
  color: #0f172a;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.footer-logos-strip {
  flex: 0 1 52%;
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 10px;
  align-items: start;
}

.footer-logo-card {
  text-align: center;
}

.footer-logo-card img {
  height: 50px;
  width: auto;
  max-width: 112px;
  object-fit: contain;
}

.footer-logo-vicerrectorado img {
  height: 56px;
  max-width: 116px;
}

.footer-logo-card p {
  margin-top: 5px;
  font-size: 0.62rem;
  line-height: 1.3;
  color: #334155;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.help-float {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background: #2563eb;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

.help-float:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.actor-card:focus-visible,
.filter-btn:focus-visible,
.help-float:focus-visible,
.help-modal__close:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

.help-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1300;
}

.help-modal.is-open {
  display: block;
}

.help-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.help-modal__dialog {
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dbe5f2;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: fadeInUp 0.22s ease;
}

.help-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

.help-modal__header h3 {
  font-size: 1rem;
  color: #0f172a;
}

.help-modal__header h3 i {
  margin-right: 8px;
  color: #2563eb;
}

.help-modal__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: #dbeafe;
  color: #1e40af;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.help-modal__close:hover {
  background: #bfdbfe;
  transform: rotate(90deg);
}

.help-modal__list {
  list-style: disc;
  padding: 16px 34px 22px;
  color: #334155;
}

.help-modal__list li {
  margin: 8px 0;
}

@media (max-width: 768px) {
  .top-bar .container,
  .header .container,
  .main-container,
  .footer .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-bar {
    font-size: 0.8rem;
    padding: 7px 0;
  }

  .top-bar .container {
    justify-content: center;
    text-align: center;
    gap: 6px;
  }

  .header {
    padding: 14px 0 12px;
  }

  .timeline-line,
  .timeline-dot { left: 18px; }

  .timeline-item,
  .timeline-item:nth-child(even) { justify-content: flex-start; }

  .timeline-card {
    width: auto;
    margin-left: 34px !important;
    margin-right: 0 !important;
    padding: 16px;
    border-radius: 10px;
  }

  .header .container {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .logo-area h1 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .logo-area p {
    font-size: 0.9rem;
  }

  .header-logos {
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: 10px;
  }

  .header-logos .header-logo-usfx,
  .header-logos .header-logo-fcee {
    height: 40px;
    max-width: 72px;
  }

  .header-logos .header-logo-vicerrectorado {
    height: 46px;
    max-width: 80px;
  }

  .main-container {
    margin-top: 20px;
    margin-bottom: 28px;
  }

  .section-title {
    margin: 26px 0 16px;
    font-size: 1.26rem;
    padding-bottom: 10px;
  }

  .section-title i {
    font-size: 1.45rem;
  }

  .actor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .actor-card {
    padding: 16px 10px;
  }

  .actor-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
  }

  .actor-icon i {
    font-size: 1.5rem;
  }

  .actor-card h3 {
    font-size: 1rem;
  }

  .actor-role {
    font-size: 0.76rem;
    padding: 3px 10px;
  }

  .filter-section {
    padding: 14px;
    gap: 10px;
    margin: 20px 0;
  }

  .filter-label {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    padding: 0 0 8px;
  }

  .filter-buttons {
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .filter-btn {
    flex: 0 0 auto;
    justify-content: center;
    min-width: 128px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .timeline {
    padding: 16px 0 6px;
  }

  .timeline-item {
    margin-bottom: 16px;
  }

  .timeline-dot {
    width: 13px;
    height: 13px;
    border-width: 2px;
  }

  .phase-badge {
    font-size: 0.72rem;
    margin-bottom: 10px;
  }

  .timeline-card h3 {
    font-size: 1.03rem;
    margin-bottom: 10px;
  }

  .timeline-card h3 i {
    margin-right: 6px;
  }

  .actor-mini-badge {
    font-size: 0.78rem;
    margin-bottom: 10px;
    padding: 3px 10px;
  }

  .steps-list li {
    margin: 8px 0;
    font-size: 0.89rem;
    gap: 8px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .steps-list li i {
    font-size: 0.82rem;
    min-width: 14px;
  }

  .decision-box {
    padding: 12px;
    margin-top: 12px;
  }

  .decision-title {
    font-size: 0.88rem;
  }

  .decision-options {
    gap: 8px;
  }

  .decision-option {
    font-size: 0.82rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-info,
  .footer-logos-strip {
    flex: 1 1 100%;
    width: 100%;
  }

  .visits-widget {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-logos-strip {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
  }

  .footer-logo-card img {
    height: 52px;
    max-width: 120px;
  }

  .footer-logo-vicerrectorado img {
    height: 60px;
    max-width: 126px;
  }

  .footer-logo-card p {
    font-size: 0.62rem;
  }

  .copyright {
    font-size: 0.78rem;
    line-height: 1.45;
    padding-top: 14px;
  }

  .help-float {
    width: 44px;
    height: 44px;
    left: 16px;
    bottom: 16px;
    font-size: 1.02rem;
  }

  .help-modal__dialog {
    margin-top: 8vh;
    width: calc(100% - 20px);
  }

  .help-modal__header {
    padding: 12px 14px;
  }

  .help-modal__header h3 {
    font-size: 0.92rem;
  }

  .help-modal__list {
    padding: 12px 22px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .actor-grid {
    grid-template-columns: 1fr;
  }

  .header-logos {
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    gap: 6px;
  }

  .header-logos .header-logo-usfx,
  .header-logos .header-logo-fcee {
    height: 34px;
    max-width: 62px;
  }

  .header-logos .header-logo-vicerrectorado {
    height: 40px;
    max-width: 70px;
  }

  .timeline-card {
    margin-left: 30px !important;
  }

  .timeline-line,
  .timeline-dot {
    left: 12px;
  }

  .footer-logos-strip {
    grid-template-columns: 1fr;
  }

  .footer-logo-card p {
    font-size: 0.64rem;
  }
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #2563eb; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #1e40af; }
