/* ================================================
   KHARCHA — Website Design System
   index.css
   ================================================ */

/* ---- Design Tokens ---- */
:root {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --surface-2: #F0EDE8;
  --border: #E5E0D8;
  --border-strong: #D1C9BE;

  --text: #1C1917;
  --text-2: #57534E;
  --text-3: #A8A29E;

  --accent: #FC8019;
  --accent-hover: #E8710A;
  --accent-light: rgba(252, 128, 25, 0.1);
  --accent-glow: linear-gradient(135deg, #FC8019, #FF5A5F);

  --success: #16A34A;
  --success-light: rgba(22, 163, 74, 0.1);
  --danger: #DC2626;
  --danger-light: rgba(220, 38, 38, 0.08);

  --orange: #FC8019;
  --pink: #FF5A5F;
  --purple: #7C3AED;
  --blue: #2563EB;

  --sidebar-w: 240px;
  --topbar-h: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.06);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: #FFFFFF;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ---- Shared Brand ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent-glow);
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(252, 128, 25, 0.3);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ---- States ---- */
.state { min-height: 100vh; }


/* ==================================================
   STATE A — INSTALL EXTENSION
================================================== */
.setup-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.setup-topbar {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.setup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 40px;
}

/* Step indicator dots */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  transition: all var(--transition);
}

.step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-light);
}

.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-connector {
  width: 48px;
  height: 2px;
  background: var(--border);
}

/* Setup content */
.setup-step { width: 100%; max-width: 540px; text-align: left; }

.setup-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 12px;
}

.setup-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Install card */
.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.install-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-ext-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-glow);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(252,128,25,0.25);
  transition: all var(--transition);
}

.install-ext-icon.installed {
  background: linear-gradient(135deg, #16A34A, #22C55E);
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}

.install-ext-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.install-ext-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Privacy bar */
.privacy-bar {
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.privacy-icon { font-size: 14px; }


/* ==================================================
   STATE B — CONNECT SWIGGY
================================================== */
#state-connect {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Site header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

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

/* Floating food illustrations */
.connect-food-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.food-float {
  position: absolute;
  font-size: 36px;
  left: var(--x);
  top: var(--y);
  animation: float-food 6s ease-in-out var(--d, 0s) infinite alternate;
  opacity: 0.15;
  user-select: none;
}

@keyframes float-food {
  0% { transform: translateY(0px) rotate(-4deg); }
  100% { transform: translateY(-20px) rotate(4deg); }
}

/* Connect hero */
.connect-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  position: relative;
}

.connect-hero-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.swiggy-logo-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(252, 128, 25, 0.08);
  border: 1px solid rgba(252, 128, 25, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text);
}

.hero-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 380px;
}

.hero-privacy {
  font-size: 12px;
  color: var(--text-3);
}

/* Connect Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface-2);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-brand-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.modal-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-right: 32px;
}

.modal-status-badge.connected { color: var(--success); }

.status-ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: ping-anim 1.5s infinite ease-out;
  flex-shrink: 0;
}

.modal-status-badge.connected .status-ping-dot {
  background: var(--success);
  animation: none;
  box-shadow: 0 0 0 3px var(--success-light);
}

@keyframes ping-anim {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Modal steps */
.modal-steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-step-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.modal-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-step-label {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

.kbd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
}

.kbd-then {
  font-size: 11px;
  color: var(--text-3);
}


/* STATE C DASHBOARD MOVED TO dashboard.css */

/* ==================================================
   NEW ONBOARDING CSS
================================================== */
#state-install {
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#state-install .card {
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 112px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
#state-install .upper {
  width: 375px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}
#state-install .icon-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}
#state-install .icon-wrapper {
  position: relative;
  width: 65px;
  height: 45px;
}
#state-install .ext-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 41px;
  display: block;
  border-radius: 6px 6px 0 0;
}
#state-install .status-dot-idle {
  position: absolute;
  left: 56px;
  top: 36px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fe5200;
  outline: 5px solid #ffffff;
  z-index: 2;
  animation: blink-dot 1.6s ease-in-out infinite;
}
#state-install .text-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
#state-install .title {
  font-size: 24px;
  font-weight: 600;
  color: #0b101e;
  letter-spacing: -0.24px;
  line-height: 1.2;
  margin: 0;
}
#state-install .subtitle {
  font-size: 16px;
  color: #4e5976;
  margin: 0;
}
#state-install .btn-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 153px;
  height: 36px;
  padding: 0 12px;
  background: #0050ff;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
#state-install .btn-install:hover { opacity: 0.88; }
#state-install .btn-install svg { flex-shrink: 0; display: block; }
#state-install .footer-note {
  font-size: 14px;
  color: #4e5976;
  margin: 0;
}

#state-connect {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
#state-connect .bg-illustration {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -10%);
  width: 1014px;
  height: 384px;
  object-fit: fill;
}
#state-connect .content-panel {
  position: relative;
  width: 375px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 52px;
  z-index: 2;
  margin-top: -150px;
}
#state-connect .top-section {
  width: 375px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
