/* ==========================================================================
   FileSort Pro — Design System
   Basado en ui/theme.py (customtkinter)
   ========================================================================== */

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

:root,
[data-theme="dark"] {
  --bg-main: #0F1117;
  --bg-surface: #1A1D27;
  --bg-elevated: #22263A;
  --bg-input: #2A2E42;
  --accent: #7B5EA7;
  --accent-hover: #9B7EC7;
  --accent-light: #C3A9E8;
  --accent-soft: #2A2440;
  --accent-glow: #7B5EA740;
  --text-primary: #F0F0F8;
  --text-secondary: #9A9AB0;
  --text-muted: #5A5A7A;
  --success: #4CAF82;
  --warning: #F0A050;
  --error: #E05A5A;
  --info: #5090E0;
  --border: #2E3248;
  --border-focused: #7B5EA7;
  --switch-off: #3A3E55;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg-main: #F0EEF8;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-input: #EEEAF8;
  --accent: #7B5EA7;
  --accent-hover: #6A4F94;
  --accent-light: #C3A9E8;
  --accent-soft: #E8E0FF;
  --accent-glow: #7B5EA740;
  --text-primary: #1A1625;
  --text-secondary: #5A5070;
  --text-muted: #8B82A0;
  --success: #4CAF82;
  --warning: #F0A050;
  --error: #E05A5A;
  --info: #5090E0;
  --border: #C8C0E8;
  --border-focused: #7B5EA7;
  --switch-off: #D0CCE5;
  --shadow: 0 4px 24px rgba(123,94,167,0.1);
  --shadow-lg: 0 8px 48px rgba(123,94,167,0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-secondary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

ul { list-style: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
  transition: color 0.3s ease;
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.header-logo img {
  height: 32px;
  width: auto;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-desktop a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Theme Toggle Switch --- */
.theme-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--switch-off);
  border-radius: 24px;
  transition: background-color 0.3s ease;
}

.theme-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.theme-switch input:checked + .theme-slider {
  background-color: var(--accent);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(20px);
}

/* --- Language Toggle --- */
.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover {
  background-color: var(--bg-input);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- CTA Button (header) --- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-cta:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  color: #fff;
}

/* --- Mobile menu --- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 480px;
  transition: color 0.3s ease;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.hero-tags span {
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--text-primary);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent);
  color: var(--accent);
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mockup {
  width: 100%;
  aspect-ratio: 16/10;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  overflow: hidden;
}

.hero-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* ==========================================================================
   Features
   ========================================================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: color 0.3s ease;
}

/* ==========================================================================
   Pricing
   ========================================================================== */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.pricing-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  position: relative;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

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

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow-lg);
  transform: scale(1.03);
}

.pricing-card.featured:hover {
  transform: scale(1.03) translateY(-4px);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent);
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
}

.tier-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.pricing-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.pricing-header .tier-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.price-box {
  text-align: center;
  margin-bottom: 8px;
}

.price-box .amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.price-box .period {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.price-lifetime {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  transition: color 0.3s ease;
}

.pricing-divider {
  height: 1px;
  background-color: var(--border);
  margin: 20px 0;
  transition: background-color 0.3s ease;
}

.pricing-benefits {
  margin-bottom: 24px;
}

.pricing-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 6px 0;
  transition: color 0.3s ease;
}

.pricing-benefits li .check {
  color: var(--success);
  flex-shrink: 0;
  font-weight: 700;
}

.pricing-benefits li .warn {
  color: var(--warning);
  flex-shrink: 0;
}

.pricing-benefits li .star {
  color: var(--accent);
  flex-shrink: 0;
}

.pricing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-pricing {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--accent);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-pricing:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  color: #fff;
}

.btn-pricing-outline {
  display: block;
  width: 100%;
  text-align: center;
  background-color: transparent;
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-pricing-outline:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   FAQ - Accordion
   ========================================================================== */

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.3s ease;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 24px 18px;
}

.faq-answer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  transition: color 0.3s ease;
}

.faq-answer a {
  color: var(--accent);
  font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand .footer-logo img {
  height: 28px;
  width: auto;
}

.footer-brand .footer-logo span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
  transition: color 0.3s ease;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  transition: border-color 0.3s ease;
}

.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

/* ==========================================================================
   Legal pages (privacy, terms, 404)
   ========================================================================== */

.legal-page {
  padding: 120px 0 60px;
  min-height: 100vh;
}

.legal-page .container {
  max-width: 800px;
}

.legal-page h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.legal-page .last-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  transition: color 0.3s ease;
}

.legal-page h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.legal-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.legal-page p,
.legal-page li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.legal-page ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-page li {
  margin-bottom: 6px;
}

.legal-page strong {
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.3s ease;
}

.legal-page .contact-email {
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   404
   ========================================================================== */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
}

.error-page .error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.error-page h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.error-page p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 400px;
  transition: color 0.3s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content p {
    margin: 0 auto 28px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-tags {
    justify-content: center;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .pricing-card.featured {
    transform: none;
  }

  .pricing-card.featured:hover {
    transform: translateY(-4px);
  }

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

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 120px 0 48px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

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

  .section {
    padding: 48px 0;
  }

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

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