/* ==========================================
   Gargoli — Global Landing Page Styles
   Main marketing page with navigation, hero, systems grid.
   (gargoli.md §3, §20.3)
   ========================================== */
@import './design.css';

/* --- Top Navigation ------------------------------------------------------ */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-surface-white);
  border-bottom: 1px solid var(--color-border-pale);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.nav-brand-mark {
  font-size: 1.5rem;
  color: var(--color-primary-cyan);
}

.nav-brand-name {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-primary-cyan);
  background: color-mix(in srgb, var(--color-primary-cyan) 10%, transparent);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-primary-cyan);
  outline-offset: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--color-surface-alt);
}

/* --- Mobile Navigation --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface-white);
    flex-direction: column;
    padding: 16px 20px;
    gap: 4px;
    border-bottom: 1px solid var(--color-border-pale);
    box-shadow: var(--shadow-md);
    display: none;
  }

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

  .nav-link {
    width: 100%;
    text-align: left;
  }

  .nav-actions {
    width: 100%;
    justify-content: stretch;
    margin-top: 8px;
  }

  .nav-actions .btn {
    flex: 1;
    text-align: center;
  }
}

/* --- Hero Section -------------------------------------------------------- */
.global-hero {
  padding: 80px 20px;
  background: linear-gradient(180deg, var(--color-surface-white) 0%, var(--color-surface-alt) 100%);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary-cyan) 15%, transparent);
  color: var(--color-primary-cyan);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Global Sections ----------------------------------------------------- */
.global-section {
  padding: 80px 20px;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* --- Systems Grid -------------------------------------------------------- */
.systems-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.systems-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

.system-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--color-border-pale);
  border-radius: 16px;
  background: var(--color-surface-white);
  transition: all 0.2s ease;
}

.system-card:hover {
  border-color: var(--color-primary-cyan);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.system-card.is-subscribed {
  border-color: var(--color-primary-cyan);
  background: color-mix(in srgb, var(--color-primary-cyan) 3%, transparent);
}

.system-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary-cyan) 12%, transparent);
  color: var(--color-primary-cyan);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.system-card.is-subscribed .system-icon {
  background: var(--color-primary-cyan);
  color: white;
}

