:root {
  --bg-main: #0f0a15;
  --bg-light: #1a1425;
  --bg-hero: #12101f;
  --accent: #7c5dff;
  --accent-soft: rgba(124, 93, 255, 0.15);
  --accent-strong: #9b7eff;
  --ink-main: #f0ecf9;
  --ink-soft: #b8b3c8;
  --border-soft: #2a2438;
  --card-bg: #1f1a2e;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.4);
}

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

html, 
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-main);
  background: var(--bg-main);
}

/* Layout base */

body {
  min-height: 100vh;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 16px 80px;
}

.section {
  padding: clamp(40px, 8vh, 56px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: slideInFade 0.6s ease-out backwards;
}

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

.section.light {
  background: var(--bg-light);
}

.section-header {
  max-width: 640px;
  margin-bottom: 28px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.section-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* Header */

.top-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 10, 21, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo FinClave: llave minimalista */

.logo {
  position: relative;
  width: 32px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: spinKey 2s ease-in-out infinite;
}

@keyframes spinKey {
  0%, 100% { transform: rotateZ(0deg); }
  50% { transform: rotateZ(5deg); }
}

.logo.small {
  transform: scale(0.85);
  animation: none;
}

.logo-key-head {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 2px rgba(124, 93, 255, 0.25);
}

.logo-key-body {
  position: absolute;
  height: 3px;
  width: 20px;
  background: var(--accent);
  border-radius: 999px;
  left: 15px;
}

.logo-key-teeth {
  position: absolute;
  right: 1px;
  height: 12px;
  width: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.logo-key-teeth span {
  flex: 1;
  border-radius: 999px;
  border: 2px solid var(--accent);
}

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

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

.brand-tagline {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.top-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.nav-link:hover {
  background: rgba(124, 93, 255, 0.15);
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 93, 255, 0.4);
}

/* Hero */

.hero {
  background: radial-gradient(circle at top left, #18132a 0, #0f0a15 55%, #0f0a15 100%);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.hero-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  margin: 0 0 8px;
  animation: popIn 0.4s ease-out;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 3.6vw, 2rem);
  line-height: 1.2;
  animation: slideInLeft 0.5s ease-out 0.1s backwards;
}

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

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-highlight {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  box-decoration-break: clone;
  transition: all 0.3s ease;
}

.hero-title:hover .hero-highlight {
  background: rgba(124, 93, 255, 0.2);
}

.hero-subtitle {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.96rem;
  animation: slideInLeft 0.5s ease-out 0.2s backwards;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  animation: slideInLeft 0.5s ease-out 0.3s backwards;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.hero-badges span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(124, 93, 255, 0.1);
  animation: popIn 0.4s ease-out backwards;
}

.hero-badges span:nth-child(1) { animation-delay: 0.4s; }
.hero-badges span:nth-child(2) { animation-delay: 0.5s; }
.hero-badges span:nth-child(3) { animation-delay: 0.6s; }

/* Buttons */

.primary-btn, 
.ghost-btn {
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.86rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 9px 18px rgba(124, 93, 255, 0.35);
}

.primary-btn:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(124, 93, 255, 0.45);
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn.stretch {
  width: 100%;
}

.ghost-btn {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(124, 93, 255, 0.4);
}

.ghost-btn:hover {
  background: rgba(124, 93, 255, 0.15);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Cards y formularios */

.hero-card, 
.step-card, 
.content-block, 
.habit-card, 
.tip-card, 
.tool-card, 
.faq-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.hero-card:hover, 
.step-card:hover, 
.content-block:hover, 
.habit-card:hover, 
.tool-card:hover {
  box-shadow: 0 20px 40px rgba(124, 93, 255, 0.2);
  border-color: rgba(124, 93, 255, 0.4);
}

.hero-card {
  padding: 16px 16px 14px;
}

.hero-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.snapshot-form label, 
.tool-form label {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 10px;
  font-weight: 500;
}

.snapshot-form input, 
.tool-form input, 
.snapshot-form select {
  font-size: 0.9rem;
}

.input-with-prefix, 
.input-with-suffix {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  background: #14101b;
  transition: all 0.2s ease;
}

.input-with-prefix:focus-within, 
.input-with-suffix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 93, 255, 0.15);
}

.input-with-prefix span, 
.input-with-suffix span {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.input-with-prefix input, 
.input-with-suffix input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--ink-main);
}

.input-with-prefix input::placeholder, 
.input-with-suffix input::placeholder {
  color: rgba(240, 236, 249, 0.4);
}

.snapshot-form select {
  margin-top: 4px;
  width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  border: 1.5px solid var(--border-soft);
  background: #14101b;
  transition: all 0.2s ease;
  cursor: pointer;
  color: var(--ink-main);
}

.snapshot-form select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 93, 255, 0.15);
}

