/* ============ Design tokens (Figma-aligned) ============ */
:root {

  --fs-28: 28px;
  --content-pad: clamp(12px, 2.4vw, 24px);
  /* Colors */
  --bg: #f8fcf9e7;
  --panel: #ffffff;
  --elev: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --brand: #2825eb;
  --accent: #16a34a;
  --border: #e7ecf2;
  --border-weak: #eef2f6;
  --ink-weak: #334155;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 6px;
  --s-3: 8px;
  --s-4: 10px;
  --s-5: 12px;
  --s-6: 14px;
  --s-7: 16px;
  --s-8: 18px;
  --s-9: 20px;
  --s-10: 24px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.08);

  /* Type */
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;

  /* Transitions */
  --easing: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 150ms;
  --t-med: 220ms;

  /* Layout */
  --container: 1200px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, Segoe UI, Roboto, Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ Legacy header (kept) ============ */
.site-header {
  display: flex;
  align-items: flex-start; /* align top */
  padding: var(--s-6) var(--s-7);
  background: #333;
  color: #fff;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.brand {
  margin: 0;
  font-size: var(--fs-28); /* Bigger main title */
  font-weight: 700;
}

.sub-brand {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: 400;
  color: #bbb; /* lighter gray to look like subheader */
}

.search {
  display: flex;
  gap: var(--s-3);
}
.search input {
  padding: var(--s-3) var(--s-4);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  min-width: 260px;
}
.search button {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-5);
  cursor: pointer;
}

/* ============ Layout shell ============ */
.app-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 56px);
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  /* NEW: allow CTA to sit above footer */
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}
.nav {
  flex: 0 0 auto;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: var(--s-4);
}
.nav a {
  display: block;
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-3);
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-fast) var(--easing),
    border-color var(--t-fast) var(--easing);
}
.nav a:hover {
  background: #f7f9fb;
}
.nav a.active {
  background: #f3f6ff;
  border: 1px solid #dfe7ff;
}
.sidebar-footer {
  margin-top: auto;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============ Topbar ============ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-5) var(--s-6);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(6px);
}
.topbar-left {
  display: flex;
  gap: var(--s-5);
  align-items: center;
  flex-wrap: wrap;
}
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  border-radius: var(--r-sm);
  margin-right: var(--s-3);
}


.top-search {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: #f6f7f8;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--s-3) var(--s-4);
  width: clamp(240px, 40vw, 540px);
  transition: border-color var(--t-fast) var(--easing),
    box-shadow var(--t-fast) var(--easing);
}
.top-search:focus-within {
  border-color: #c7d5ff;
  box-shadow: 0 0 0 3px #e7efff;
}
.top-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text);
  font-size: var(--fs-14);
}
.top-search button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0 var(--s-1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.icon-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-md);
  padding: var(--s-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--easing);
}
.icon-btn:hover {
  background: #f8f9fb;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-xl);
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-meta {
  line-height: 1.1;
}
.user-meta small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: var(--fs-12);
}

/* ============ Skip link (a11y) ============ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
}

/* ============ Sticky Filters ============ */
.filters {
  position: sticky;
  top: 56px;
  z-index: 40;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}
.filters-row {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--s-5) var(--s-7);
}
.filters select {
  min-width: 160px;
  padding: 10px var(--s-5);
  border: 1px solid #d5dbe3;
  border-radius: var(--r-sm);
  background: #fff;
  color: #2d3748;
  font-size: var(--fs-14);
}

/* ============ Container ============ */
.container {
  /* fluid outer padding */
  padding: var(--content-pad);
}

.main > .container {
  /* center + cap width + keep fluid side padding */
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding-inline: var(--content-pad);
}

.main h1 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.main h2 { font-size: clamp(1.1rem, 2vw, 1.35rem); }


/* ============ Section headers ============ */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: var(--s-8) 0 var(--s-5);
}
.page-heading {
  margin: 0;
  font-weight: 700;
  color: var(--ink-weak);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: var(--s-8) 0 var(--s-5);
}
.section-title {
  margin: 0;
  font-weight: 600;
  color: var(--ink-weak);
}
.section-meta {
  color: var(--muted);
  font-size: var(--fs-12);
}

