/* ============================================
   RTDMusic IA — Design System v3
   Apple-inspired, full dark mode, responsive.
   ============================================ */

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

:root {
  /* LIGHT theme */
  --bg:           #FBFBFD;
  --bg-section:   #FFFFFF;
  --bg-soft:      #F5F5F7;
  --bg-card:      #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --text:         #1D1D1F;
  --text-soft:    #6E6E73;
  --text-mute:    #86868B;
  --line:         #D2D2D7;
  --line-soft:    #E8E8ED;
  --accent:       #0066CC;
  --accent-hover: #0052A3;
  --black:        #000;
  --white:        #fff;
  --invert:       #1D1D1F; /* color que se invierte en dark */
  --invert-text:  #FFFFFF;
  --bubble-user-bg: #1D1D1F;
  --bubble-user-text: #FFFFFF;
  --bubble-ai-bg:   #F5F5F7;
  --bubble-ai-text: #1D1D1F;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --nav-bg: rgba(251,251,253,0.72);
}

[data-theme="dark"] {
  --bg:           #000000;
  --bg-section:   #0a0a0c;
  --bg-soft:      #1c1c1e;
  --bg-card:      #1c1c1e;
  --bg-elevated:  #2c2c2e;
  --text:         #F5F5F7;
  --text-soft:    #A1A1A6;
  --text-mute:    #6E6E73;
  --line:         #38383C;
  --line-soft:    #2c2c2e;
  --accent:       #2997FF;
  --accent-hover: #5DADFF;
  --invert:       #FFFFFF;
  --invert-text:  #000000;
  --bubble-user-bg: #FFFFFF;
  --bubble-user-text: #000000;
  --bubble-ai-bg:   #2c2c2e;
  --bubble-ai-text: #F5F5F7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --nav-bg: rgba(0,0,0,0.72);
}