.snapshot-result, 
.tool-result {
  margin-top: 10px;
  padding: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--ink-soft);
  animation: slideInFade 0.3s ease-out;
  background: rgba(124, 93, 255, 0.08);
  border-radius: var(--radius-md);
}

/* Grids */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.step-card {
  padding: 12px 12px 10px;
  position: relative;
  animation: popIn 0.4s ease-out backwards;
}

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

.step-number {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.78rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
}

.step-card h3 {
  margin: 4px 0 6px;
  font-size: 0.98rem;
}

.step-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.content-block {
  padding: 14px 14px 12px;
  font-size: 0.9rem;
  animation: popIn 0.4s ease-out backwards;
}

.content-block:nth-child(odd) { animation-delay: 0s; }
.content-block:nth-child(even) { animation-delay: 0.1s; }

.content-block h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.content-block p, 
.content-block li {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.content-block ul, 
.content-block ol {
  margin: 0 0 6px 18px;
  padding: 0;
}

.note {
  margin-top: 4px;
  padding: 6px 8px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  border-left: 3px solid var(--accent);
}

/* Hábitos */

.habits-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
}

.habit-card {
  padding: 10px 10px 8px;
  margin-bottom: 10px;
  animation: popIn 0.4s ease-out backwards;
}

.habit-card:nth-child(1) { animation-delay: 0s; }
.habit-card:nth-child(2) { animation-delay: 0.1s; }
.habit-card:nth-child(3) { animation-delay: 0.2s; }
.habit-card:nth-child(4) { animation-delay: 0.3s; }

.habit-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.habit-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.tip-card {
  padding: 12px 12px 10px;
  background: linear-gradient(145deg, #2a2235, #24172f);
  border: 1px solid rgba(124, 93, 255, 0.2);
}

.tip-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--accent-strong);
}

.tip-card p, 
.tip-card li {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Herramientas */

.tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.tool-card {
  padding: 14px 14px 12px;
  animation: popIn 0.4s ease-out backwards;
}

.tool-card:nth-child(1) { animation-delay: 0s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.tool-card p {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* FAQ */

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  overflow: hidden;
  animation: popIn 0.4s ease-out backwards;
}

.faq-item:nth-child(1) { animation-delay: 0s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.2s; }
.faq-item:nth-child(4) { animation-delay: 0.3s; }

.faq-question {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink-main);
}

.faq-question:hover {
  background: rgba(124, 93, 255, 0.08);
}

.faq-icon {
  margin-left: 8px;
  font-size: 1rem;
  color: var(--accent-strong);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-answer {
  max-height: 0;
  padding: 0 12px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  padding: 8px 12px 10px;
  max-height: 300px;
}

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

/* Footer */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 16px 18px;
  background: #141019;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.footer-main {
  max-width: 1100px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-text .brand-name {
  font-size: 0.9rem;
}

.footer-text .brand-tagline {
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}

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

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
}

/* Responsivo (móvil primero) */

@media (max-width: 799px) {
  main {
    padding-top: 80px;
  }

  .hero-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    order: -1;
  }

  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .habits-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-main {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 800px) {
  main {
    padding-inline: 24px;
  }

  .hero-card {
    transform: translateY(6px);
    animation: slideInRight 0.5s ease-out 0.4s backwards;
  }

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