/* ============ BBC-style kit (responsive, container-aware) ============ */
.bbc-section-title {
  font-size: 1.2rem;
  margin: var(--s-4) 0 var(--s-5);
  border-left: 4px solid var(--brand);
  padding-left: var(--s-4);
  color: var(--ink-weak);
  font-weight: 600;
}

/* HERO */
.bbc-hero {
  container-type: inline-size;                  /* enables @container below */
  display: grid;
  grid-template-columns: 1fr;                   /* mobile-first */
  gap: var(--s-5);
  margin: var(--s-5) 0 var(--s-7);
  align-items: start;
}

/* Link + media defaults */
.bbc-hero a { text-decoration: none; color: inherit; display: block; }

.bbc-hero img {
  width: 100%;
  border-radius: var(--r-lg);
  object-fit: cover;
  aspect-ratio: 16 / 9;
  max-height: 420px;
}

/* Text */
.bbc-hero-text h1 {
  font-size: clamp(1.25rem, 1.02rem + 1.2vw, 1.85rem);
  margin: 0.25rem 0;
  font-weight: 800;
  line-height: 1.2;
}
.bbc-hero-text p {
  color: #46566e;
  margin: 0.4rem 0 0;
}
.bbc-meta {
  color: #77839b;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* When the HERO'S OWN container is wide enough, go two columns */
@container (min-width: 720px) {
  .bbc-hero {
    grid-template-columns: 1.35fr 1fr;         /* media | text */
  }
  .bbc-hero img {
    aspect-ratio: auto;                         /* let height fill the track */
    height: 100%;
    max-height: 520px;
  }
}

/* NEW: hero link reset to avoid default blue underline */
.bbc-hero-link {
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: 1fr;
}
.bbc-hero-text h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: 0.25rem 0;
  font-weight: 800;
}
.bbc-hero-text p {
  color: #46566e;
  margin: 0.4rem 0 0;
}
.bbc-meta {
  color: #77839b;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.bbc-secondary,
.bbc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-7);
}
.bbc-card {
  background: var(--elev);
  border: 1px solid var(--border-weak);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--easing),
    box-shadow var(--t-med) var(--easing),
    border-color var(--t-med) var(--easing);
}
.bbc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: #dfe7ff;
}
/* NEW: card anchor reset so titles aren’t blue */
.bbc-card > a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.bbc-card .bbc-title {
  font-size: 1.08rem;
  margin: 0.5rem 0 0.25rem;
  line-height: 1.3;
  font-weight: 700;
}
.bbc-card:hover .bbc-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bbc-desc {
  color: #5b6b83;
  margin: 0.25rem 0 0.5rem;
}
.bbc-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--r-md);
  background: #f3f5f7;
}
.bbc-thumb.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  background: #f3f5f7;
}
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Pills & separators */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border-weak);
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: var(--fs-12);
}
.pill-geo {
  background: #eefcf3;
  border-color: #d7f4e3;
  color: #166534;
}
.dot {
  color: #94a3b8;
}

/* Empty state */
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
}

/* ============ Pager ============ */
.pager {
  display: flex;
  gap: var(--s-4);
  justify-content: center;
  align-items: center;
  margin: var(--s-8) 0;
}
.pager .page-count {
  color: var(--muted);
  font-size: var(--fs-12);
}

/* ============ Dashboard / page grid ============ */
.dash-grid,
div[data-dash-grid],
div[style*="grid-template-columns:minmax(0,1fr) 320px"] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: var(--s-8) !important;
  align-items: start !important;
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s-8);
  align-items: start;
}
.page-rail {
  position: sticky;
  top: calc(56px + 12px);
}
.rail-card {
  background: var(--panel);
  border: 1px solid var(--border-weak);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-1);
}
/* Trending rail (Figma-like) */
.trend-rail .rail-title {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--ink-weak);
}

.trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.trend-item {
  background: var(--panel);
  border: 1px solid var(--border-weak);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--t-med) var(--easing),
    transform var(--t-med) var(--easing);
}
.trend-item:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.trend-link {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}

.trend-thumb img,
.trend-thumb .ph {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef2f7;
}

