/* =========================================================
   TeAyudoMigrante — Shared styles
   Brand variables, base, header/nav/footer, theme support
   ========================================================= */

:root {
  /* Brand colors (light mode) */
  --bg: #fafbfc;
  --bg-soft: #f1f4f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0a1340;
  --text-muted: #5a6178;
  --border: #e1e6ef;

  --primary: #002b8a;
  --primary-light: #1f4ecf;
  --primary-foreground: #ffffff;

  --accent: #ee5a3d;
  --accent-light: #f47e66;
  --accent-foreground: #ffffff;

  --secondary: #5cbdf2;

  /* Effects */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-light));
  --gradient-hero: linear-gradient(180deg, var(--bg) 0%, #eef2f9 50%, var(--bg) 100%);
  --shadow-sm: 0 2px 8px rgba(10, 19, 64, 0.06);
  --shadow-md: 0 8px 32px rgba(10, 19, 64, 0.10);
  --shadow-glow: 0 10px 40px rgba(0, 43, 138, 0.25);
  --shadow-glow-accent: 0 10px 40px rgba(238, 90, 61, 0.25);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 43, 138, 0.12);

  /* Spacing & radii */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --container: 1200px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg: #050a1f;
  --bg-soft: #0a1230;
  --surface: #0e1838;
  --surface-2: #11204a;
  --text: #f4f6fb;
  --text-muted: #98a3c2;
  --border: #1c2954;

  --primary: #5cbdf2;
  --primary-light: #8ad2f6;
  --primary-foreground: #050a1f;

  --accent: #f47e66;
  --accent-light: #f7a08e;
  --accent-foreground: #050a1f;

  --gradient-primary: linear-gradient(135deg, #002b8a, #5cbdf2);
  --gradient-accent: linear-gradient(135deg, #f47e66, #f7a08e);
  --gradient-hero: linear-gradient(180deg, var(--bg) 0%, #0a1640 50%, var(--bg) 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 10px 40px rgba(92, 189, 242, 0.3);
  --shadow-glow-accent: 0 10px 40px rgba(244, 126, 102, 0.3);

  --glass-bg: rgba(14, 24, 56, 0.78);
  --glass-border: rgba(92, 189, 242, 0.18);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p  { font-size: clamp(1rem, 1.6vw, 1.0625rem); color: var(--text-muted); }

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.gradient-text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 14px 50px rgba(0, 43, 138, 0.4); }
.btn-accent {
  background: var(--gradient-accent);
  color: var(--accent-foreground);
  box-shadow: var(--shadow-glow-accent);
}
.btn-outline {
  background: var(--glass-bg);
  color: var(--text);
  border: 2px solid var(--glass-border);
  backdrop-filter: blur(16px);
}
.btn-outline:hover { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.btn-lg { min-height: 56px; padding: 1.125rem 2.25rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.field input, .field textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  min-height: 44px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 43, 138, 0.12);
}

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: var(--glass-bg);
  border-bottom-color: var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 1rem;
}
.brand img { height: 44px; width: auto; transition: transform 0.25s ease; }
.brand:hover img { transform: scale(1.05); }

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  position: relative;
  padding: 0.6rem 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(0, 43, 138, 0.08); }
.nav-links a.active {
  color: var(--text);
  background: rgba(0, 43, 138, 0.10);
}
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active { background: rgba(92, 189, 242, 0.12); }

.nav-actions { display: none; align-items: center; gap: 0.75rem; }

.theme-toggle {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: transform 0.25s ease, background 0.25s ease;
}
.theme-toggle:hover { transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; color: var(--text); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text);
}
.menu-toggle:hover { background: rgba(0, 43, 138, 0.08); }

.mobile-menu {
  display: none;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.25rem;
}
.mobile-menu.open { display: block; animation: fadeIn 0.25s ease; }
.mobile-menu a {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-muted);
}
.mobile-menu a:hover, .mobile-menu a.active { color: var(--text); background: rgba(0, 43, 138, 0.08); }
.mobile-menu .actions { display: flex; gap: 0.75rem; padding: 0.75rem 1rem 0; }

@media (min-width: 1024px) {
  .nav-inner { height: 88px; }
  .brand img { height: 52px; }
  .nav-links, .nav-actions { display: flex; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.footer-brand img { height: 48px; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; max-width: 360px; }
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text);
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); font-size: 0.92rem; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Page wrapper offset for fixed header ---------- */
.page { padding-top: 76px; }
@media (min-width: 1024px) { .page { padding-top: 88px; } }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Section helpers */
.section { padding: 4rem 0; }
@media (min-width: 768px) { .section { padding: 6rem 0; } }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
