/* TuComunidad365 - Estilos profesionales */
:root {
  --primary: #0f766e;
  --primary-dark: #0d9488;
  --primary-light: #14b8a6;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.narrow { max-width: 720px; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.logo .accent { color: var(--primary); }
.logo-icon { font-size: 1.4rem; }
.logo-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-soft);
  color: var(--primary);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  text-decoration: none;
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.9; }

.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.875rem; }
.btn-install { white-space: nowrap; }

/* Hero */
.hero {
  padding: 3.5rem 0 4rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 50%, #ecfdf5 100%);
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.badge {
  display: inline-block;
  background: #ccfbf1;
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Phone mockup */
.phone-mockup {
  display: flex;
  justify-content: center;
}

.phone-screen {
  width: 260px;
  background: var(--surface);
  border-radius: 28px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  border: 3px solid #1e293b;
}

.app-preview {
  background: linear-gradient(180deg, #0f766e 0%, #134e4a 100%);
  border-radius: 18px;
  padding: 1.25rem;
  min-height: 320px;
  color: white;
}

.app-header {
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.05rem;
}

.app-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.app-card.highlight {
  background: var(--accent);
  color: #1e293b;
  font-weight: 600;
}

/* Stats */
.stats {
  padding: 2.5rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.bg-soft { background: var(--bg-soft); }

.text-center { text-align: center; }
.mt-2 { margin-top: 1.5rem; }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.feature-card.featured {
  border-color: var(--primary);
  background: linear-gradient(145deg, #f0fdfa, #ffffff);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* Privacy box */
.privacy-section { background: #ecfdf5; }
.privacy-box {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #a7f3d0;
}

.privacy-icon { font-size: 2.5rem; flex-shrink: 0; }
.privacy-box h2 { margin-bottom: 0.75rem; font-size: 1.4rem; }
.privacy-box p { color: var(--text-muted); margin-bottom: 1rem; }

/* CTA */
.cta-section { background: var(--primary); color: white; }
.cta-box { text-align: center; }
.cta-box h2 { margin-bottom: 0.5rem; font-size: 1.75rem; }
.cta-box p { opacity: 0.9; margin-bottom: 1.25rem; }
.cta-hint { font-size: 0.85rem; opacity: 0.75; margin-top: 0.75rem; }
.cta-section .btn-primary {
  background: white;
  color: var(--primary);
  border-color: white;
}
.cta-section .btn-primary:hover {
  background: #f0fdfa;
}

/* Page hero */
.page-hero {
  padding: 2.5rem 0;
  background: linear-gradient(135deg, #f0fdfa, #f8fafc);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-hero p { color: var(--text-muted); }

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}
.alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* Tool */
.tool-section { padding-top: 2rem; }

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}

.tool-tab {
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: inherit;
  transition: 0.15s;
}

.tool-tab:hover { background: var(--bg-soft); color: var(--text); }
.tool-tab.active {
  background: var(--primary);
  color: white;
}

.tool-panel { display: none; }
.tool-panel.active { display: block; }

.tool-panel h2 { margin-bottom: 0.35rem; font-size: 1.35rem; }
.muted { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.25rem; }
.small { font-size: 0.85rem; }

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 560px;
}

.grid-form button { grid-column: 1 / -1; }

.tool-form input,
.tool-form textarea,
.tool-form select {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
}

.tool-form input:focus,
.tool-form textarea:focus,
.tool-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.tool-form label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: -0.35rem;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tool-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.tool-item-content { flex: 1; }
.tool-item-content strong { display: block; margin-bottom: 0.2rem; }
.tool-item-meta { font-size: 0.85rem; color: var(--text-muted); }

.tool-item-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  opacity: 0.7;
}
.btn-icon:hover { opacity: 1; }

.resumen-gastos {
  background: #ecfdf5;
  padding: 0.85rem 1.15rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.resultado-calc {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1.25rem;
  border-radius: 10px;
  margin-top: 1rem;
  max-width: 400px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Legal */
.legal-content h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.6rem;
  color: var(--primary);
}
.legal-content p, .legal-content ul {
  margin-bottom: 0.85rem;
  color: var(--text);
}
.legal-content ul { padding-left: 1.35rem; }
.legal-content li { margin-bottom: 0.35rem; }

.info-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  margin: 1rem 0;
}

.check-list {
  list-style: none;
  padding: 0;
}
.check-list li {
  padding: 0.4rem 0 0.4rem 1.75rem;
  position: relative;
}
.check-list li::before {
  content: "✅";
  position: absolute;
  left: 0;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.contact-form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

/* Footer */
.footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: auto;
  padding-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer .logo { color: white; margin-bottom: 0.75rem; }
.footer a { color: #94a3b8; }
.footer a:hover { color: white; }
.footer h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-contact .small { font-size: 0.8rem; margin-top: 0.75rem; opacity: 0.8; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 1.15rem 0;
  font-size: 0.85rem;
  text-align: center;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.15rem;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  display: none;
}

.cookie-banner.show { display: block; }

.cookie-content {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-content p {
  flex: 1;
  min-width: 260px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookie-content a { color: var(--primary-light); }

.cookie-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .phone-mockup { order: -1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .privacy-box { flex-direction: column; }
}

@media (max-width: 700px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .menu-toggle { display: flex; }
  .btn-install { display: none !important; }
  .grid-form { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .tool-tabs { gap: 0.35rem; }
  .tool-tab { font-size: 0.8rem; padding: 0.45rem 0.7rem; }
}

/* Media & agenda pro */
.media-card { position: relative; z-index: 1; }
.media-card a.btn { flex-shrink: 0; pointer-events: auto !important; cursor: pointer; }
.video-wrap {
  margin-top: 0.75rem;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.img-card { padding: 0.75rem !important; overflow: hidden; }
.img-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.agenda-item { align-items: flex-start !important; }
.agenda-date {
  min-width: 56px;
  text-align: center;
  background: linear-gradient(145deg, #0f766e, #14b8a6);
  color: white;
  border-radius: 10px;
  padding: 0.5rem 0.35rem;
  line-height: 1.15;
}
.agenda-day { display: block; font-size: 1.35rem; font-weight: 800; }
.agenda-month { display: block; font-size: 0.7rem; opacity: 0.9; }
.agenda-past { opacity: 0.55; }
.agenda-past .agenda-date { background: #94a3b8; }

/* Portal header polish */
#portal-finca .tool-tabs {
  position: sticky;
  top: 64px;
  background: var(--bg);
  z-index: 50;
  padding-top: 0.5rem;
  margin-bottom: 1.25rem;
}
