/* ================================================================
   HERITAGE COMMUNITY BANK — REDESIGNED PERKS WALL
   Editorial luxury aesthetic: dark surfaces, warm gold, glass
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand — overridden at runtime by testdemo.config.js */
  --brand-primary:       #1B4FBF;
  --brand-primary-hover: #1540A0;
  --brand-primary-light: #EEF2FF;

  /* Editorial palette — light luxury */
  --warm-50:    #FDFCFA;
  --warm-100:   #FAF8F5;
  --warm-200:   #F0EDE6;
  --warm-300:   #E2DDD4;
  --warm-400:   #C8C3BA;
  --warm-500:   #8B8680;
  --warm-600:   #5C5752;
  --warm-700:   #3D3935;
  --warm-800:   #252220;
  --gold:       #B8923F;
  --gold-deep:  #96762E;
  --gold-light: #F5EFE0;
  --gold-glow:  rgba(184, 146, 63, 0.12);
  --white:      #ffffff;
  --emerald:    #34D399;
  --rose:       #F87171;

  /* Neutral grays (kept for non-perkswall parts) */
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;

  /* Semantic */
  --green:      #059669;
  --green-bg:   #ECFDF5;
  --purple:     #7C3AED;
  --purple-bg:  #F5F3FF;

  /* Account accent colors */
  --acct-checking: #1B4FBF;
  --acct-savings:  #059669;
  --acct-mm:       #7C3AED;

  /* Layout */
  --sidebar-w:    224px;
  --header-h:     60px;

  /* Typography */
  --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Easing */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.09);
  --shadow-lg:  0 8px 28px rgba(0,0,0,0.13);
  --shadow-xl:  0 24px 56px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.10);
  --shadow-gold: 0 4px 20px rgba(212, 168, 83, 0.25);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--gray-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: var(--font); }
a { color: inherit; }

/* ================================================================
   LOGIN SCREEN — Same as original
   ================================================================ */

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(27,79,191,0.10) 0%, transparent 70%),
    linear-gradient(180deg, #EEF2FF 0%, #F4F7FF 50%, #EDF1FF 100%);
  transition: opacity 0.38s var(--ease);
}

.login-screen.fading { opacity: 0; pointer-events: none; }

.login-card {
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 48px 44px 40px;
  width: 100%;
  max-width: 420px;
  animation: rise 0.48s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}

.login-logo-mark {
  width: 46px; height: 46px;
  background: var(--brand-primary);
  border-radius: 11px;
  color: var(--white);
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 12px rgba(27,79,191,0.30);
}

.login-brand-text { display: flex; flex-direction: column; gap: 1px; }

.login-bank-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.login-bank-sub {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
}

.login-heading {
  font-size: 23px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.login-subheading {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.field-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 9px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27,79,191,0.13);
}

.field-input--password { letter-spacing: 0.1em; }

.login-btn {
  position: relative;
  margin-top: 4px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  background: var(--brand-primary);
  color: var(--white);
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 3px 10px rgba(27,79,191,0.28);
}

.login-btn:hover  { background: var(--brand-primary-hover); }
.login-btn:active { transform: scale(0.98); }

.login-btn-label   { transition: opacity 0.15s; }
.login-btn-spinner {
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  opacity: 0;
  transition: opacity 0.15s;
}

.login-btn.loading .login-btn-label   { opacity: 0; }
.login-btn.loading .login-btn-spinner { opacity: 1; }

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

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 32px;
  font-size: 11.5px;
  color: var(--gray-400);
  text-align: center;
}

/* ================================================================
   APP SHELL
   ================================================================ */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.38s var(--ease);
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

.app-shell.visible { opacity: 1; }

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s;
}
.mobile-menu-btn:hover { background: var(--gray-100); }

/* Sidebar overlay — hidden on desktop */
.sidebar-overlay {
  display: none;
}

.header-logo-wrap { display: flex; align-items: center; }
.header-logo-svg  { display: block; }
.header-logo-img  { height: 32px; width: auto; display: block; }

.header-logo-text {
  font-family: var(--font);
  font-weight: 800;
}

.header-divider {
  width: 1px; height: 20px;
  background: var(--gray-200);
  flex-shrink: 0;
}

.header-subtitle {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 400;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: transparent;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}