.system-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mk-badge-on {
  background: color-mix(in srgb, #15803d 15%, transparent);
  color: #15803d;
}

.mk-badge-soon {
  background: color-mix(in srgb, #d97706 15%, transparent);
  color: #d97706;
}

.mk-card-flag {
  margin-left: auto;
}

.system-tagline {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
  font-weight: 500;
}

.system-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}

.system-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.system-features i {
  color: #15803d;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.system-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-pale);
}

.system-actions .btn {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.section-head {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.section-sub {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.mk-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.mk-muted {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* --- Highlight Section --------------------------------------------------- */
.global-highlight {
  background: var(--color-surface-white);
  border-top: 1px solid var(--color-border-pale);
  border-bottom: 1px solid var(--color-border-pale);
}

.highlight-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, #7c3aed 12%, transparent);
  color: #7c3aed;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.highlight-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.highlight-text > p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.highlight-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.highlight-features i {
  color: #15803d;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.phone-mockup {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 28px;
  background: #1a1a2e;
  padding: 8px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.phone-screen {
  border-radius: 20px;
  overflow: hidden;
  background: #0f0f1a;
  aspect-ratio: 9/19;
  position: relative;
}

.mock-map {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

.mock-map::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 15%;
  width: 70%;
  height: 60%;
  border: 3px dashed var(--color-primary-cyan);
  border-radius: 12px;
  animation: pulse 2s infinite;
}

.mock-status {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--color-primary-cyan);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (max-width: 900px) {
  .highlight-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .highlight-features li {
    justify-content: center;
  }
  .phone-mockup {
    max-width: 240px;
  }
}

/* --- Benefits Grid ------------------------------------------------------- */
.global-benefits {
  background: var(--color-surface-alt);
}

.benefits-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.benefit-card {
  padding: 32px 24px;
  border: 1px solid var(--color-border-pale);
  border-radius: 16px;
  background: var(--color-surface-white);
  transition: all 0.2s ease;
}

.benefit-card:hover {
  border-color: var(--color-primary-cyan);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.benefit-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-primary-cyan) 12%, transparent);
  color: var(--color-primary-cyan);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.benefit-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 10px;
}

.benefit-card p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* --- CTA Section --------------------------------------------------------- */
.global-cta {
  background: linear-gradient(135deg, var(--color-primary-cyan) 0%, #0891b2 100%);
  text-align: center;
}

.cta-content {
  max-width: 640px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.cta-content > p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  margin-bottom: 28px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons .btn-light {
  background: white;
  color: var(--color-primary-cyan);
}

.cta-buttons .btn-light:hover {
  background: var(--color-surface-alt);
}

.cta-buttons .btn-outline-light {
  border-color: rgba(255,255,255,0.5);
  color: white;
}

.cta-buttons .btn-outline-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* --- Footer -------------------------------------------------------------- */
.global-footer {
  background: var(--color-text-primary);
  color: rgba(255,255,255,0.7);
  padding: 60px 20px 24px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand-mark {
  font-size: 1.75rem;
  color: var(--color-primary-cyan);
}

.footer-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.footer-brand-tagline {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.footer-nav h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  margin: 0 0 16px;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--color-primary-cyan);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
}

/* --- Modals (shared) ----------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface-white);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

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

.modal-lg {
  max-width: 900px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-pale);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-sub {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 4px 0 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--color-border-pale);
}

.divider-text {
  white-space: nowrap;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border-pale);
  border-radius: 10px;
  background: var(--color-surface-white);
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s;
}

.google-btn:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary-cyan);
}

.auth-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--color-primary-cyan);
  text-decoration: none;
  font-size: 0.9375rem;
}

.auth-link:hover {
  text-decoration: underline;
}

.register-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.register-link a {
  color: var(--color-primary-cyan);
  text-decoration: none;
  font-weight: 500;
}

.register-link a:hover {
  text-decoration: underline;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border-pale);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-surface-white);
  transition: all 0.15s;
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary-cyan) 20%, transparent);
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 8px;
}

/* --- WYSIWYG Editor ------------------------------------------------------ */
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-pale);
  background: var(--color-surface-alt);
}

.wysiwyg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.875rem;
}

.wysiwyg-btn:hover,
.wysiwyg-btn.active {
  background: var(--color-primary-cyan);
  color: white;
}

.wysiwyg-btn[data-value] {
  width: auto;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.wysiwyg-sep {
  width: 1px;
  height: 24px;
  background: var(--color-border-pale);
  margin: 0 4px;
}

.wysiwyg-editor {
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  padding: 24px;
  background: var(--color-surface-white);
  border: 1px solid var(--color-border-pale);
  border-radius: 0 0 16px 16px;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-primary);
}

.wysiwyg-editor:focus {
  border-color: var(--color-primary-cyan);
}

.wysiwyg-editor h1 { font-size: 2.5rem; font-weight: 700; margin: 1.5rem 0 1rem; }
.wysiwyg-editor h2 { font-size: 2rem; font-weight: 700; margin: 1.5rem 0 1rem; }
.wysiwyg-editor h3 { font-size: 1.5rem; font-weight: 600; margin: 1.25rem 0 0.75rem; }
.wysiwyg-editor p { margin: 0 0 1rem; }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 1rem 0; padding-left: 1.5rem; }
.wysiwyg-editor li { margin: 0.5rem 0; }
.wysiwyg-editor a { color: var(--color-primary-cyan); text-decoration: underline; }
.wysiwyg-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.wysiwyg-editor blockquote { border-left: 4px solid var(--color-primary-cyan); padding-left: 1rem; margin: 1rem 0; color: var(--color-text-secondary); font-style: italic; }

/* --- Buttons (extended) -------------------------------------------------- */
.btn-lg {
  padding: 16px 32px;
  font-size: 1.0625rem;
}

.btn-light {
  background: white;
  color: var(--color-primary-cyan);
  border-color: white;
}

.btn-light:hover {
  background: var(--color-surface-alt);
}

.btn-outline-light {
  border: 1px solid rgba(255,255,255,0.5);
  color: white;
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* --- Alerts -------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-success {
  background: color-mix(in srgb, #15803d 12%, transparent);
  color: #15803d;
  border: 1px solid color-mix(in srgb, #15803d 30%, transparent);
}

.alert-error {
  background: color-mix(in srgb, #b91c1c 12%, transparent);
  color: #b91c1c;
  border: 1px solid color-mix(in srgb, #b91c1c 30%, transparent);
}

.alert-warning {
  background: color-mix(in srgb, #d97706 12%, transparent);
  color: #d97706;
  border: 1px solid color-mix(in srgb, #d97706 30%, transparent);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
  .global-hero { padding: 60px 16px; }
  .global-section { padding: 60px 16px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .footer-nav { text-align: center; }
  .wysiwyg-toolbar { justify-content: center; }
}