/* ==========================================================================
   Morfi · Estilos globales
   ========================================================================== */

:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --card: #182239;
  --card-2: #1f2b47;
  --accent: #22c55e;
  --accent-2: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

body { padding-bottom: 90px; }

/* ----- Cards ----- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.card-2 {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ----- Buttons ----- */
.btn {
  background: var(--accent);
  color: #052e13;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  transition: all 0.15s;
}
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #2a3a5e; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); color: white; }

/* ----- Forms ----- */
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ----- Tabs ----- */
.tab-active { color: var(--accent) !important; }
.tab-active svg { color: var(--accent); }

/* ----- Rings & Progress ----- */
.ring-progress { transform: rotate(-90deg); }
.macro-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-2);
}
.macro-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

/* ----- Pills ----- */
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.pill-green  { background: rgba(34, 197, 94, 0.15);  color: #4ade80; }
.pill-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pill-red    { background: rgba(239, 68, 68, 0.15);  color: #f87171; }
.pill-blue   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.pill-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* ----- Sections (one shown at a time) ----- */
.section { display: none; }
.section.active { display: block; }

/* ----- Upload area ----- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.upload-area:hover {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.05);
}

/* ----- Loaders & Animations ----- */
.loader {
  border: 3px solid var(--card-2);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.pulse { animation: pulse-soft 2s ease-in-out infinite; }

/* ----- Meal cards ----- */
.meal-card { transition: transform 0.15s; }
.meal-card:hover { transform: translateY(-2px); }

/* ----- Bottom nav ----- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 16px;
  z-index: 50;
}
.nav-item { transition: color 0.15s; }

/* ----- Toast ----- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to   { transform: translate(-50%, 0);     opacity: 1; }
}

/* ----- Details summary ----- */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker { display: none; }

/* ----- Hidden scrollbars ----- */
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
