/* ============================================================
   Nivara One — Unified Design System
   "Premium Logistics × Clean Fintech"
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;1,500&display=swap');

/* ---------- CSS Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ============================================================
   LIGHT THEME (default)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg:           #F7FAFC;
  --bg2:          #EEF2F7;
  --surface:      rgba(255, 255, 255, 0.82);
  --surface-b:    rgba(255, 255, 255, 0.95);
  --border:       rgba(15, 23, 42, 0.08);
  --border-hover: rgba(14, 165, 233, 0.35);

  /* Text */
  --text:         #0F172A;
  --text-2:       #334155;
  --text-3:       #64748B;
  --text-inv:     #FFFFFF;

  /* Brand */
  --blue:         #0EA5E9;
  --blue-d:       #0284C7;
  --blue-g:       rgba(14, 165, 233, 0.12);
  --blue-gl:      rgba(14, 165, 233, 0.25);
  --green:        #22C55E;
  --green-d:      #16A34A;
  --green-g:      rgba(34, 197, 94, 0.12);
  --green-gl:     rgba(34, 197, 94, 0.25);
  --amber:        #F59E0B;
  --amber-g:      rgba(245, 158, 11, 0.15);
  --red:          #EF4444;
  --red-g:        rgba(239, 68, 68, 0.12);
  --orange:       #F97316;

  /* Shadows */
  --shadow-xs:    0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm:    0 4px 12px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-md:    0 8px 24px rgba(15,23,42,0.09), 0 4px 8px rgba(15,23,42,0.05);
  --shadow-lg:    0 16px 48px rgba(15,23,42,0.12), 0 8px 16px rgba(15,23,42,0.06);
  --shadow-xl:    0 24px 64px rgba(15,23,42,0.16), 0 12px 24px rgba(15,23,42,0.08);

  /* Radii */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --r-pill: 999px;

  /* Blur */
  --blur-sm: blur(12px) saturate(160%);
  --blur-md: blur(24px) saturate(180%);
  --blur-lg: blur(40px) saturate(200%);

  /* Transitions */
  --t-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   0.4s  cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.5s  cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Sun-ray (light mode) */
  --ray-opacity: 1;
}

/* ============================================================
   DARK THEME
   ============================================================ */
[data-theme="dark"] {
  --bg:           #080E1A;
  --bg2:          #0F1829;
  --surface:      rgba(15, 24, 41, 0.75);
  --surface-b:    rgba(20, 31, 54, 0.95);
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(14, 165, 233, 0.4);

  --text:         #F1F5F9;
  --text-2:       #CBD5E1;
  --text-3:       #64748B;
  --text-inv:     #0F172A;

  --blue:         #38BDF8;
  --blue-d:       #0EA5E9;
  --blue-g:       rgba(56, 189, 248, 0.1);
  --blue-gl:      rgba(56, 189, 248, 0.2);
  --green:        #4ADE80;
  --green-d:      #22C55E;
  --green-g:      rgba(74, 222, 128, 0.1);
  --green-gl:     rgba(74, 222, 128, 0.2);
  --amber:        #FCD34D;
  --amber-g:      rgba(252, 211, 77, 0.1);
  --red:          #F87171;
  --red-g:        rgba(248, 113, 113, 0.12);

  --shadow-xs:    0 1px 3px rgba(0,0,0,0.3);
  --shadow-sm:    0 4px 12px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.6);
  --shadow-xl:    0 24px 64px rgba(0,0,0,0.7);

  --ray-opacity: 0;
}

/* ============================================================
   BASE STYLES
   ============================================================ */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-slow), color var(--t-slow);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Sun-ray ambient — radiates from top-left */
body::before {
  content: '';
  position: fixed;
  top: -60%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: conic-gradient(
    from 0deg at 22% 18%,
    transparent           0deg,
    rgba(245,158,11,0.07) 18deg,
    transparent           36deg,
    rgba(245,158,11,0.05) 54deg,
    transparent           72deg,
    rgba(245,158,11,0.07) 90deg,
    transparent          108deg,
    rgba(245,158,11,0.04) 126deg,
    transparent          360deg
  );
  z-index: 0;
  pointer-events: none;
  opacity: var(--ray-opacity);
  animation: spinRays 180s linear infinite;
  transition: opacity var(--t-slow);
}

@keyframes spinRays { to { transform: rotate(360deg); } }

/* Ambient orbs */
.n1-orb {
  position: fixed;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
}
.n1-orb-sun {
  top: -12vw; left: -10vw;
  width: 55vw; height: 55vw;
  background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%);
  filter: blur(60px);
}
.n1-orb-green {
  bottom: -14vw; right: -12vw;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(34,197,94,0.14) 0%, transparent 70%);
  filter: blur(80px);
}
[data-theme="dark"] .n1-orb { opacity: 0.35; }

/* Ensure content is above effects */
#app, main, .page, .container { position: relative; z-index: 1; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.serif { font-family: 'Playfair Display', serif; }
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }

/* ============================================================
   GLASS SURFACE COMPONENTS
   ============================================================ */
