:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4A3DB8;
  --secondary: #FF6B6B;
  --secondary-light: #FFA8A8;
  --accent: #FECA57;
  --accent-light: #FFF3CD;
  --success: #00B894;
  --success-light: #D4EFDF;
  --warning: #FDCB6E;
  --warning-light: #FFF9E6;
  --danger: #E17055;
  --danger-light: #FDECEA;
  --bg: #FFF8F0;
  --bg-card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #E8E4E0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 50%;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 70px;
  --header-height: 60px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Public Landing Page ── */
.public-container {
  min-height: 100vh;
  background: var(--bg);
}

.public-container.hidden { display: none; }

.public-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.public-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Logo circle wrapper ── */
.logo-circle {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Sizes */
.logo-circle-xs  { width: 36px;  height: 36px;  border: 2px solid rgba(255,255,255,0.35); }
.logo-circle-sm  { width: 38px;  height: 38px; }
.logo-circle-md  { width: 80px;  height: 80px;  box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.logo-circle-lg  { width: 130px; height: 130px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); animation: bounce 2s infinite; }
.logo-circle-profile { width: 80px; height: 80px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

.public-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 48px 24px 56px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: 40px 40px 0 0;
}

.hero-content {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-logo-img {
  width: 130px;
  height: 130px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  object-fit: cover;
  object-position: 50% 20%;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.hero p {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.hero-actions .btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.hero-actions .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

/* Public Sections */
.public-section-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

.public-section-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.public-section-subtitle {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Features Grid */
.public-features {
  padding: 40px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Public Capsules */
.public-capsules {
  padding: 40px 0;
  background: linear-gradient(180deg, var(--bg) 0%, #F0EDE8 100%);
}

/* Feature list inside cards */
.feature-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.feature-list li {
  font-size: 12px;
  color: var(--text-light);
}

/* Stats Section */
.public-stats {
  background: var(--primary);
  padding: 36px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stat-card {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  color: #fff;
}
.stat-big {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-desc {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.4;
}

/* How it works */
.public-how {
  padding: 40px 0;
  background: var(--bg);
}
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}
.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.step-body p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

/* FAQ Section */
.public-faq {
  padding: 40px 0;
  background: #F5F0FF;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  gap: 12px;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item[open] .faq-question::after {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* CTA Section */
.public-cta {
  padding: 40px 0 48px;
}

.cta-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
}

.cta-logo-img {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  object-fit: cover;
  object-position: 50% 20%;
}

.cta-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.cta-card p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.cta-card .btn-primary {
  background: #fff;
  color: var(--primary-dark);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cta-card .btn-primary:hover {
  background: #F0F0F0;
}

/* Footer */
.public-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Auth back button */
.auth-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  z-index: 10;
}

.auth-back-btn:hover { background: rgba(255,255,255,0.3); }

/* ── Gate Login (anónimo, llamativo) ── */
.gate-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  overflow: hidden;
  z-index: 1000;
}
.gate-container.hidden { display: none; }

.gate-bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  animation: gateFloat 14s ease-in-out infinite;
}
.gate-shape-1 { width: 380px; height: 380px; background: #ff6ec4; top: -80px; left: -80px; }
.gate-shape-2 { width: 320px; height: 320px; background: #7873f5; bottom: -100px; right: -60px; animation-delay: -4s; }
.gate-shape-3 { width: 260px; height: 260px; background: #4facfe; top: 45%; left: 55%; animation-delay: -8s; }

@keyframes gateFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

.gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 44px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: gateCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gateCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-title {
  font-size: 30px;
  font-weight: 900;
  text-align: center;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.gate-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 28px;
}

.gate-form .form-group { margin-bottom: 16px; }

.gate-form .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4b5563;
  margin-bottom: 6px;
}

.gate-form .form-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  color: #111827;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.gate-form .form-group input:focus {
  border-color: #764ba2;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.12);
}

.gate-btn {
  width: 100%;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 22px rgba(118, 75, 162, 0.45);
  transition: all 0.25s ease;
  margin-top: 8px;
}

.gate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(118, 75, 162, 0.55);
}
.gate-btn:active { transform: translateY(0); }

.gate-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: #6b7280;
}

.gate-switch a {
  color: #764ba2;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.gate-switch a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .gate-card { padding: 36px 24px; border-radius: 20px; }
  .gate-title { font-size: 26px; }
}

/* ── Auth Screens ── */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-brand-features {
  display: none;
}

.auth-form-side {
  width: 100%;
  max-width: 400px;
}

.auth-logo-img {
  width: 90px;
  height: 90px;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  object-fit: cover;
  object-position: 50% 20%;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.auth-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover { background: rgba(108, 92, 231, 0.08); }

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

/* ── App Layout ── */
.app-container {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: var(--nav-height);
}

.app-container.active { display: flex; }
.auth-container.hidden { display: none; }

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

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

.header-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  object-fit: cover;
  object-position: 50% 20%;
}

.header-info h1 {
  font-size: 18px;
  font-weight: 700;
}

.header-info p {
  font-size: 12px;
  opacity: 0.85;
}

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

.header-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.header-btn:hover { background: rgba(255,255,255,0.25); }

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--secondary);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
}

/* ── Main Content ── */
.app-content {
  flex: 1;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ── Views ── */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ── Alert Banner ── */
.alert-banner {
  background: linear-gradient(135deg, var(--danger-light) 0%, #FFF0ED 100%);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-banner.warning {
  background: linear-gradient(135deg, var(--warning-light) 0%, #FFFBEF 100%);
  border-color: var(--warning);
}

.alert-banner.success {
  background: linear-gradient(135deg, var(--success-light) 0%, #EAFAF4 100%);
  border-color: var(--success);
}

.alert-icon { font-size: 22px; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.alert-text { font-size: 13px; color: var(--text-light); line-height: 1.4; }

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 24px;
}

.section-header:first-child { margin-top: 0; }

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-action {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.section-action:hover { text-decoration: underline; }

/* ── Pending Summary Card ── */
.summary-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.summary-card::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Checklist ── */
.checklist-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.month-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text);
}

.month-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.month-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.month-label {
  font-size: 16px;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
}

.checklist-category {
  margin-bottom: 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.category-icon.motor { background: #E8F5E9; }
.category-icon.language { background: #E3F2FD; }
.category-icon.social { background: #FFF3E0; }
.category-icon.cognitive { background: #F3E5F5; }

.category-name {
  font-size: 15px;
  font-weight: 700;
}

.category-progress {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: var(--transition);
  cursor: pointer;
}

.checklist-item:hover { box-shadow: var(--shadow); }

.checklist-item.completed {
  background: var(--success-light);
}

.check-circle {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
  font-size: 14px;
  color: transparent;
}

.checklist-item.completed .check-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.check-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.checklist-item.completed .check-text {
  text-decoration: line-through;
  color: var(--text-light);
}

/* ── Capsules ── */
.capsules-grid {
  display: grid;
  gap: 14px;
}

.capsule-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

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

.capsule-banner {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
}

.capsule-banner.motor { background: linear-gradient(135deg, #A8E6CF, #88D8A8); }
.capsule-banner.language { background: linear-gradient(135deg, #87CEEB, #6BB3D9); }
.capsule-banner.social { background: linear-gradient(135deg, #FFD3B6, #FFB88C); }
.capsule-banner.cognitive { background: linear-gradient(135deg, #D4A5FF, #BB86FC); }
.capsule-banner.nutrition { background: linear-gradient(135deg, #FECA57, #F0B429); }
.capsule-banner.sleep { background: linear-gradient(135deg, #A29BFE, #6C5CE7); }

.capsule-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.capsule-body {
  padding: 16px;
}

.capsule-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.capsule-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.capsule-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.capsule-time {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.capsule-read-btn {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
}

/* ── Capsule Detail Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.modal-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--primary-dark);
}

.modal-body h3:first-child { margin-top: 0; }

.modal-body ul {
  padding-left: 20px;
  margin: 8px 0;
}

.modal-body li { margin-bottom: 6px; }

/* ── Reports ── */
.report-month-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.report-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.report-month-title {
  font-size: 16px;
  font-weight: 700;
}

.report-month-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.report-month-badge.good { background: var(--success-light); color: #00856A; }
.report-month-badge.ok { background: var(--warning-light); color: #D4A017; }
.report-month-badge.needs-attention { background: var(--danger-light); color: #C0392B; }

.progress-bar-container {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.good { background: linear-gradient(90deg, var(--success), #00D2A0); }
.progress-bar-fill.ok { background: linear-gradient(90deg, var(--warning), #FFE066); }
.progress-bar-fill.needs-attention { background: linear-gradient(90deg, var(--danger), #FF8A65); }

.report-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.report-detail-item {
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.report-detail-value {
  font-size: 20px;
  font-weight: 800;
}

.report-detail-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.report-cat-icon { font-size: 18px; }
.report-cat-name { flex: 1; font-size: 14px; font-weight: 600; }

.report-cat-bar {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.report-cat-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

.report-cat-pct {
  font-size: 13px;
  font-weight: 700;
  width: 40px;
  text-align: right;
}

/* ── Profile ── */
.profile-header-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-name { font-size: 22px; font-weight: 800; }
.profile-age { font-size: 14px; opacity: 0.85; margin-top: 4px; }

.profile-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.profile-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child { border-bottom: none; }

.profile-row-label {
  font-size: 14px;
  color: var(--text-light);
}

.profile-row-value {
  font-size: 14px;
  font-weight: 600;
}

.btn-logout {
  background: var(--danger-light);
  color: var(--danger);
  border: none;
  margin-top: 10px;
}

.btn-logout:hover { background: #FDDEDE; }

/* Sidebar brand — hidden on mobile */
.sidebar-brand { display: none; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.nav-item.active { color: var(--primary); }

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -2px;
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.nav-icon { font-size: 22px; }

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-text { font-size: 14px; color: var(--text-light); line-height: 1.5; }

/* ── Responsive ── */
@media (min-width: 768px) {
  .hero h1 { font-size: 36px; }
  .hero-actions { flex-direction: row; max-width: 420px; }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
  .public-section-inner { max-width: 700px; }

  .app-content { padding: 30px; }
  .capsules-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-stats { gap: 24px; }
  .report-details { grid-template-columns: repeat(4, 1fr); }

  .bottom-nav {
    top: 0;
    bottom: auto;
    height: var(--header-height);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
    border-radius: 0 0 var(--radius) var(--radius);
    left: 50%;
    transform: translateX(-50%);
  }

  .nav-item.active::before {
    top: auto;
    bottom: -2px;
    border-radius: 3px 3px 0 0;
  }

  .app-container { padding-bottom: 0; padding-top: var(--header-height); }
}

/* ── Desktop layout ── */
@media (min-width: 1024px) {

  /* General containers */
  .public-section-inner { max-width: 1100px; padding: 0 40px; }

  /* Header */
  .public-header {
    padding: 12px 48px;
    max-width: 100%;
  }
  .public-header-logo .public-logo-text { font-size: 24px; }

  /* Header CTA button — pill shape with shadow */
  .public-header .btn {
    width: auto;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 14px rgba(108,92,231,0.35);
    letter-spacing: 0.2px;
    transition: box-shadow 0.2s, transform 0.2s;
  }
  .public-header .btn:hover {
    box-shadow: 0 6px 20px rgba(108,92,231,0.45);
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  }

  /* Hero — two-column layout */
  .hero { padding: 80px 40px; text-align: left; }
  .hero-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 60px;
    row-gap: 16px;
    text-align: left;
  }
  .hero-content > .logo-circle-lg {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
  }
  .hero-content > h1   { grid-column: 1; grid-row: 1; }
  .hero-content > p    { grid-column: 1; grid-row: 2; }
  .hero-actions        { grid-column: 1; grid-row: 3; justify-content: flex-start; }

  .logo-circle-lg { width: 220px; height: 220px; }
  .hero h1 { font-size: 48px; line-height: 1.15; }
  .hero p   { font-size: 17px; }

  /* Features — 4 cols with more detail visible */
  .public-features { padding: 72px 0; }
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .feature-card { padding: 28px 20px; }
  .feature-card h3 { font-size: 16px; }
  .feature-card p  { font-size: 13px; }
  .feature-list li { font-size: 13px; }

  /* Stats — 4 cols en una fila */
  .public-stats { padding: 56px 0; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .stat-big { font-size: 48px; }
  .stat-desc { font-size: 14px; }

  /* How it works — pasos horizontales */
  .public-how { padding: 72px 0; }
  .steps-list { flex-direction: row; gap: 24px; align-items: stretch; }
  .step-item { flex-direction: column; align-items: flex-start; flex: 1; }
  .step-number { margin-bottom: 8px; width: 48px; height: 48px; min-width: 48px; font-size: 20px; }
  .step-body h4 { font-size: 16px; }
  .step-body p  { font-size: 14px; }

  /* FAQ — 2 columnas */
  .public-faq { padding: 72px 0; }
  .faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .faq-question { font-size: 15px; }
  .faq-answer   { font-size: 14px; }

  /* Capsules grid */
  .public-capsules { padding: 72px 0; }
  #publicCapsulesGrid { grid-template-columns: repeat(3, 1fr); }

  /* Public titles */
  .public-section-title { font-size: 32px; }
  .public-section-subtitle { font-size: 16px; }

  /* CTA */
  .public-cta { padding: 72px 0; }
  .cta-card { padding: 56px 48px; max-width: 700px; margin: 0 auto; }
  .cta-card h2 { font-size: 30px; }

  /* Footer */
  .public-footer { padding: 24px 40px; }

  /* ── App dashboard layout ── */
  .app-container.active {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar header"
      "sidebar content";
    height: 100vh;
    overflow: hidden;
    padding: 0;
  }

  .app-header {
    grid-area: header;
    position: static;
    padding: 16px 32px;
  }

  .app-content {
    grid-area: content;
    overflow-y: auto;
    padding: 32px 40px;
    max-width: none;
  }

  /* Sidebar nav */
  .bottom-nav {
    grid-area: sidebar;
    position: static;
    top: auto; bottom: auto; left: auto;
    transform: none;
    flex-direction: column;
    height: 100%;
    width: 220px;
    max-width: none;
    border-radius: 0;
    box-shadow: 2px 0 16px rgba(0,0,0,0.06);
    background: #fff;
    padding: 28px 12px 24px;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  /* Sidebar brand */
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .sidebar-brand-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    height: auto;
    min-height: 44px;
  }

  .nav-item.active { color: var(--primary); background: rgba(108,92,231,0.08); }
  .nav-item.active::before { display: none; }

  .nav-icon { font-size: 20px; }
  .nav-label { font-size: 14px; font-weight: 600; }

  /* Checklist grid */
  #checklistContent .checklist-category { max-width: none; }

  /* ── Auth — two-column desktop */
  .auth-container {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }
  .auth-back-btn { top: 24px; left: 24px; }

  .auth-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 56px;
    text-align: left;
  }
  .auth-brand .auth-title { font-size: 40px; }
  .auth-brand .auth-subtitle { font-size: 16px; margin-bottom: 40px; }

  .auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    list-style: none;
    margin-top: 8px;
  }
  .auth-brand-features li {
    color: rgba(255,255,255,0.92);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .auth-form-side {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    min-width: 440px;
    max-width: 520px;
    overflow-y: auto;
  }
  .auth-form-side .auth-card {
    max-width: 100%;
    width: 100%;
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
