/* PKNC Diet Planner – portal styles (Bootstrap 5 based) */
:root {
  --pk-primary: #0f7a55;
  --pk-primary-dark: #0b5e41;
  --pk-primary-light: #e3f3ec;
  --pk-accent: #f97316;
  --pk-water: #0ea5e9;
  --pk-protein: #6366f1;
  --pk-carbs: #f59e0b;
  --pk-fat: #ec4899;
  --pk-bg: #f2f6f4;
  --pk-text: #10231b;
  --pk-muted: #5f6f68;
  --pk-radius: 20px;
  --pk-shadow: 0 10px 30px rgba(11, 59, 42, .08);
  --bs-primary: #0f7a55;
  --bs-primary-rgb: 15, 122, 85;
  --bs-link-color: #0f7a55;
  --bs-link-hover-color: #0b5e41;
  --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body { background: var(--pk-bg); color: var(--pk-text); font-family: var(--bs-body-font-family); }
a { color: var(--pk-primary); }
.text-primary { color: var(--pk-primary) !important; }
.bg-primary { background-color: var(--pk-primary) !important; }
.text-accent { color: var(--pk-accent) !important; }
.text-muted { color: var(--pk-muted) !important; }
.fw-800 { font-weight: 800; }
.small-xs { font-size: .75rem; }

.btn { border-radius: 14px; font-weight: 600; padding: .6rem 1.15rem; }
.btn-sm { border-radius: 10px; padding: .35rem .75rem; }
.btn-primary { background: linear-gradient(135deg, #0b6b4a, #16a34a); border: 0; box-shadow: 0 8px 20px rgba(15, 122, 85, .25); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #0a5c40, #12893f); }
.btn-outline-primary { color: var(--pk-primary); border-color: var(--pk-primary); }
.btn-outline-primary:hover { background: var(--pk-primary); border-color: var(--pk-primary); }
.btn-accent { background: var(--pk-accent); color: #fff; border: 0; }
.btn-accent:hover { background: #ea580c; color: #fff; }
.btn-soft { background: var(--pk-primary-light); color: var(--pk-primary); border: 0; }
.btn-soft:hover { background: #cdebdc; color: var(--pk-primary-dark); }
.form-control, .form-select { border-radius: 12px; padding: .65rem .9rem; border-color: #dce5e0; }
.form-control:focus, .form-select:focus { border-color: var(--pk-primary); box-shadow: 0 0 0 .2rem rgba(15, 122, 85, .15); }
.form-check-input:checked { background-color: var(--pk-primary); border-color: var(--pk-primary); }
.page-link { color: var(--pk-primary); }
.active > .page-link { background: var(--pk-primary); border-color: var(--pk-primary); }

/* Cards */
.card-pk { background: #fff; border: 0; border-radius: var(--pk-radius); box-shadow: var(--pk-shadow); }
.card-pk .card-body { padding: 1.35rem; }
.glass { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--pk-radius); }
.hover-lift { transition: transform .25s ease, box-shadow .25s ease; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(11, 59, 42, .14); }

/* Navbar */
.navbar-pk { background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 2px 20px rgba(11, 59, 42, .06); }
.navbar-pk .nav-link { font-weight: 500; color: var(--pk-text); border-radius: 10px; padding: .45rem .8rem !important; }
.navbar-pk .nav-link.active, .navbar-pk .nav-link:hover { color: var(--pk-primary); background: var(--pk-primary-light); }
.brand-logo { height: 42px; }
.brand-text { font-weight: 800; color: var(--pk-primary); line-height: 1.05; }
.brand-text small { display: block; font-weight: 500; font-size: .68rem; color: var(--pk-muted); letter-spacing: .02em; }

/* Hero + AI animations */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 600px at 10% -10%, #16a34a 0%, transparent 60%), linear-gradient(135deg, #062f22 0%, #0b5e41 45%, #0f7a55 100%); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: blob 18s ease-in-out infinite; pointer-events: none; }
.blob.b1 { width: 380px; height: 380px; background: #22c55e; top: -120px; right: -80px; }
.blob.b2 { width: 300px; height: 300px; background: #f97316; bottom: -140px; left: 10%; animation-delay: -6s; opacity: .3; }
.blob.b3 { width: 260px; height: 260px; background: #0ea5e9; top: 30%; left: 45%; animation-delay: -12s; opacity: .25; }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.1); } 66% { transform: translate(-30px, 30px) scale(.95); } }
.hero h1 { font-weight: 800; letter-spacing: -.02em; }
.ai-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); font-size: .85rem; }
.ai-badge .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); } 70% { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.typed { color: #86efac; border-right: 3px solid #86efac; padding-right: 4px; animation: caret 1s step-end infinite; white-space: nowrap; }
@keyframes caret { 50% { border-color: transparent; } }
.gradient-text { background: linear-gradient(90deg, #86efac, #fde68a, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.float-card { position: absolute; background: #fff; color: var(--pk-text); border-radius: 18px; padding: .75rem 1rem; box-shadow: 0 20px 40px rgba(0, 0, 0, .18); animation: floaty 6s ease-in-out infinite; font-size: .9rem; }
.float-card.f2 { animation-delay: -2s; } .float-card.f3 { animation-delay: -4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero-visual { position: relative; min-height: 420px; }
.ai-orb { position: absolute; left: 50%; top: 50%; width: 230px; height: 230px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e 40%, #0b5e41 75%); box-shadow: 0 0 80px rgba(34, 197, 94, .6), inset 0 0 40px rgba(255, 255, 255, .3); animation: orb 8s ease-in-out infinite; }
.ai-orb::before, .ai-orb::after { content: ''; position: absolute; inset: -28px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .35); animation: spin 18s linear infinite; }
.ai-orb::after { inset: -58px; border-style: dotted; animation-duration: 28s; animation-direction: reverse; }
.ai-orb i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4.5rem; color: #fff; text-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
@keyframes orb { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }
.wave-sep { display: block; width: 100%; height: 70px; margin-top: -1px; }

/* Sections */
.section { padding: 80px 0; }
.section-title { font-weight: 800; letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--pk-accent); }
.feature-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--pk-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 0 0 8px var(--pk-primary-light); }
.stat-number { font-size: 2.4rem; font-weight: 800; line-height: 1; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; } .reveal.d4 { transition-delay: .4s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .blob, .float-card, .ai-orb, .ai-orb::before, .ai-orb::after { animation: none; } }

/* Page header (inner pages) */
.page-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #0b5e41, #0f7a55 55%, #22a06b); border-radius: 0 0 32px 32px; padding: 34px 0 70px; }
.page-hero .blob { opacity: .3; }
.page-body { margin-top: -48px; position: relative; z-index: 2; }

/* Dashboard bits */
.ring-wrap { position: relative; width: 170px; height: 170px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap .ring-bar { transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .v { font-size: 2rem; font-weight: 800; line-height: 1; }
.macro-bar { height: 8px; border-radius: 6px; background: #e2e8e5; overflow: hidden; }
.macro-bar > span { display: block; height: 100%; border-radius: 6px; width: 0; transition: width 1.2s ease; }
.water-glass { font-size: 1.55rem; color: #b6d9ee; cursor: pointer; transition: transform .15s, color .2s; }
.water-glass.full { color: var(--pk-water); }
.water-glass:hover { transform: scale(1.15); }
.meal-card { border-radius: 18px; background: #fff; box-shadow: var(--pk-shadow); overflow: hidden; transition: border-color .2s; border: 2px solid transparent; }
.meal-card.done { border-color: var(--pk-primary); background: #f7fcf9; }
.meal-icon { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.25rem; flex-shrink: 0; }
.meal-item { border-top: 1px dashed #dce5e0; padding: .55rem 0; }
.qty-pill { min-width: 42px; padding: .1rem .45rem; border-radius: 8px; background: var(--pk-primary-light); color: var(--pk-primary); font-weight: 700; font-size: .85rem; text-align: center; }
.kcal-pill { background: var(--pk-primary-light); color: var(--pk-primary); border-radius: 10px; padding: .2rem .55rem; font-weight: 700; white-space: nowrap; }
.tag-chip { display: inline-block; padding: .1rem .5rem; border-radius: 8px; font-size: .7rem; font-weight: 600; margin: 2px 2px 0 0; }
.day-pill { min-width: 64px; border-radius: 16px; background: #fff; border: 0; padding: .5rem .6rem; box-shadow: var(--pk-shadow); color: var(--pk-text); }
.day-pill.active { background: var(--pk-primary); color: #fff; }
.day-pill .d { font-size: .75rem; opacity: .75; } .day-pill .n { font-weight: 800; font-size: 1.2rem; line-height: 1; }
.nav-tabs-pk .nav-link { border: 0; border-radius: 12px; color: var(--pk-muted); font-weight: 600; }
.nav-tabs-pk .nav-link.active { background: var(--pk-primary); color: #fff; }

/* Food explorer */
.food-card { border-radius: 18px; background: #fff; box-shadow: var(--pk-shadow); height: 100%; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.food-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(11, 59, 42, .14); }
.cat-chip { border-radius: 999px; border: 1px solid #dce5e0; background: #fff; padding: .35rem .85rem; font-size: .85rem; font-weight: 500; color: var(--pk-text); white-space: nowrap; }
.cat-chip.active, .cat-chip:hover { background: var(--pk-primary); color: #fff; border-color: var(--pk-primary); }
.chip-scroll { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }

/* Profile wizard */
.wizard-steps { display: flex; gap: .5rem; }
.wizard-steps .ws { flex: 1; height: 6px; border-radius: 6px; background: #dce5e0; transition: background .4s; }
.wizard-steps .ws.on { background: linear-gradient(90deg, #0f7a55, #22c55e); }
.wizard-pane { display: none; animation: fadeUp .45s ease; }
.wizard-pane.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.option-card { display: block; cursor: pointer; border: 2px solid #dce5e0; border-radius: 16px; padding: .85rem 1rem; background: #fff; transition: all .2s; height: 100%; }
.option-card:hover { border-color: #9fd6bd; }
.btn-check:checked + .option-card { border-color: var(--pk-primary); background: var(--pk-primary-light); box-shadow: 0 6px 16px rgba(15, 122, 85, .15); }
.option-card i { font-size: 1.4rem; color: var(--pk-primary); }

/* AI generating overlay */
.ai-overlay { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(15, 122, 85, .96), rgba(6, 47, 34, .98)); color: #fff; }
.ai-overlay.show { display: flex; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ai-brain { width: 130px; height: 130px; margin: 0 auto 24px; position: relative; }
.ai-brain .core { position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e 50%, #0b5e41); box-shadow: 0 0 50px rgba(74, 222, 128, .7); animation: orb 2.2s ease-in-out infinite; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.ai-brain .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: #86efac; border-right-color: #86efac; animation: spin 1.2s linear infinite; }
.ai-brain .ring.r2 { inset: -14px; border-top-color: #fde68a; border-right-color: transparent; border-left-color: #fde68a; animation-duration: 2s; animation-direction: reverse; }
.ai-steps { list-style: none; padding: 0; margin: 18px auto 0; max-width: 340px; text-align: left; }
.ai-steps li { opacity: .35; padding: .3rem 0; transition: opacity .3s; }
.ai-steps li.on { opacity: 1; }
.ai-progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; max-width: 340px; margin: 16px auto 0; }
.ai-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #86efac, #fde68a); transition: width .4s ease; }

/* Shimmer */
.shimmer { background: linear-gradient(90deg, #eef3f0 25%, #f7faf8 37%, #eef3f0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Footer */
.footer-pk { background: #062f22; color: #cfe7dc; }
.footer-pk a { color: #cfe7dc; text-decoration: none; }
.footer-pk a:hover { color: #fff; }

/* Toasts */
.toast-container { z-index: 3000; }

/* Auth */
.auth-wrap { min-height: calc(100vh - 76px); display: flex; align-items: center; position: relative; overflow: hidden; }
.auth-side { background: linear-gradient(135deg, #062f22, #0f7a55); color: #fff; border-radius: 28px; position: relative; overflow: hidden; }

/* Print */
@media print {
  .navbar, .footer-pk, .no-print, .btn, .page-hero .blob, .toast-container { display: none !important; }
  .page-hero { color: #000; background: none !important; padding: 0; }
  .page-body { margin-top: 0; }
  .meal-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { background: #fff; }
  .tab-pane { display: block !important; opacity: 1 !important; }
}

@media (max-width: 575.98px) {
  .section { padding: 56px 0; }
  .hero-visual { min-height: 320px; }
  .ai-orb { width: 170px; height: 170px; }
  .float-card { font-size: .78rem; padding: .55rem .75rem; }
  .ring-wrap { width: 140px; height: 140px; }
  .ring-center .v { font-size: 1.6rem; }
}

/* ---- Tools ---- */
.step-num.step-sm { width: 28px; height: 28px; font-size: .85rem; box-shadow: 0 0 0 4px var(--pk-primary-light); margin-right: 6px; }
.kp-plate { max-width: 360px; margin: auto; display: block; }
.kp-plate path, .kp-plate circle { cursor: pointer; transition: transform .25s, filter .25s; transform-origin: 180px 180px; }
.kp-plate .on { transform: scale(1.04); filter: drop-shadow(0 6px 12px rgba(0,0,0,.25)); }
.kp-group { border-radius: 16px; padding: 14px; border: 2px solid transparent; transition: all .2s; height: 100%; }
.kp-group.on { border-color: currentColor; box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.kp-group .amt { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kp-age .btn { border-radius: 30px; }
.kp-tip { display: flex; gap: 12px; align-items: flex-start; }
.kp-tip i { font-size: 1.4rem; }
.tool-card { display: block; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; height: 100%; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,122,85,.15); color: inherit; }
.tool-card .ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.diary-day { min-width: 190px; text-align: center; }
.diary-slot { border-left: 4px solid var(--pk-primary); }
.info-bar { background: #0b4a34; color: #d1fae5; font-size: .8rem; }
.info-bar a { color: #fff; text-decoration: none; }
.btn-outline-primary { --bs-btn-color: var(--pk-primary); --bs-btn-border-color: var(--pk-primary); --bs-btn-hover-bg: var(--pk-primary); --bs-btn-hover-border-color: var(--pk-primary);
  --bs-btn-active-bg: var(--pk-primary); --bs-btn-active-border-color: var(--pk-primary); --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.text-neg { color: #DC2626 !important; }