:root {
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --r-2xl: 40px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== TYPOGRAPHY ===== */
.display-1 { font-size: clamp(40px, 6vw, 80px); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.display-2 { font-size: clamp(32px, 4.5vw, 56px); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; }
.display-3 { font-size: clamp(24px, 3vw, 36px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.lead { font-size: 21px; line-height: 1.4; color: var(--text-soft); font-weight: 400; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-soft); }
.muted { color: var(--text-soft); }
.tiny { font-size: 13px; color: var(--text-mute); }

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 880px; margin: 0 auto; padding: 0 24px; }

section { padding: 100px 0; }
section.tight { padding: 60px 0; }
.section-soft { background: var(--bg-soft); }

@media (max-width: 640px) {
  section { padding: 60px 0; }
}

/* ===== NAVBAR ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
  z-index: 1000;
  transition: background-color .25s, border-color .25s;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand-mark {
  width: 22px; height: 22px;
  background: var(--invert); color: var(--invert-text);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-link {
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
  opacity: 0.85;
  transition: opacity .15s;
}
.nav-link:hover { opacity: 1; color: var(--text); }
.nav-cta {
  font-size: 13px;
  background: var(--invert);
  color: var(--invert-text);
  padding: 6px 14px;
  border-radius: 980px;
  font-weight: 500;
  transition: opacity .15s;
}
.nav-cta:hover { opacity: 0.85; color: var(--invert-text); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 32px; height: 32px;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  opacity: 0.75;
}
.icon-btn:hover { background: var(--bg-soft); opacity: 1; }

/* Lang dropdown */
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  min-width: 160px;
  display: none;
  z-index: 100;
}
.lang-menu.show { display: block; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
}
.lang-menu a:hover { background: var(--bg-soft); color: var(--text); }
.lang-menu a.active { font-weight: 600; }

@media (max-width: 760px) {
  .nav-links .nav-link { display: none; }
}
@media (max-width: 480px) {
  .nav-inner { gap: 8px; }
  .nav-brand span:nth-child(2) { display: none; } /* only mark on tiny screens */
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all .2s ease;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); color: var(--white); transform: translateY(-1px); }
.btn-dark, .btn-invert { background: var(--invert); color: var(--invert-text); }
.btn-dark:hover, .btn-invert:hover { transform: translateY(-1px); color: var(--invert-text); opacity: 0.9; }
.btn-light {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-light:hover { border-color: var(--text); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

.link-arrow {
  color: var(--accent);
  font-size: 16px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-arrow::after { content: '›'; font-size: 18px; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ===== HERO ===== */
.hero {
  padding: 120px 24px 80px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(40px, 6.5vw, 84px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  color: var(--text);
}
.hero h1 .accent {
  background: linear-gradient(180deg, var(--text) 0%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 400;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 auto 36px;
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: 100px 16px 60px; }
}

.hero-visual {
  margin-top: 60px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-section) 100%);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9;
  position: relative;
}

@media (max-width: 720px) {
  .hero-visual { aspect-ratio: 4 / 5; }
}

/* ===== SECTION HEADER ===== */
.section-head {
  text-align: center;
  margin-bottom: 60px;
}
.section-head h2 {
  font-size: clamp(28px, 4.5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 14px;
}
.section-head p {
  font-size: clamp(16px, 2vw, 21px);
  color: var(--text-soft);
  max-width: 600px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== FEATURE GRID ===== */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 44px 36px;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-soft);
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.feature-card.dark {
  background: var(--invert);
  color: var(--invert-text);
  border-color: var(--invert);
}
.feature-card.dark .feature-eyebrow { color: var(--invert-text); opacity: 0.6; }
.feature-card.dark .feature-title { color: var(--invert-text); }
.feature-card.dark .feature-desc { color: var(--invert-text); opacity: 0.75; }
.feature-card.wide { grid-column: span 2; min-height: 280px; }

.feature-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.feature-title {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 12px;
}
.feature-desc {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.55;
  max-width: 420px;
}

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
  .feature-card.wide { grid-column: span 1; }
  .feature-card { padding: 32px 24px; min-height: 240px; }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-soft);
  padding: 50px 0 30px;
  border-top: 1px solid var(--line-soft);
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-mute);
  flex-wrap: wrap;
  gap: 12px;
}

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

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,151,255,0.15);
}
.form-error {
  background: rgba(220,38,38,0.08);
  color: #DC2626;
  border: 1px solid rgba(220,38,38,0.25);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 16px;
}
[data-theme="dark"] .form-error { color: #FCA5A5; }
.form-success {
  background: rgba(22,163,74,0.08);
  color: #16A34A;
  border: 1px solid rgba(22,163,74,0.25);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 16px;
}
[data-theme="dark"] .form-success { color: #86EFAC; }

/* ===== AUTH PAGE ===== */
.auth-wrap {
  min-height: 100vh;
  padding: 100px 24px 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
}
.auth-card h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  text-align: center;
}
.auth-card .auth-sub {
  text-align: center;
  color: var(--text-soft);
  margin-bottom: 28px;
  font-size: 15px;
}
.auth-card .form-link {
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 20px;
}

/* ===== PRICING ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border: 1px solid var(--invert);
  background: var(--invert);
  color: var(--invert-text);
}
.price-card.featured .price-name,
.price-card.featured .price-amount,
.price-card.featured .price-features li { color: var(--invert-text); }
.price-card.featured .price-features li svg { color: var(--invert-text); }

.price-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.price-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
}
.price-amount {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 12px 0 4px;
}
.price-amount sub { font-size: 16px; font-weight: 400; color: var(--text-soft); }
.price-card.featured .price-amount sub { color: var(--invert-text); opacity: 0.7; }
.price-desc {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 24px;
  min-height: 40px;
}
.price-card.featured .price-desc { color: var(--invert-text); opacity: 0.7; }

.price-features {
  list-style: none;
  flex: 1;
  margin-bottom: 24px;
}
.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  padding: 8px 0;
  color: var(--text);
  line-height: 1.4;
}
.price-features li svg {
  color: var(--text);
  flex-shrink: 0;
  margin-top: 4px;
}

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

/* ===== LEGAL PAGES ===== */
.legal-page {
  padding: 120px 0 80px;
  max-width: 720px;
  margin: 0 auto;
}
.legal-page h1 {
  font-size: clamp(32px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.legal-page .last-update {
  color: var(--text-mute);
  font-size: 14px;
  margin-bottom: 40px;
}
.legal-page h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 36px 0 12px;
  color: var(--text);
}
.legal-page p, .legal-page ul, .legal-page ol {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.legal-page ul, .legal-page ol { padding-left: 22px; }
.legal-page li { margin-bottom: 6px; }
.legal-page strong { color: var(--text); font-weight: 600; }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-banner p { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.5; }
.cookie-banner .actions { display: flex; gap: 8px; }
.cookie-banner .btn { flex: 1; font-size: 13px; padding: 8px 14px; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 40px; }
.mt-xl { margin-top: 60px; }
