/* ==========================================================================
   GeoTools Web Platform - Main Stylesheet (Clean Light Theme)
   ========================================================================== */

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

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 12% 15%, rgba(0, 137, 123, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 88% 65%, rgba(217, 119, 6, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(2, 132, 199, 0.03) 0%, transparent 45%);
}

/* Subtle Topographic Background Grid (Light & Crisp) */
.topo-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.mono {
  font-family: var(--font-mono);
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* --- Header & Navigation Bar (Frosted Light) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-logo-img {
  height: 64px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .brand-logo-img {
    height: 52px;
    max-width: 210px;
  }
}

.brand-logo .logo-text span {
  color: var(--primary-emerald);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary-emerald);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--primary-emerald-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-emerald), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-emerald-glow);
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-emerald));
  box-shadow: 0 4px 16px rgba(0, 137, 123, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-emerald);
  color: var(--primary-emerald);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-orange));
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-amber-glow);
  font-weight: 700;
}

.btn-amber:hover {
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* User Profile & Auth */
.user-menu-wrap {
  position: relative;
  display: none;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.user-avatar-btn img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--primary-emerald);
}

/* Clean Light Cards */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.card-glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-emerald);
  box-shadow: var(--shadow-md), 0 0 16px rgba(0, 137, 123, 0.08);
  transform: translateY(-3px);
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.95rem;
  background: rgba(0, 137, 123, 0.08);
  border: 1px solid rgba(0, 137, 123, 0.25);
  color: var(--primary-dark);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-title span.highlight {
  background: linear-gradient(135deg, var(--primary-emerald), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-emerald {
  background: rgba(0, 137, 123, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 137, 123, 0.25);
}

.badge-amber {
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-blue {
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.modal-body {
  padding: 1.75rem 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-secondary);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.btn-close:hover {
  color: var(--text-primary);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Footer (Clean & Elegant) */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2.5rem;
  margin-top: 6rem;
  position: relative;
  z-index: 2;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.7rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--primary-emerald);
  padding-left: 4px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 992px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--border-medium);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-120%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-md);
  }

  .nav-menu.open {
    transform: translateY(0);
  }

  .mobile-toggle {
    display: block;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ==========================================================================
   Estándar RF-UI: Modal / Contenedor de Descarga Directa de APK (Android)
   ========================================================================== */
.apk-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.apk-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.apk-modal-container {
  background: #ffffff;
  border: 2.5px solid #e2e8f0;
  border-radius: 24px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 137, 123, 0.35);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.apk-modal-overlay.active .apk-modal-container {
  transform: scale(1);
}

.apk-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.apk-modal-icon {
  width: 44px;
  height: 44px;
  background: rgba(0, 137, 123, 0.1);
  border: 1.5px solid rgba(0, 137, 123, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.apk-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.apk-modal-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin: 2px 0 0 0;
}

.apk-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.apk-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  transform: rotate(90deg);
}

.apk-modal-body {
  padding: 1.75rem 2rem 2rem;
}

.apk-grid-cards {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.apk-card-featured {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.apk-badge-stable {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(22, 163, 74, 0.25);
  width: fit-content;
}

.apk-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.apk-spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.spec-value {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 700;
}

.btn-apk-download {
  min-height: 54px;
  background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 137, 123, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn-apk-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 137, 123, 0.55);
}

.btn-playstore-alt {
  margin-top: 0.75rem;
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: #00897b;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem;
  transition: color 0.2s;
}

.btn-playstore-alt:hover {
  color: #004d40;
  text-decoration: underline;
}

.apk-card-qr {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.apk-qr-box {
  width: 170px;
  height: 170px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.apk-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.apk-steps-box {
  margin-top: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
}

.apk-steps-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.85rem;
}

.apk-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.apk-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.apk-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #00897b;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.apk-step-text {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}

.apk-history-section {
  margin-top: 1.25rem;
}

.apk-history-toggle {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apk-history-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.apk-history-list {
  margin-top: 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.apk-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

.apk-history-row:last-child {
  border-bottom: none;
}

.btn-history-dl {
  background: rgba(0, 137, 123, 0.1);
  color: #00897b;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-history-dl:hover {
  background: #00897b;
  color: #ffffff;
}

@media (max-width: 720px) {
  .apk-grid-cards {
    grid-template-columns: 1fr;
  }
  .apk-steps-grid {
    grid-template-columns: 1fr;
  }
  .apk-specs-grid {
    grid-template-columns: 1fr;
  }
}