.trend-text {
  min-width: 0;
}

.trend-source .badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border-weak);
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
}

.trend-title {
  margin: 6px 0 4px;
  font-size: 0.95rem;
  line-height: 1.25;
  font-weight: 700;
}
.trend-link:hover .trend-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.trend-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.trend-meta i[data-lucide] {
  width: 14px;
  height: 14px;
}

@media (max-width: 1100px) {
  .dash-grid,
  div[data-dash-grid],
  div[style*="grid-template-columns:minmax(0,1fr) 320px"],
  .page-grid {
    grid-template-columns: 1fr !important;
  }
  #trending-topics,
  .page-rail {
    position: static;
    margin-top: var(--s-6);
  }
}

/* ============ Market strip ============ */
.market-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin: var(--s-4) 0 var(--s-7);
}
.market-chip {
  background: #f6f7f8;
  border: 1px solid var(--border);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.2;
}
.market-chip .pct {
  margin-left: var(--s-3);
}
.market-chip.up {
  background: #eef6ff;
  border-color: #cfe4ff;
}
.market-chip.down {
  background: #fff3f3;
  border-color: #ffdede;
}
#todays-highlight,
#global-market-prices,
#sustainability-news,
#uae-news,
#dubai-news {
  margin-bottom: var(--s-8);
}

/* ============ Utilities & components ============ */
.article-list {
  display: grid;
  gap: var(--s-6);
}
.article-list .article {
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
}
.article h3 {
  margin: 0 0 var(--s-3);
  font-size: 1rem;
}
.article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn {
  display: inline-block;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: var(--fs-14);
  transition: transform var(--t-fast) var(--easing),
    background var(--t-fast) var(--easing);
}
.btn:hover {
  background: #1f3edc;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: #f3f5f8;
}
.btn.disabled,
.btn[aria-disabled="true"] {
  background: #e5e7eb;
  color: #6b7280;
  pointer-events: none;
  cursor: not-allowed;
}

.empty-box {
  padding: 40px 20px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  color: var(--muted);
}

.chart-wrap {
  background: #fff;
  border: 1px solid var(--border);
  padding: var(--s-5);
  border-radius: var(--r-md);
  margin-bottom: var(--s-8);
}
.chart-wrap iframe {
  width: 100%;
  min-height: 420px;
  border: none;
  border-radius: var(--r-sm);
}

/* Text helpers */
.muted {
  color: var(--muted);
}

/* ============ Sidebar Zain CTA (Figma gradient card) ============ */

.sidebar-cta {
  padding: var(--s-4);
  /* little breathing room below the nav list */
  margin-top: 0;
}

.zain-card {
  /* layout: icon | copy | button (right) */
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;

  /* spacing + shape */
  padding: 18px;
  border-radius: 18px;

  /* figma-like gradient + soft border & lift */
  background: linear-gradient(135deg, #34d399 0%, #22c55e 25%, #60a5fa 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);

  /* link reset */
  text-decoration: none;
  color: #fff;

  transition: transform var(--t-med) var(--easing),
    box-shadow var(--t-med) var(--easing),
    border-color var(--t-med) var(--easing);
}
.zain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}
.zain-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35),
    0 10px 24px rgba(37, 99, 235, 0.18);
}

/* Left icon tile */
.zain-badge {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
}
.zain-badge i[data-lucide] {
  width: 22px;
  height: 22px;
}

/* Copy */
.zain-card-copy {
  line-height: 1.15;
}
.zain-card-copy strong {
  display: block;
  font-weight: 800;
  font-size: 1.14rem; /* a hair larger for hierarchy */
  line-height: 1.1;
  color: #fff;
}
.zain-card-copy small {
  display: block;
  margin-top: 4px;
  color: #f0f9ff;
  font-weight: 600;
  font-size: 13.5px;
}

/* Button below (second row, spans both columns) */
.zain-cta-btn {
  grid-column: 1 / -1; /* span full width */
  grid-row: 2; /* second row */
  justify-self: center; /* center horizontally */
  margin-top: 6px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #418bec;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
  transition: transform var(--t-fast) var(--easing),
    box-shadow var(--t-fast) var(--easing);
}
.zain-cta-btn:active {
  transform: translateY(0);
}