.header-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.header-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.dashboard-container {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-inner { padding: 20px 0; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-item.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.nav-icon { flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item span:not(.nav-badge):not(.nav-icon) { flex: 1; }

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--brand-primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.nav-badge--count {
  min-width: 20px;
  text-align: center;
  padding: 2px 6px;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 32px 36px 48px;
  min-width: 0;
  background: var(--gray-50);
}

/* ── View transitions ────────────────────────────────────────── */
.view-content {
  animation: view-rise 0.22s var(--ease) both;
}

@keyframes view-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.page-date {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 3px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ── Welcome Banner ──────────────────────────────────────────── */
.welcome-banner {
  background: var(--brand-primary);
  border-radius: 14px;
  padding: 26px 30px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(27,79,191,0.22);
}

.welcome-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.welcome-body {
  font-size: 13.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
  max-width: 480px;
}

.welcome-action { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

.welcome-offers-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.welcome-offer-logos { display: flex; align-items: center; }

.welcome-offer-chip {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid rgba(255,255,255,0.45);
  overflow: hidden;
  margin-left: -8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.welcome-offer-chip:first-child { margin-left: 0; }
.welcome-offer-chip img { width: 22px; height: 22px; object-fit: contain; display: block; }

.welcome-offers-count {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
  white-space: nowrap;
}

.welcome-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.30);
  border-radius: 8px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.welcome-action-btn:hover  { background: rgba(255,255,255,0.26); }
.welcome-action-btn:active { transform: scale(0.97); }

/* ── Dashboard sections ──────────────────────────────────────── */
.dashboard-section { margin-bottom: 28px; }

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-more {
  font-size: 12.5px;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
}
.section-more:hover { text-decoration: underline; }

/* ── Account Cards ───────────────────────────────────────────── */
.accounts-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.account-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: default;
}

.account-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
}

.account-card--checking::before { background: var(--acct-checking); }
.account-card--savings::before  { background: var(--acct-savings); }
.account-card--mm::before       { background: var(--acct-mm); }

.account-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.acct-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.account-card--checking .acct-badge { background: var(--brand-primary-light); color: var(--acct-checking); }
.account-card--savings  .acct-badge { background: var(--green-bg);             color: var(--acct-savings); }
.account-card--mm       .acct-badge { background: var(--purple-bg);            color: var(--acct-mm); }

.acct-number {
  display: block;
  font-size: 12px;
  color: var(--gray-400);
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.acct-balance {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  margin-bottom: 3px;
}

.acct-label {
  font-size: 11.5px;
  color: var(--gray-400);
}

/* ── Activity List ───────────────────────────────────────────── */
.activity-list {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}

.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--gray-50); }

.activity-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon--credit {
  background: var(--green-bg);
  color: var(--green);
}

.activity-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.activity-desc {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-date {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 1px;
}

.activity-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.activity-amount--credit { color: var(--green); }


/* ================================================================
   ████  MEMBER REWARDS — THE REDESIGNED PERKS WALL  ████
   Editorial luxury: warm light canvas, gold accents, refined cards
   ================================================================ */

/* Slate canvas for the perks wall */
#partner-deals {
  background: #e2e8f0;
  margin: -32px -36px -48px;
  padding: 0;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  width: calc(100% + 72px);
}

/* Subtle warm radial glow */
#partner-deals::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 30% 0%, rgba(184, 146, 63, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(27, 79, 191, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#partner-deals > * {
  position: relative;
  z-index: 1;
}

/* ── Page Header ─────────────────────────────────────────────── */
#partner-deals .page-header {
  padding: 40px 44px 0;
  margin-bottom: 32px;
}

#partner-deals .page-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  color: #1e293b;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

#partner-deals .page-subtitle {
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* ================================================================
   FEATURED CAROUSEL — Cinematic full-bleed hero
   ================================================================ */

.featured-carousel {
  position: relative;
  margin: 0 44px 36px;
  border-radius: 20px;
  overflow: hidden;
  background: #1A1D23;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.carousel-track-wrap {
  overflow: hidden;
  border-radius: 20px;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s var(--smooth);
  will-change: transform;
}

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  position: relative;
  height: 280px;
  overflow: hidden;
}

/* Hero image fills entire slide as background */
.carousel-image-panel {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.carousel-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark gradient overlay for text readability */
.carousel-image-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(13,17,23,0.88) 0%, rgba(13,17,23,0.4) 40%, rgba(13,17,23,0.15) 100%);
  pointer-events: none;
}

/* Content sits at the bottom over the image — text only, CTA moved to nav bar */
.carousel-content-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 0 32px 56px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  background: none;
}

.carousel-content-panel::after { display: none; }

.carousel-logo-wrap {
  width: 44px;
  height: 44px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.carousel-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.carousel-text { flex: 1; }

.carousel-partner {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 12px rgba(0,0,0,0.5);
}

.carousel-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--white);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

/* CTA wrap — sits in the bottom nav bar, left of the arrows */
.carousel-cta-wrap {
  position: absolute;
  bottom: 18px;
  left: 32px;
  z-index: 10;
}

