:root {
  --bg-dark: #0b1120;
  --bg-slate: #111827;
  --bg-card-dark: #1e293b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #f1f5f9;
  --text-light-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --success: #10b981;
  --border-light: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 45px rgba(2, 6, 23, 0.22);
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.6rem;
  line-height: 1.18;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.text-accent {
  color: var(--accent);
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 0.5rem;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.45rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #0b1120;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-dark {
  background: var(--bg-slate);
  color: #ffffff;
}

.btn-dark:hover {
  background: #1e293b;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-outline-light {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-outline-light:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-weight: 700;
  color: var(--bg-slate);
  cursor: pointer;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-link:hover {
  color: var(--accent-hover);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dark);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  color: #0b1120;
  font-family: var(--font-display);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

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

.brand-text strong {
  font-size: 1rem;
}

.brand-text span {
  font-size: 0.74rem;
  color: var(--text-light-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  color: var(--text-light);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 120px 0 70px;
  color: #ffffff;
  overflow: hidden;
  background: var(--bg-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    95deg,
    rgba(11, 17, 32, 0.94) 0%,
    rgba(11, 17, 32, 0.8) 52%,
    rgba(11, 17, 32, 0.48) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  margin-bottom: 1.1rem;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  max-width: 650px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.8rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
}

.metric-card strong {
  display: block;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.metric-card span {
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* Secciones generales */
.section {
  padding: 84px 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.2rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.section-header p {
  color: var(--text-muted);
  margin: 0;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.4rem;
  flex-wrap: wrap;
}

.section-header-row h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
}

.section-header-row p {
  color: var(--text-muted);
  margin: 0;
}

/* Servicios Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-img-wrap {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: var(--bg-slate);
}

.service-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.service-card:hover .service-img-wrap img {
  transform: scale(1.04);
}

.service-tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(11, 17, 32, 0.86);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.service-body {
  padding: 1.6rem 1.75rem 1.8rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-body h3 {
  font-size: 1.4rem;
}

.service-body > p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.service-list {
  margin: 0 0 1.4rem;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.92rem;
  flex: 1;
}

.service-list li {
  margin-bottom: 0.38rem;
}

/* Metodología */
.methodology-section {
  background: var(--bg-dark);
  color: #ffffff;
}

.methodology-section .eyebrow {
  color: var(--accent);
}

.methodology-section .section-header p {
  color: var(--text-light-muted);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 1.6rem;
}

.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.step-card p {
  color: var(--text-light-muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Herramientas Públicas */
.public-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}

.tool-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.tool-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b45309;
  margin-bottom: 0.65rem;
}

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Contacto */
.contact-section {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 3rem;
  align-items: start;
}

.contact-info h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
}

.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-highlights {
  display: grid;
  gap: 1rem;
}

.highlight-item {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  border-left: 4px solid var(--accent);
}

.highlight-item strong {
  display: block;
  margin-bottom: 0.15rem;
}

.highlight-item span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-form {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.contact-form h3 {
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.94rem;
  background: #ffffff;
  color: var(--text-main);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input {
  width: auto;
}

.form-feedback {
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  color: var(--success);
  font-weight: 600;
}

.form-error {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  color: var(--danger);
  font-weight: 600;
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light-muted);
  padding: 2.2rem 0;
  border-top: 1px solid var(--border-dark);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer strong {
  color: #ffffff;
  display: block;
  margin-bottom: 0.25rem;
}

.footer p {
  margin: 0;
  font-size: 0.86rem;
}

/* Modal Login */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(440px, 100%);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.login-hint {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.login-hint code {
  background: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text-main);
}

/* Portal Privado */
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #0f172a;
  color: #f1f5f9;
  overflow-y: auto;
}

.portal-overlay[hidden] {
  display: none;
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0b1120;
  border-bottom: 1px solid var(--border-dark);
  padding: 0.95rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-brand strong {
  display: block;
  font-size: 1rem;
}

.portal-brand span {
  font-size: 0.8rem;
  color: var(--text-light-muted);
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.import-label {
  cursor: pointer;
}

.portal-body {
  width: min(1320px, 95%);
  margin: 1.8rem auto 3rem;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.8rem;
  align-items: start;
}

.portal-sidebar {
  display: grid;
  gap: 1.4rem;
}

.portal-panel {
  background: #1e293b;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.portal-panel h3 {
  font-size: 1.1rem;
  color: #ffffff;
}

.panel-desc {
  font-size: 0.85rem;
  color: var(--text-light-muted);
  margin: 0 0 1rem;
}

.portal-panel .form-row label {
  color: #cbd5e1;
}

.portal-panel .form-row input,
.portal-panel .form-row select {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
}

.dropzone {
  margin-top: 0.75rem;
  border: 2px dashed rgba(245, 158, 11, 0.55);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #e2e8f0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--accent);
}

.dropzone svg {
  color: var(--accent);
}

.dropzone strong {
  font-size: 0.94rem;
}

.dropzone span {
  font-size: 0.8rem;
  color: var(--text-light-muted);
}

.storage-note {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: var(--text-light-muted);
}

.portal-main {
  background: #1e293b;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 520px;
}

.portal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-dark);
}

.portal-toolbar h2 {
  margin: 0;
  font-size: 1.35rem;
}

.toolbar-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-filters input,
.toolbar-filters select {
  padding: 0.58rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.88rem;
}

.portal-tools-list {
  display: grid;
  gap: 0.9rem;
}

.portal-tool-item {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-tool-info h4 {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
  color: #ffffff;
}

.portal-tool-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-light-muted);
}

.pill {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.74rem;
}

.pill-cat {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.pill-pub {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.pill-priv {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.portal-tool-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light-muted);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  background: #0b1120;
  color: #ffffff;
  border: 1px solid var(--accent);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
}

.toast[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 980px) {
  .services-grid,
  .contact-grid,
  .portal-body {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: #0b1120;
    flex-direction: column;
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-dark);
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-metrics,
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
