/* PALESA demo — brand tokens from Brand Identity System Guidelines */
:root {
  --jet: #121212;            /* Jet Black — text, premium backgrounds */
  --white: #FFFFFF;          /* Pure White — space, clarity, interface */
  --forest: #0B6B3A;         /* Forest Green — primary brand colour */
  --emerald: #27AE60;        /* Emerald — success states, highlights */
  --mint: #CFEFD9;           /* Mint — backgrounds, cards, UI sections */
  --coolgray: #E9ECEF;       /* Cool Gray — dividers, surfaces, forms */
  --slate: #5F6368;          /* Slate Gray — secondary text */
  --gold: #C9A227;           /* Gold — premium moments */
  --lime: #B5CC34;           /* Logo accent (sampled from master art) */
  --display: 'Exo', 'Arial', sans-serif;
  --body: 'Anek Latin', 'Arial', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--jet);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 4px; }

/* ---------- Stage ---------- */
.stage { position: relative; min-height: 100vh; overflow: hidden; }
.stage-mark {
  position: fixed; right: -14vw; top: 8vh; height: 110vh; color: #1C1C1C;
  pointer-events: none; z-index: 0;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { height: 44px; width: auto; }
.brand-word { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 24px;
  letter-spacing: 0.14em; line-height: 1;
}
.brand-sub { font-size: 8.5px; letter-spacing: 0.04em; color: var(--slate); margin-top: 4px; }
.topbar-controls { display: flex; gap: 10px; align-items: center; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--slate); border-radius: 999px; padding: 8px 16px;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  color: var(--white); transition: border-color .2s, background .2s;
}
.mode-chip .mode-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--slate); }
.mode-chip[data-mode="live"] { border-color: var(--emerald); background: rgba(39,174,96,.12); }
.mode-chip[data-mode="live"] .mode-dot { background: var(--emerald); animation: pulse 1.6s infinite; }
.mode-chip[data-mode="connecting"] { border-color: var(--gold); }
.mode-chip[data-mode="connecting"] .mode-dot { background: var(--gold); animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ghost-chip {
  border: 1px solid #333; border-radius: 999px; padding: 8px 14px;
  color: var(--slate); font-size: 13px; font-family: var(--display); font-weight: 500;
}
.ghost-chip:hover { color: var(--white); border-color: var(--slate); }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 320px 1fr; gap: 24px;
  max-width: 1080px; margin: 0 auto; padding: 8px 28px 48px;
  align-items: start;
}
.layout > * { min-width: 0; }
.rail { display: flex; flex-direction: column; gap: 22px; padding-top: 12px; }
.rail-title {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime);
  margin-bottom: 10px;
}
.rail-note { font-size: 13.5px; color: #A9ADB2; line-height: 1.5; }
.persona-list { display: flex; flex-direction: column; gap: 8px; }
.persona-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid #2A2A2A; border-radius: 14px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, background .15s;
}
.persona-card:hover { border-color: var(--slate); }
.persona-card[aria-selected="true"] { border-color: var(--lime); background: rgba(181,204,52,.08); }
.persona-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--jet);
}
.persona-name { font-weight: 600; font-size: 14.5px; }
.persona-role { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.event-feed { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.event-feed li { font-size: 12.5px; color: #A9ADB2; line-height: 1.45; display: flex; gap: 8px; }
.event-feed li time { color: var(--slate); font-family: var(--mono); font-size: 11px; flex: none; padding-top: 1px; }
.event-feed li.feed-live { color: var(--emerald); }
.rail-disclaimer { font-size: 11.5px; color: var(--slate); line-height: 1.5; border-top: 1px solid #2A2A2A; padding-top: 14px; }

/* ---------- Phone ---------- */
.phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.banner {
  width: min(400px, 100%); border-radius: 12px; padding: 10px 14px;
  background: rgba(201,162,39,.14); border: 1px solid var(--gold);
  color: #E8D69A; font-size: 13px; line-height: 1.45;
}
.phone {
  width: 400px; max-width: 100%;
  background: #000; border-radius: 54px; padding: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px #2A2A2A;
  position: relative;
}
.phone-notch {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 26px; background: #000; border-radius: 999px; z-index: 3;
}
.statusbar {
  position: absolute; top: 24px; left: 34px; right: 34px; z-index: 2;
  display: flex; justify-content: space-between;
  font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--jet);
}
.statusbar-right { letter-spacing: 2px; font-size: 10px; }
.screen {
  background: var(--white); color: var(--jet);
  border-radius: 44px; height: 780px; max-height: 82vh;
  overflow-y: auto; overflow-x: hidden; position: relative;
  padding: 64px 22px 28px;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.phone-caption { font-size: 13px; color: #A9ADB2; }
.phone-caption-dim { color: var(--slate); }

/* ---------- In-app ---------- */
.app-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.app-greet-hi { font-size: 13px; color: var(--slate); }
.app-greet-name { font-family: var(--display); font-weight: 700; font-size: 20px; }
.app-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--jet); }

.balance-card {
  background: var(--lime); color: var(--jet); border-radius: 22px; padding: 20px 22px;
  margin-bottom: 16px;
}
.balance-label { font-size: 13px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.balance-ccy {
  background: var(--jet); color: var(--white); border-radius: 999px; padding: 4px 12px;
  font-family: var(--display); font-size: 12px; font-weight: 600;
}
.balance-amount { font-family: var(--display); font-weight: 800; font-size: 38px; letter-spacing: -0.01em; margin: 8px 0 4px; }
.balance-note { font-size: 12.5px; color: rgba(18,18,18,.66); }

.chip-row { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.ccy-chip {
  border: 1px solid var(--coolgray); border-radius: 999px; padding: 7px 13px;
  font-size: 13px; font-weight: 600; color: var(--jet); background: var(--white);
}
.ccy-chip .sub { color: var(--slate); font-weight: 400; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.action-btn {
  background: var(--white); border: 1px solid var(--coolgray); border-radius: 16px;
  padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--jet);
  box-shadow: 0 2px 8px rgba(18,18,18,.05);
  transition: transform .12s, border-color .12s;
}
.action-btn:hover { transform: translateY(-1px); border-color: var(--slate); }
.action-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--mint);
  display: grid; place-items: center; font-size: 15px; color: var(--forest);
}

.section-title { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 4px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title .see-all { font-family: var(--body); font-size: 12.5px; color: var(--forest); font-weight: 600; }

.tx-list { display: flex; flex-direction: column; }
.tx-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 2px; border-bottom: 1px solid var(--coolgray);
}
.tx-row:last-child { border-bottom: none; }
.tx-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--coolgray); display: grid; place-items: center; font-size: 15px; flex: none; }
.tx-icon.in { background: var(--mint); color: var(--forest); }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 12px; color: var(--slate); margin-top: 1px; }
.tx-amt { font-family: var(--display); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tx-amt.in { color: var(--forest); }
.status-pill {
  display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.03em; margin-top: 3px;
}
.status-pill.processing { background: var(--coolgray); color: var(--slate); }
.status-pill.settled { background: rgba(11,107,58,.1); color: var(--forest); }
.status-pill.delivered { background: rgba(39,174,96,.14); color: var(--emerald); }

/* Feature card (invoice due, etc.) */
.feature-card {
  border: 1px solid var(--coolgray); border-radius: 18px; padding: 16px; margin-bottom: 18px;
  background: var(--white); box-shadow: 0 2px 8px rgba(18,18,18,.04);
}
.feature-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--forest); margin-bottom: 6px; }
.feature-title { font-weight: 700; font-size: 15px; }
.feature-sub { font-size: 13px; color: var(--slate); margin-top: 3px; line-height: 1.45; }

