/* ═══════════════════════════════════════════════════════════════════
   SmartBudget Showcase — smartbudge.shop
   Oschadbank green palette · iOS safe-area support
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --green:       #006B38;
  --green-mid:   #2DA55F;
  --green-dark:  #00502A;
  --green-light: #E8F5EE;
  --surface:     #F3F6F4;
  --purple-1:    #7030D0;
  --purple-2:    #421A95;
  --orange:      #E07820;
  --text:        #111827;
  --text-sec:    #6B7280;
  --text-ter:    #9CA3AF;
  --divider:     #E5E7EB;
  --white:       #FFFFFF;
  --shadow:      rgba(0, 0, 0, 0.07);

  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   NEUTRAL PAGE (English)
   ═══════════════════════════════════════════════════════════════════ */
#neutral-page {
  background: var(--white);
  min-height: 100vh;
  padding-bottom: calc(var(--sab) + 24px);
}

.neutral-header {
  background: var(--green);
  padding: 16px 20px;
  padding-top: calc(var(--sat) + 16px);
}

.neutral-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.neutral-logo-icon { font-size: 24px; }
.neutral-logo-text { font-size: 18px; font-weight: 700; color: var(--white); }

.neutral-content {
  padding: 24px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.neutral-hero { margin-bottom: 24px; }

.neutral-hero h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}

.neutral-subtitle {
  font-size: 16px;
  color: var(--text-sec);
  line-height: 1.5;
}

.neutral-article { margin-bottom: 28px; }

.neutral-article h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 20px 0 10px;
}

.neutral-article h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 8px;
}

.neutral-article p {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.65;
  margin-bottom: 12px;
}

.neutral-article ul {
  padding-left: 20px;
  color: var(--text-sec);
}

.neutral-article ul li {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.neutral-cards {
  display: grid;
  gap: 14px;
}

.neutral-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px;
}

.neutral-card-icon { font-size: 28px; margin-bottom: 10px; }
.neutral-card h3   { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.neutral-card p    { font-size: 14px; color: var(--text-sec); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════
   SHOWCASE — Header
   ═══════════════════════════════════════════════════════════════════ */
#showcase-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  background: var(--white);
  padding: 0 16px;
  padding-top: calc(var(--sat) + 12px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-title    { font-size: 22px; font-weight: 800; }
.header-subtitle { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* Scroll area */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--sab) + 32px);
}

/* ═══════════════════════════════════════════════════════════════════
   Promo Banner
   ═══════════════════════════════════════════════════════════════════ */
.promo-banner {
  margin: 16px 16px 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--purple-1) 0%, var(--purple-2) 100%);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.banner-decor-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.banner-circle-1 { width: 200px; height: 200px; top: -60px; right: -50px; }
.banner-circle-2 { width: 120px; height: 120px; bottom: -30px; right: 40px; }

.banner-layout {
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 1;
  min-height: 186px;
}

.banner-person {
  width: 120px;
  flex-shrink: 0;
  align-self: flex-end;
  padding-left: 8px;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.banner-person-glow {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  bottom: 0;
  left: 10px;
}

.banner-person-icon {
  width: 70px;
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
}

.banner-text {
  flex: 1;
  padding: 20px 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.banner-label {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 2px;
}

.banner-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.banner-to {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.banner-amount {
  font-size: 34px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.5px;
}

.banner-line {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
}

.banner-line strong { color: var(--white); font-weight: 700; }

.banner-btn {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.30);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 50px;
  align-self: flex-start;
  transition: background 0.2s;
}

.banner-btn:active { background: rgba(0, 0, 0, 0.45); }

/* ═══════════════════════════════════════════════════════════════════
   Category Chips
   ═══════════════════════════════════════════════════════════════════ */
.chips-wrapper {
  padding: 14px 0 4px;
  overflow: hidden;
}

.chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 16px;
}

.chips-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  background: #E5E7EB;
  color: var(--text);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.chip.active {
  background: linear-gradient(90deg, var(--green-mid), var(--green));
  color: var(--white);
  font-weight: 700;
}

.chip:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════════
   Offers List
   ═══════════════════════════════════════════════════════════════════ */
.offers-list {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-sec);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--text-sec);
  font-size: 15px;
  text-align: center;
}

.empty-icon { font-size: 36px; opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════════════
   Offer Card
   ═══════════════════════════════════════════════════════════════════ */
.offer-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
}

.card-badge {
  background: rgba(0, 107, 56, 0.07);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-logo-area {
  background: var(--white);
  margin: 14px 16px 0;
  border-radius: 14px;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  gap: 8px;
}

.card-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: contain;
}

.card-logo-fallback {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-light);
}

.card-logo-fallback svg { width: 48px; height: 48px; }
.card-logo-name { font-size: 13px; font-weight: 600; color: var(--text-sec); }

.card-info {
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-name     { font-size: 18px; font-weight: 800; }
.card-subtitle { font-size: 13px; color: var(--text-sec); }

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.star         { color: #F59E0B; font-size: 13px; }
.rating-val   { font-size: 13px; font-weight: 700; }
.rating-count { font-size: 12px; color: var(--text-sec); }

.card-divider {
  height: 1px;
  background: var(--divider);
  margin: 14px 16px 0;
}

.card-params { padding: 0 16px; }

.param-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
}

.param-row:last-child { border-bottom: none; }
.param-label { font-size: 14px; color: var(--text-sec); }
.param-value { font-size: 14px; color: var(--text); }

.card-actions {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  align-items: center;
}

.btn-apply {
  flex: 1;
  background: var(--green);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
  padding: 15px;
  border-radius: 50px;
  text-align: center;
  transition: opacity 0.18s, transform 0.15s;
}

.btn-apply:active { opacity: 0.82; transform: scale(0.98); }

.btn-detail {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid #D1D5DB;
  font-size: 20px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-detail:active { background: var(--surface); }

/* Legal */
.legal-text {
  font-size: 11px;
  color: #C4C9D4;
  line-height: 1.5;
  text-align: center;
  padding: 16px 24px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Bottom Sheet
   ═══════════════════════════════════════════════════════════════════ */
.bs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--sab) + 8px);
}

.bottom-sheet.open { transform: translateY(0); }

.bs-handle {
  width: 40px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.bs-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 24px;
  flex: 1;
}

.bs-logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.bs-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.bs-logo svg { width: 100%; height: 100%; }

.bs-name     { font-size: 20px; font-weight: 800; }
.bs-subtitle { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.bs-rating   { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; }

.bs-section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 10px;
}

.bs-description {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.6;
}

.req-row { padding: 11px 0; }
.req-divider { border-bottom: 1px solid var(--divider); }
.req-label { font-size: 12px; color: var(--text-sec); margin-bottom: 2px; }
.req-value { font-size: 15px; color: var(--text); }

.bs-content .btn-apply {
  display: block;
  width: 100%;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 430px) {
  .neutral-content,
  .header-inner {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }
}