.carousel-cta {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 7px 20px;
  background: var(--white);
  color: var(--warm-800);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.carousel-cta.active { display: inline-flex; }
.carousel-cta:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.carousel-cta:active { transform: scale(0.96); }

.carousel-overlay { display: none; }

/* Nav: arrows + dots — shifted right to make room for CTA on the left */
.carousel-btn {
  position: absolute;
  bottom: 18px;
  top: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: rgba(255,255,255,0.7);
  transition: background 0.15s, color 0.15s;
  transform: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.carousel-btn:hover  { background: rgba(255,255,255,0.22); color: var(--white); }
.carousel-btn:active { transform: scale(0.9); }
.carousel-btn--prev  { right: 70px; left: auto; }
.carousel-btn--next  { right: 32px; left: auto; }

.carousel-dots {
  position: absolute;
  bottom: 25px;
  right: 108px;
  left: auto;
  transform: none;
  display: flex;
  gap: 6px;
  z-index: 10;
  align-items: center;
}

.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, width 0.25s;
}
.carousel-dot.active {
  background: var(--white);
  width: 18px;
  border-radius: 3px;
}

/* ================================================================
   ALL OFFERS HEADER & CATEGORY FILTERS
   ================================================================ */

.all-offers-header {
  margin: 0 44px 24px;
}

#partner-deals .all-offers-header .section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: #1e293b;
  margin-bottom: 16px;
}

.filters-bar { margin-bottom: 0; }

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#partner-deals .filter-btn {
  padding: 8px 18px;
  border-radius: 24px;
  border: 1px solid #cbd5e1;
  background: var(--white);
  color: #64748b;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--smooth);
  letter-spacing: 0.2px;
}

#partner-deals .filter-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

#partner-deals .filter-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(27, 79, 191, 0.2);
}

/* ================================================================
   OFFERS GRID — Split-image card layout
   ================================================================ */

#partner-deals .offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 44px 56px;
}

/* ── Offer Card — 1x2 Grid: [logo] [text + CTA] ─────────────── */

.offer-card {
  background: var(--white);
  border: 1px solid var(--warm-300);
  border-radius: 16px;
  padding: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: transform 0.3s var(--smooth), box-shadow 0.3s var(--smooth);
  animation: card-rise 0.4s var(--ease) both;
  overflow: hidden;
  position: relative;
}

.offer-card::before { display: none; }

.offer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.1);
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Cell: Logo (left) ───────────────────────────────────────── */
.offer-cell-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--brand-primary);
  border-radius: 16px 0 0 16px;
  filter: saturate(0.3) brightness(1.4) contrast(0.85);
  transition: filter 0.3s var(--smooth);
}

.offer-card:hover .offer-cell-logo {
  filter: saturate(1) brightness(0.95) contrast(1);
}

.offer-logo-float {
  width: 80px; height: 80px;
  background: transparent;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.offer-logo-float img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 18px;
}

.offer-logo-float .offer-logo-initials {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand-primary);
  font-family: var(--font);
}

/* ── Cell: Text + CTA (right) ────────────────────────────────── */
.offer-cell-text {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Fixed height so all cards match (based on 2-line title + 2-line desc + CTA) */
  height: 170px;
}

.offer-partner {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--brand-primary);
  line-height: 1.3;
}

.offer-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--warm-800);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0;
  margin-top: 2px;
}

.offer-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--warm-500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

/* When title is long (2+ lines), clamp desc to 1 line */
.offer-desc--short {
  -webkit-line-clamp: 1;
}

/* ── CTA Button (inside text cell) ───────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: 6px;
  min-height: 36px;
  width: calc(18ch + 36px);
  margin-top: auto;
  padding: 8px 18px;
  background: var(--brand-primary);
  color: var(--white);
  border: none;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(27,79,191,0.2);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 4px 16px rgba(27,79,191,0.25);
}

.btn-primary:active { transform: scale(0.97); }

/* ── Loading / Error / Empty states ─────────────────────────── */
#partner-deals .load-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  color: #64748b;
  gap: 16px;
  font-size: 14px;
}

#partner-deals .load-state--error { color: var(--rose); }

#partner-deals .load-spinner {
  width: 32px; height: 32px;
  border: 2.5px solid #cbd5e1;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}


/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (min-width: 1400px) {
  .main-content { padding: 36px 48px 56px; }
  #partner-deals { margin: -36px -48px -56px; width: calc(100% + 96px); }
  #partner-deals .page-header,
  #partner-deals .all-offers-header,
  .featured-carousel {
    margin-left: 56px;
    margin-right: 56px;
  }
  #partner-deals .offers-grid {
    grid-template-columns: repeat(2, 1fr);
    padding-left: 56px;
    padding-right: 56px;
  }
}