.zain-card i[data-lucide] {
  color: #fff;
}

/* Mobile tweak: place the button below the copy on narrow screens */
@media (max-width: 980px) {
  .zain-card {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    grid-auto-flow: row;
  }
  .zain-cta-btn {
    grid-column: 2; /* under the copy */
    justify-self: start;
    margin-top: 8px;
  }
}

/* ============ Floating Zain button ============ */
.zain-fab {
  position: fixed;
  left: 20px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  background: #e6f4ff;
  border: 1px solid #bfe0ff;
  border-radius: var(--r-xl);
  padding: var(--s-5) var(--s-6);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.12);
  cursor: pointer;
  z-index: 60;
  transform: translateZ(0);
  transition: transform var(--t-med) var(--easing),
    box-shadow var(--t-med) var(--easing);
}
.zain-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(2, 132, 199, 0.18);
}
.zain-head {
  font-size: 20px;
}
.zain-copy small {
  display: block;
  color: #16a34a;
}
.zain-cta {
  margin-left: var(--s-4);
  background: #16a34a;
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.22);
  transition: transform var(--t-fast) var(--easing),
    box-shadow var(--t-fast) var(--easing);
}
.zain-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(22, 163, 74, 0.28);
}

/* ============ Responsive tweaks ============ */
/* Mobile-first: single column by default */
.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 56px);
}

/* Desktop: show sidebar when there’s room */
@media (min-width: 1024px) {
  .app-layout { grid-template-columns: 230px 1fr; }
}


/* ============ A11y & motion ============ */
:focus-visible {
  outline: 3px solid #b9d1ff;
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ================= Figma-style Auth (Login / Sign up) ================= */

/* Page background */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 60% at 10% 10%, #eef6ff 0%, transparent 50%),
    radial-gradient(50% 50% at 90% 20%, #ecfdf5 0%, transparent 50%), var(--bg);
}

/* Card */
.auth-card {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e9eef5;
  border-radius: 24px;
  padding: clamp(24px, 4.8vw, 36px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.06), 0 2px 6px rgba(2, 6, 23, 0.04);
}

/* Header */
.auth-head {
  text-align: center;
  margin-bottom: 22px;
}
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}
.auth-title {
  margin: 14px 0 6px;
  font-size: clamp(1.35rem, 2.2vw, 1.55rem);
  font-weight: 800;
  color: #0f172a;
}
.auth-sub {
  margin: 0;
  color: #64748b;
}

/* Form */
.auth-form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  color: #6b7280;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  height: 46px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  border: 1.5px solid #e5eaf1;
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms var(--easing), box-shadow 160ms var(--easing);
}
.field input:focus {
  border-color: #9ec5ff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12),
    0 1px 0 rgba(2, 6, 23, 0.02) inset;
}

/* Row helpers */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row.between {
  justify-content: space-between;
}

/* Checkbox + links */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}
.link {
  color: #2563eb;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

/* Primary button */
.btn.primary {
  display: inline-block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
  transition: transform 150ms var(--easing), filter 150ms var(--easing),
    box-shadow 150ms var(--easing);
}
.btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.22);
}
.btn.primary:active {
  transform: translateY(0);
}

/* Ghost / OAuth buttons */
.btn.ghost {
  display: inline-block;
  text-align: center;
  padding: 11px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid #e5eaf1;
  color: #0f172a;
  transition: background 150ms var(--easing), border-color 150ms var(--easing);
}
.btn.ghost:hover {
  background: #f8fafc;
  border-color: #dfe7f2;
}

/* Divider */
.or {
  position: relative;
  text-align: center;
  color: #94a3b8;
  margin: 16px 0;
}
.or span {
  background: #fff;
  padding: 0 10px;
  position: relative;
  z-index: 1;
}
.or::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: 1px dashed #e5eaf1;
}

/* Footer */
.auth-foot {
  margin-top: 14px;
  text-align: center;
}
.auth-foot .muted {
  color: #64748b;
}

/* Responsive */
@media (max-width: 560px) {
  .auth-card {
    border-radius: 20px;
    padding: 22px;
  }
  .oauth-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ---------- Chat UI (avatars, speech bubbles, quick replies) ---------- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}