/* Flow screens */
.flow-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.back-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--coolgray); display: grid; place-items: center; font-size: 16px; flex: none; }
.flow-title { font-family: var(--display); font-weight: 700; font-size: 18px; }
.flow-sub { font-size: 13px; color: var(--slate); margin-top: 2px; }

.recipient-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--coolgray); border-radius: 16px; padding: 13px 14px; margin-bottom: 10px;
  transition: border-color .12s;
}
.recipient-row:hover { border-color: var(--forest); }

.amount-block { text-align: center; padding: 18px 0 8px; }
.amount-display { font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: -0.01em; }
.amount-display .ccy { font-size: 22px; color: var(--slate); font-weight: 600; margin-right: 6px; }
.amount-hint { font-size: 13px; color: var(--slate); margin-top: 4px; }
.preset-row { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.preset {
  border: 1px solid var(--coolgray); border-radius: 999px; padding: 8px 16px;
  font-family: var(--display); font-weight: 600; font-size: 14px;
}
.preset[aria-pressed="true"] { background: var(--jet); color: var(--white); border-color: var(--jet); }

.quote-card { background: #F7F9F4; border: 1px solid var(--coolgray); border-radius: 16px; padding: 14px 16px; margin: 14px 0; }
.quote-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; }
.quote-row .k { color: var(--slate); }
.quote-row .v { font-weight: 600; text-align: right; }
.quote-row.total { border-top: 1px solid var(--coolgray); margin-top: 6px; padding-top: 10px; font-size: 14.5px; }
.quote-foot { font-size: 12px; color: var(--slate); margin-top: 8px; line-height: 1.5; }

.primary-btn {
  display: block; width: 100%; background: var(--jet); color: var(--white);
  border-radius: 999px; padding: 16px; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 15.5px; letter-spacing: .02em;
  margin-top: 14px; transition: opacity .15s;
}
.primary-btn:hover { opacity: .88; }
.primary-btn.green { background: var(--forest); }
.secondary-btn {
  display: block; width: 100%; background: var(--white); color: var(--jet);
  border: 1.5px solid var(--jet); border-radius: 999px; padding: 14px; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 14.5px; margin-top: 10px;
}
.tertiary-btn { display: block; width: 100%; text-align: center; padding: 12px; color: var(--slate); font-size: 13.5px; font-weight: 600; margin-top: 4px; }

/* Tracking / settlement */
.track-wrap { padding-top: 8px; }
.track-steps { list-style: none; margin: 22px 0; }
.track-step { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 26px; position: relative; }
.track-step::before {
  content: ''; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--coolgray);
}
.track-step:last-child::before { display: none; }
.track-dot {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--coolgray); color: var(--slate); font-size: 14px; z-index: 1;
  transition: background .3s, color .3s;
}
.track-step.active .track-dot { background: var(--gold); color: var(--white); animation: pulse 1.2s infinite; }
.track-step.done .track-dot { background: var(--emerald); color: var(--white); }
.track-step.done .track-step-line::before { background: var(--emerald); }
.track-step-title { font-weight: 700; font-size: 14.5px; }
.track-step-sub { font-size: 12.5px; color: var(--slate); margin-top: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.hash-chip {
  display: inline-block; font-family: var(--mono); font-size: 11px; background: var(--coolgray);
  border-radius: 6px; padding: 3px 8px; margin-top: 5px; color: var(--jet);
}
.hash-link { font-size: 12px; color: var(--forest); font-weight: 600; text-decoration: none; display: inline-block; margin-top: 5px; }
.hash-link:hover { text-decoration: underline; }

.success-block { text-align: center; padding: 8px 0 4px; }
.success-check {
  width: 74px; height: 74px; border-radius: 50%; background: var(--emerald); color: var(--white);
  display: grid; place-items: center; font-size: 34px; margin: 6px auto 16px;
  animation: pop .35s ease-out;
}
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.success-headline { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.25; }
.success-sub { font-size: 14px; color: var(--slate); margin-top: 8px; line-height: 1.55; }

.savings-card {
  border: 1.5px solid var(--gold); border-radius: 16px; padding: 14px 16px; margin: 18px 0 4px;
  text-align: left; background: rgba(201,162,39,.06);
}
.savings-headline { font-family: var(--display); font-weight: 700; font-size: 16px; color: #8A6E14; }
.savings-sub { font-size: 12.5px; color: var(--slate); margin-top: 5px; line-height: 1.55; }

/* Merchant QR */
.qr-card { border: 1px solid var(--coolgray); border-radius: 22px; padding: 20px; text-align: center; margin-bottom: 14px; }
.qr-box { width: 210px; height: 210px; margin: 10px auto; }
.qr-amount { font-family: var(--display); font-weight: 800; font-size: 26px; }
.qr-ref { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.demo-trigger {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  border: 1px dashed var(--slate); border-radius: 999px; padding: 9px 16px;
  font-size: 13px; font-weight: 600; color: var(--slate);
}
.demo-trigger:hover { color: var(--jet); border-color: var(--jet); }

.incoming-flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { background: var(--mint); } 100% { background: var(--white); } }

/* FX view */
.fx-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--coolgray); }
.fx-pair { font-weight: 700; font-size: 14.5px; }
.fx-pair .sub { display: block; font-weight: 400; font-size: 12px; color: var(--slate); margin-top: 2px; }
.fx-rate { font-family: var(--display); font-weight: 700; font-size: 16px; }
.fx-promise {
  background: var(--mint); border-radius: 14px; padding: 13px 15px; margin: 16px 0;
  font-size: 13.5px; color: var(--forest); font-weight: 600; line-height: 1.5;
}