@media (max-width: 1024px) {
  .accounts-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .account-card--mm {
    grid-column: 1 / span 2;
    max-width: 380px;
  }
  .main-content { padding: 24px 24px 40px; }

  #partner-deals { margin: -24px -24px -40px; width: calc(100% + 48px); }
  #partner-deals .page-header,
  #partner-deals .all-offers-header,
  .featured-carousel {
    margin-left: 28px;
    margin-right: 28px;
  }
  #partner-deals .offers-grid {
    grid-template-columns: 1fr;
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari horizontal overflow from negative-margin breakout */
  .dashboard-container { overflow-x: hidden; }

  /* Mobile menu button visible */
  .mobile-menu-btn { display: flex; }

  /* Sidebar: slide-in drawer on mobile */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s var(--smooth);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  /* Overlay backdrop */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--smooth);
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hide header items that don't fit on mobile */
  .header-divider,
  .header-subtitle { display: none; }
  .header-btn:not(.header-btn--profile) { display: none; }
  .header-btn--profile span:not(.header-avatar) { display: none; }
  .header-btn--profile { padding: 6px; border: none; }
  .main-content { padding: 20px 16px 40px; }
  .login-card { padding: 36px 28px 32px; }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 22px;
  }

  .welcome-action { width: 100%; text-align: left; }
  .welcome-action-btn { width: 100%; justify-content: center; }

  .accounts-strip {
    grid-template-columns: none;
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .accounts-strip::-webkit-scrollbar { display: none; }

  .account-card {
    flex-shrink: 0;
    width: 240px;
    scroll-snap-align: start;
  }

  .account-card--mm {
    grid-column: auto;
    max-width: none;
  }

  .page-title   { font-size: 19px; }
  .acct-balance { font-size: 20px; }

  /* Perks wall mobile */
  #partner-deals { margin: -20px -16px -40px; width: calc(100% + 32px); max-width: 100vw; }
  #partner-deals .page-header,
  #partner-deals .all-offers-header,
  .featured-carousel {
    margin-left: 20px;
    margin-right: 20px;
  }
  #partner-deals .page-title { font-size: 26px; }

  #partner-deals .offers-grid {
    grid-template-columns: 1fr;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Show cards at full color on mobile — no hover effect */
  .offer-cell-logo {
    filter: saturate(1) brightness(0.95) contrast(1);
  }

  .offer-logo-float {
    width: 64px; height: 64px;
  }

  .offer-logo-float img {
    width: 64px; height: 64px;
  }

  /* Carousel: full image, controls in dark bar below */
  .featured-carousel {
    display: flex;
    flex-direction: column;
  }
  .carousel-track-wrap    { border-radius: 20px 20px 0 0; }
  .carousel-slide         { height: auto; aspect-ratio: 3.57; }
  .carousel-content-panel { padding: 0 16px 12px; }
  .carousel-title         { font-size: 14px; }
  .carousel-logo-wrap     { width: 32px; height: 32px; }
  .carousel-logo          { width: 24px; height: 24px; }
  .carousel-partner       { font-size: 9px; }

  /* Dark control bar below the hero */
  .carousel-cta-wrap,
  .carousel-btn,
  .carousel-dots {
    position: static;
  }
  .featured-carousel::after {
    content: '';
    display: block;
    height: 44px;
    background: #1A1D23;
    border-radius: 0 0 20px 20px;
    position: relative;
  }
  .carousel-cta-wrap {
    position: absolute;
    bottom: 10px;
    left: 16px;
    z-index: 10;
  }
  .carousel-btn {
    position: absolute;
    bottom: 8px;
    top: auto;
    z-index: 10;
  }
  .carousel-btn--prev     { right: 54px; left: auto; }
  .carousel-btn--next     { right: 16px; left: auto; }
  .carousel-dots {
    position: absolute;
    bottom: 15px;
    right: 90px;
    left: auto;
    z-index: 10;
  }

  /* Cards: remove fixed height on mobile, let content flow */
  .offer-cell-text {
    height: auto;
    padding: 12px 14px 14px;
  }

  /* CTA: auto width on mobile, left-aligned text */
  .btn-primary {
    width: auto;
    padding: 8px 16px;
    justify-content: flex-start;
    margin-top: 10px;
  }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .login-screen.fading { opacity: 0; }
  .app-shell.visible   { opacity: 1; }
  .load-spinner        { animation: none; opacity: 0.5; }
}