.chat-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  background: var(--panel);
  border: 1px solid var(--border-weak);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  min-height: 46vh;
}

/* Messages */
.msg {
  display: flex;
  gap: 12px;
  max-width: 700px;
}
.msg.user {
  margin-left: auto;
  flex-direction: row-reverse;
}
.msg.bot {
  margin-right: auto;
}

/* Avatars -> use images instead of emoji */
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 40%;
  overflow: hidden;
  border: 2px solid var(--border-weak);
  flex: 0 0 40px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bubbles with tails */
.bubble {
  position: relative;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.45;
  color: #fff;
}
.msg.user .bubble {
  background: linear-gradient(180deg, #5cc8ff 0%, #1aa1ff 100%);
}
.msg.user .bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-bottom-right-radius: 12px;
}
.msg.bot .bubble {
  background: linear-gradient(180deg, #84e4f5 0%, #65bb77 100%);
}
.msg.bot .bubble::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-bottom-left-radius: 12px;
}
.meta {
  margin-top: 6px;
  font-size: var(--fs-12);
  color: var(--muted);
}

/* Quick replies styled like bubbles */
.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.qr {
  border: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 10px 12px;
  border-radius: 18px;
  position: relative;
  background: linear-gradient(180deg, #5cc8ff 0%, #3a9ce2 100%);
}
.qr::before {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-bottom-left-radius: 12px;
}

/* Prompt at bottom (single source of truth) */
.prompt-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(
    180deg,
    rgba(248, 252, 249, 0) 0%,
    rgba(248, 252, 249, 1) 40%
  );
  padding-top: var(--s-6);
}
.prompt {
  display: flex;
  gap: var(--s-4);
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--border-weak);
  border-radius: 16px;
  padding: 10px 10px 10px 12px;
  box-shadow: var(--shadow-1);
}
.prompt textarea {
  width: 100%;
  min-height: 60px;
  max-height: 180px;
  resize: vertical;
  border: none;
  outline: none;
  font: inherit;
  color: var(--text);
}
.prompt .send {
  flex: 0 0 auto;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #16a34a;
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
  transition: transform var(--t-fast) var(--easing),
    box-shadow var(--t-fast) var(--easing),
    background var(--t-fast) var(--easing);
}
.prompt .send:hover {
  background: #16a34a;
  transform: translateY(-1px);
}
.prompt .send:active {
  transform: translateY(0);
}

@media (max-width: 720px) {
  .chat-body {
    padding: var(--s-6);
  }
  .msg {
    max-width: 100%;
  }
}

/* Lucide icon sizing */
.icon-btn i[data-lucide],
.top-search button i[data-lucide],
.zain-badge i[data-lucide] {
  width: 20px;
  height: 20px;
}

.zain-badge i[data-lucide] {
  width: 22px;
  height: 22px;
}
/* Two-column layout: chat left, suggestions right */
.chat-wrap.chat-2col {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--s-6);
  align-items: start;
}
.chat-main { display: flex; flex-direction: column; gap: var(--s-7); }

/* Sticky right panel with chips aligned to the right */
.qr-panel {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.qr-panel .qr {
  position: relative;           /* add this */
  width: 100%;
  text-align: right;
  border: 0;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg,#5cc8ff 0%, #1aa1ff 100%);
  box-shadow: var(--shadow-1);
}
.qr-panel .qr::before {
  content: "";
  position: absolute;
  left: -6px; bottom: 8px;
  width: 12px; height: 12px;
  background: inherit; transform: rotate(45deg);
  border-bottom-left-radius: 12px;
}

/* Collapse to single column on smaller screens */
@media (max-width: 1024px) {
  .chat-wrap.chat-2col { grid-template-columns: 1fr; }
  .qr-panel {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--s-4);
  }
  .qr-panel .qr { width: auto; text-align: center; }
}

/* Logout button special styling */
.logout-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-md);
  padding: var(--s-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
  color: #ef4444; /* red tone for logout */
}

.logout-btn:hover {
  background: #fee2e2;  /* light red hover background */
  color: #b91c1c;       /* darker red text/icon */
}