/* Onboarding overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(18,18,18,.86);
  display: grid; place-items: center; padding: 20px;
}
.onboard-card {
  background: var(--white); color: var(--jet); border-radius: 28px; padding: 30px 26px;
  width: min(420px, 100%); max-height: 90vh; overflow-y: auto;
}
.onboard-mark { height: 54px; margin-bottom: 14px; }
.onboard-mark svg { height: 100%; width: auto; }
.onboard-title { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.25; }
.onboard-sub { font-size: 14px; color: var(--slate); margin-top: 8px; line-height: 1.55; }
.onboard-steps { list-style: none; margin: 20px 0 8px; }
.onboard-step { display: flex; gap: 12px; align-items: center; padding: 9px 0; font-size: 14px; opacity: .25; transition: opacity .4s; }
.onboard-step.shown { opacity: 1; }
.onboard-tick {
  width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--forest);
  display: grid; place-items: center; font-size: 13px; flex: none;
}
.onboard-principle {
  border-left: 3px solid var(--lime); padding: 4px 0 4px 14px; margin: 14px 0 6px;
  font-size: 13.5px; line-height: 1.55; color: var(--jet); font-weight: 500;
}

/* Receipt modal */
.receipt-card {
  background: var(--white); color: var(--jet); border-radius: 24px; padding: 26px 24px;
  width: min(400px, 100%); max-height: 88vh; overflow-y: auto;
}
.receipt-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.receipt-brand svg { height: 30px; }
.receipt-brand span { font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 4px 14px 40px; gap: 14px; }
  .rail { order: 2; }
  .rail-feed { display: none; }
  .persona-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .persona-card { min-width: 190px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .brand-name { font-size: 19px; }
  .brand-mark { height: 34px; }
  .mode-chip { padding: 7px 12px; font-size: 12px; }
  .ghost-chip { padding: 7px 11px; font-size: 12px; }
  .phone { width: 100%; border-radius: 40px; }
  .screen { max-height: none; height: 74vh; border-radius: 32px; }
  .stage-mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