.glass {
  background: var(--surface);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.glass-heavy {
  background: var(--surface-b);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all var(--t-base);
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 0.85rem 1.6rem;
  box-shadow: 0 4px 14px var(--blue-gl);
}
.btn-primary:hover { background: var(--blue-d); box-shadow: 0 6px 20px var(--blue-gl); transform: translateY(-1px); }

.btn-success {
  background: var(--green);
  color: #fff;
  padding: 0.85rem 1.6rem;
  box-shadow: 0 4px 14px var(--green-gl);
}
.btn-success:hover { background: var(--green-d); box-shadow: 0 6px 20px var(--green-gl); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 0.75rem 1.4rem;
}
.btn-ghost:hover { background: var(--bg2); border-color: var(--border-hover); color: var(--blue); }

.btn-lg { padding: 1.1rem 2rem; font-size: 1.05rem; border-radius: var(--r-md); }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.input {
  width: 100%;
  background: var(--surface-b);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-g); }
.input::placeholder { color: var(--text-3); }
.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: block;
}
.input-group { margin-bottom: 1rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-interactive { cursor: pointer; }
.card-interactive:hover { border-color: var(--border-hover); }

/* ============================================================
   BADGES / STATUS PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-pill);
}
.badge-blue   { background: var(--blue-g);  color: var(--blue);  }
.badge-green  { background: var(--green-g); color: var(--green); }
.badge-amber  { background: var(--amber-g); color: var(--amber); }
.badge-red    { background: var(--red-g);   color: var(--red);   }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: pulseDot 2s ease infinite;
}
@keyframes pulseDot { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ============================================================
   NAVBAR (shared top bar)
   ============================================================ */
.n1-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: background var(--t-slow);
}
.n1-nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.n1-nav-logo img {
  width: 36px; height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid var(--border);
}
.n1-nav-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.n1-nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  box-shadow: var(--shadow-xs);
}
.theme-toggle:hover { background: var(--bg2); border-color: var(--border-hover); transform: scale(1.05); }
.theme-toggle:active { transform: scale(0.92); }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px; background: var(--border);
  margin: 1.5rem 0;
}
.divider-text {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--text-3); font-size: 0.8rem;
  margin: 1.5rem 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  width: 100%; max-width: 420px;
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t-spring);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.anim-fade-up   { animation: fadeInUp  0.5s var(--t-base) both; }
.anim-fade-down { animation: fadeInDown 0.4s var(--t-base) both; }

.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--surface) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-sm);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================================
   PROGRESS STEPS (Household wizard)
   ============================================================ */
.step-bar {
  display: flex; align-items: center;
  gap: 0; width: 100%;
  margin-bottom: 2rem;
}
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
  transition: all var(--t-base);
}
.step-dot.done   { background: var(--green); color: #fff; }
.step-dot.active { background: var(--blue);  color: #fff; box-shadow: 0 0 0 4px var(--blue-g); }
.step-dot.idle   { background: var(--bg2); color: var(--text-3); border: 2px solid var(--border); }
.step-line {
  flex: 1; height: 2px;
  background: var(--border);
  transition: background var(--t-slow);
}
.step-line.done { background: var(--green); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .hide-desktop { display: none !important; }
}

/* ============================================================
   NIVARA 3-NODE ECOSYSTEM BRAND TOKENS
   ============================================================ */
:root {
  --n1-sand:       #faf6ee;
  --n1-emerald:    #1b6e39;
  --n1-emerald-lt: #eef8f1;
  --n1-gold:       #c88414;
  --n1-gold-lt:    #fef6e7;

  --go-green:      #16a34a;
  --go-green-lt:   #f0fdf4;
  --go-dark:       #0f172a;

  --hub-champagne: #fdf7eb;
  --hub-brass:     #c88414;
  --hub-slate:     #1e293b;
  --hub-card-border:#eaddc7;
}

[data-theme="dark"] {
  --n1-sand:       #0d1710;
  --n1-emerald:    #22c55e;
  --n1-emerald-lt: #12351f;
  --n1-gold:       #f59e0b;
  --n1-gold-lt:    #2d2410;

  --go-green:      #4ade80;
  --go-green-lt:   #064e3b;
  --go-dark:       #020617;

  --hub-champagne: #142319;
  --hub-brass:     #f59e0b;
  --hub-slate:     #0d1710;
  --hub-card-border:#233f2c;
}

/* Master Eco Nav Switcher */
.eco-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.eco-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.eco-nav-pill:hover {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--border);
}
.eco-nav-pill.active-one {
  background: #eef8f1;
  color: #166534;
  border-color: #86efac;
}
.eco-nav-pill.active-go {
  background: #f0fdf4;
  color: #15803d;
  border-color: #4ade80;
}
.eco-nav-pill.active-hub {
  background: #fef6e7;
  color: #b45309;
  border-color: #fde68a;
}
[data-theme="dark"] .eco-nav-pill.active-one { background: #12351f; color: #86efac; border-color: #059669; }
[data-theme="dark"] .eco-nav-pill.active-go { background: #064e3b; color: #4ade80; border-color: #16a34a; }
[data-theme="dark"] .eco-nav-pill.active-hub { background: #2d2410; color: #fde68a; border-color: #b45309; }

@media (max-width: 820px) {
  .eco-nav-links { display: none; }
}