#state-connect .logo-row {
  width: 375px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#state-connect .swiggy-logo {
  flex-shrink: 0;
  width: 25px;
  height: 37px;
  display: block;
}
#state-connect .title-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#state-connect .title {
  font-size: 24px;
  font-weight: 600;
  color: #0b101e;
  letter-spacing: -0.24px;
  line-height: 1.2;
  margin: 0;
}
#state-connect .status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
#state-connect .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #c0c5d0;
  animation: blink-dot 1.6s ease-in-out infinite;
}
#state-connect .status-row.connected .status-dot {
  background: #03875F;
  animation: none;
}
@keyframes blink-dot {
  0%, 49.9% { background: #c0c5d0; }
  50%, 100%  { background: #fe5200; }
}
#state-connect .status-text {
  font-size: 12px;
  font-weight: 400;
  color: #4e5976;
  letter-spacing: -0.12px;
}
#state-connect .status-row.connected .status-text {
  color: #03875F;
}
#state-connect .steps-list {
  width: 375px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#state-connect .step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
#state-connect .step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0f1f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #4e5976;
  margin-top: 2px;
}
#state-connect .step-text {
  font-size: 16px;
  font-weight: 400;
  color: #4e5976;
  letter-spacing: -0.16px;
  line-height: 1.4;
  margin: 0;
}
#state-connect .step-text kbd {
  font-family: 'Inter', monospace;
  font-size: 12px;
  background: #f0f1f4;
  border-radius: 3px;
  padding: 1px 5px;
  color: #0b101e;
  font-weight: 500;
}
#state-connect .btn-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 153px;
  height: 36px;
  padding: 0 12px;
  background: #fe5200;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  color: #ffffff;
}
#state-connect .btn-open:hover { opacity: 0.88; }
#state-connect .btn-open span {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.16px;
  white-space: nowrap;
}
#state-connect .btn-open svg { flex-shrink: 0; display: block; }

/* ---- Welcome Page ---- */
#state-welcome {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: #1e1e1e;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.welcome-page-inner {
  position: relative;
  width: 1440px;
  height: 855px;
  background: #1e1e1e;
  flex-shrink: 0;
}

.welcome-bg-watermark {
  position: absolute;
  width: 1920px;
  height: 995px;
  left: -240px;
  top: -20px;
  pointer-events: none;
  z-index: 0;
}
.welcome-bg-watermark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  will-change: transform;
}

.welcome-hero {
  position: absolute;
  left: 214px;
  top: 173px;
  width: 1011px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 39px;
  z-index: 1;
}

.welcome-hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.welcome-headline {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 60px;
  line-height: 1.29;
  letter-spacing: -0.6px;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
}

.welcome-subline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.welcome-subline-plain {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.18px;
  color: rgba(255, 255, 255, 0.54);
  white-space: nowrap;
}

.welcome-swiggy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: rgba(255, 105, 12, 0.10);
  border: 1px dashed rgba(255, 139, 66, 0.44);
  border-radius: 6px;
}
.welcome-swiggy-pill span {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.18px;
  color: #ff8e48;
  white-space: nowrap;
}

.welcome-total-spend {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.18px;
  color: #4f7bff;
  white-space: nowrap;
  display: inline-block;
  width: 175px;
  text-align: left;
}

.welcome-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 200px;
  padding: 7px 20px;
  background: #0050ff;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.welcome-cta-btn:hover {
  background: #0047e5;
}

.welcome-cta-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: normal;
  letter-spacing: -0.2px;
  color: #ffffff;
  white-space: nowrap;
}

.welcome-arrow-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33.284px;
  height: 33.284px;
  flex-shrink: 0;
}
.welcome-arrow-wrap svg {
  width: 23.536px;
  height: 23.536px;
}

.welcome-dashboard-ss {
  position: absolute;
  left: 160px;
  top: 505px;
  width: 1120px;
  height: 641px;
  border-radius: 12px;
  overflow: hidden;
  z-index: 1;
}
.welcome-dashboard-ss img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.text-fade {
  transition: opacity 0.5s ease-in-out;
}

/* ==================================================
   RESPONSIVE DESIGN (WELCOME PAGE)
================================================== */
.welcome-mobile-warning {
  display: none;
}

/* 1. Phone (Mobile fallback) */
@media (max-width: 767px) {
  .welcome-hero, .welcome-dashboard-ss {
    display: none;
  }
  .welcome-bg-watermark {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    /* height: auto; */
  }
  .welcome-mobile-warning {
    display: block;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(18px, 6vw, 24px);
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    width: 100vw;
    padding: 0 20px;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    z-index: 2;
    line-height: 1.5;
  }
}

/* 2. Tablet (Scale down to fit) */
@media (min-width: 768px) and (max-width: 1024px) {
  .welcome-page-inner {
    transform: scale(0.65);
  }
}

/* 3. Small Laptops (Scale down slightly to avoid cropping) */
@media (min-width: 1025px) and (max-width: 1350px) {
  .welcome-page-inner {
    transform: scale(0.85);
  }
}

/* Base Figma Size: up to 1600px - Natural 100% Scale */
@media (min-width: 1351px) and (max-width: 1600px) {
  .welcome-page-inner {
    transform: scale(1);
  }
}

/* 4. Large Desktop / 1920px Screens */
@media (min-width: 1601px) and (max-width: 2559px) {
  .welcome-page-inner {
    transform: scale(1.3);
  }
}

/* 5. Ultrawide / 4K (2560px+) */
@media (min-width: 2560px) {
  .welcome-page-inner {
    transform: scale(1.7);
  }
}
