/* AkiliGo - refined mobile transfer app style. Light only. */

:root {
  color-scheme: light;
  --bg: #f5f2ea;
  --bg-soft: #fbfaf6;
  --surface: #ffffff;
  --surface-warm: #fffaf1;
  --surface-cool: #eef7f5;
  --inset: #f2f4f1;
  --text: #17201b;
  --text-soft: #425047;
  --hint: #7b867f;
  --line: rgba(23, 32, 27, 0.1);
  --line-strong: rgba(23, 32, 27, 0.18);
  --accent: #0f6b5b;
  --accent-fill: #0f6b5b;
  --accent-press: #0a4f43;
  --accent-soft: #dff2ed;
  --sun: #f4a937;
  --sun-soft: #fff0cf;
  --berry: #b13f5a;
  --link: #1768ac;
  --good: #137044;
  --warn: #98621a;
  --bad: #b4233a;
  --radius-card: 18px;
  --radius-row: 14px;
  --shadow-card: 0 14px 32px rgba(23, 32, 27, 0.08);
  --shadow-lift: 0 20px 42px rgba(23, 32, 27, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    linear-gradient(180deg, rgba(15, 107, 91, 0.13) 0, rgba(15, 107, 91, 0) 260px),
    linear-gradient(135deg, rgba(244, 169, 55, 0.16) 0 18%, transparent 18% 100%),
    var(--bg);
  color: var(--text);
  font-family: "Twemoji Country Flags", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-x: contain;
}

button,
input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.topbar { padding: calc(18px + env(safe-area-inset-top)) 16px 10px; }

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-link {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: opacity 0.1s, transform 0.06s;
}
.brand-link:hover { opacity: 0.85; }
.brand-link:active { transform: scale(0.97); }
.brand-link > * { display: block; }

.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: "Bricolage Grotesque", "Inter", -apple-system, sans-serif;
  font-size: clamp(31px, 9vw, 40px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.brand-akili { color: var(--text); }

.brand-go {
  color: var(--accent);
  margin-left: 1px;
  position: relative;
}

.brand-go::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 0;
  bottom: -4px;
  height: 5px;
  border-radius: 999px;
  background: var(--sun);
}

.tagline {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
}

.currency-pill {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 107, 91, 0.2);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 13px;
  box-shadow: 0 7px 18px rgba(23, 32, 27, 0.08);
  transition: transform 0.08s ease, background 0.15s ease;
}

.currency-pill:active { transform: scale(0.97); }

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 8px 16px 0;
  padding: 5px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(23, 32, 27, 0.08);
  backdrop-filter: blur(18px);
}

.tab {
  min-height: 38px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--hint);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab.active {
  background: var(--accent-fill);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 107, 91, 0.24);
}

.content {
  width: min(100%, 560px);
  min-height: 62vh;
  margin: 0 auto;
  padding: 18px 16px 42px;
  animation: fade-slide-in 0.18s ease;
  touch-action: pan-y;
}

@keyframes fade-slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 22px 4px 11px;
  text-transform: uppercase;
}

.section-title:first-child { margin-top: 4px; }

.card,
.summary-card,
.list-item,
.history-card,
.stats-card,
.invite-card,
.install-banner {
  border: 1px solid rgba(23, 32, 27, 0.08);
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 16px 18px;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background 0.12s ease, transform 0.08s ease;
}

.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-cool); transform: scale(0.995); }

.row-radio {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(23, 32, 27, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.row.selected .row-radio {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}

.row.selected .row-radio::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 50%;
}

.row.row-disabled { opacity: 0.48; }
.row-main { flex: 1; min-width: 0; }
.row-title { color: var(--text); font-size: 16px; font-weight: 800; }
.row-sub { color: var(--hint); font-size: 13px; font-weight: 560; margin-top: 4px; }
.row-trailing { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

.row-inset {
  background: var(--inset);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 18px 16px;
  padding: 14px;
}

.row-inset-text { color: var(--text); font-size: 14px; font-weight: 800; }
.row-inset-sub { color: var(--hint); font-size: 12px; margin-top: 3px; }

.row-inset-link {
  background: none;
  border: 0;
  color: var(--link);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.country-card {
  min-height: 132px;
  background: var(--surface);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: var(--radius-card);
  box-shadow: 0 9px 24px rgba(23, 32, 27, 0.07);
  cursor: pointer;
  overflow: hidden;
  padding: 17px;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.country-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--berry));
  opacity: 0;
}

.country-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.country-card:active { transform: scale(0.98); }

.country-card.selected {
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px rgba(15, 107, 91, 0.14), var(--shadow-lift);
}

.country-card.selected::before,
.country-card:hover::before { opacity: 1; }

.country-flag { display: flex; align-items: center; min-height: 38px; }

.flag-img {
  border: 1px solid rgba(23, 32, 27, 0.12);
  box-shadow: 0 4px 10px rgba(23, 32, 27, 0.08);
}

.country-name { color: var(--text); font-size: 17px; font-weight: 850; margin-top: 12px; }
.country-sub { color: var(--hint); font-size: 12px; font-weight: 650; margin-top: 4px; }

.label {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 8px;
}

.input {
  width: 100%;
  min-height: 52px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  padding: 14px 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 4px rgba(15, 107, 91, 0.14);
}

.input::placeholder { color: #a0aaa3; }

.button-primary,
.history-action-primary { background: var(--accent-fill); color: #fff; }

.button-primary {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 12px 26px rgba(15, 107, 91, 0.24);
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
  margin-top: 20px;
  padding: 16px 18px;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.button-primary:hover {
  background: var(--accent-press);
  box-shadow: 0 16px 32px rgba(15, 107, 91, 0.28);
  transform: translateY(-1px);
}

.button-primary:active { transform: scale(0.98); }
.button-primary:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }

.button-secondary {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--link);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  margin-top: 9px;
  padding: 12px;
}

.back-button {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(23, 32, 27, 0.09);
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
  padding: 8px 13px;
}

.summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 241, 0.96));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  margin-top: 12px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--berry));
}

.summary-product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-product-info { flex: 1; min-width: 0; }
.summary-product-name { color: var(--text); font-size: 17px; font-weight: 850; }
.summary-product-sub { color: var(--hint); font-size: 13px; margin-top: 4px; }

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-size: 14px;
}

.price-line .label-text { color: var(--hint); font-weight: 650; }
.price-line .value { color: var(--text); font-weight: 800; text-align: right; }

.price-line.total {
  border-top: 1px dashed var(--line-strong);
  font-size: 19px;
  font-weight: 850;
  margin-top: 10px;
  padding-top: 15px;
}

.list-item,
.history-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-row);
  box-shadow: 0 8px 20px rgba(23, 32, 27, 0.06);
  margin-bottom: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
}

.list-item-avatar {
  width: 45px;
  height: 45px;
  background: var(--accent-soft);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 21px;
}

.list-item-main { flex: 1; min-width: 0; }
.list-item-title { color: var(--text); font-size: 15px; font-weight: 850; overflow-wrap: anywhere; }
.list-item-sub { color: var(--hint); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }

.list-item-actions { display: flex; gap: 5px; flex-shrink: 0; }

.list-item-actions button {
  width: 36px;
  height: 36px;
  background: var(--inset);
  border: 0;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.list-item-actions button:active { background: var(--accent-soft); }

.history-card { padding: 15px; }

.history-card-header { display: flex; align-items: center; gap: 13px; }

.history-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.history-action {
  min-height: 44px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  padding: 11px 15px;
  text-align: center;
}

.history-action-primary { border: 0; }
.history-action-danger { background: #fff; border: 1px solid rgba(180, 35, 58, 0.28); color: var(--bad); }

.chip {
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  white-space: nowrap;
}

.chip-safaricom { background: #088c45; }
.chip-airtel { background: #d81f2a; }
.chip-telkom { background: #1167af; }
.chip-vodacom { background: #d80f16; }
.chip-tigo { background: #1387c7; }
.chip-mtn { background: #ffd23f; color: #2f2500; }
.chip-glo { background: #45a84c; }
.chip-orange { background: #f47b20; }
.chip-free { background: #c63f3f; }
.chip-expresso { background: #294c92; }
.chip-moov { background: #1d5f87; }
.chip-ethio { background: #138b4e; }
.chip-default { background: #6c776f; }

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-delivered { background: #dff6e8; color: var(--good); }
.status-paid,
.status-processing { background: var(--sun-soft); color: var(--warn); }
.status-failed { background: #ffe4e8; color: var(--bad); }
.status-pending_payment { background: #e3eef8; color: #1f5e91; }

.empty-state {
  color: var(--hint);
  padding: 54px 16px;
  text-align: center;
}

.empty-state .emoji { font-size: 46px; margin-bottom: 13px; }
.empty-state .title { color: var(--text); font-size: 18px; font-weight: 850; margin-bottom: 6px; }

.loading {
  color: var(--hint);
  font-size: 14px;
  font-weight: 700;
  padding: 32px 16px;
  text-align: center;
}

.invite-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: linear-gradient(135deg, rgba(15, 107, 91, 0.98), rgba(17, 92, 129, 0.98));
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 32px rgba(15, 107, 91, 0.2);
  color: #fff;
  cursor: pointer;
  margin: 2px 0 14px;
  padding: 16px;
  user-select: none;
}

.invite-card:active { transform: scale(0.99); }

.invite-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 15px;
  flex-shrink: 0;
  font-size: 25px;
}

.invite-text { flex: 1; min-width: 0; }
.invite-title { font-size: 15px; font-weight: 850; }
.invite-sub { color: rgba(255, 255, 255, 0.78); font-size: 12px; margin-top: 3px; }
.invite-arrow { color: #fff; flex-shrink: 0; font-size: 22px; font-weight: 850; }

.stats-card {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 20px rgba(23, 32, 27, 0.06);
  margin-bottom: 15px;
  padding: 17px 8px;
}

.stat { flex: 1; text-align: center; }
.stat-num { color: var(--accent-fill); font-family: "Bricolage Grotesque", "Inter", sans-serif; font-size: 30px; font-weight: 800; line-height: 1; }
.stat-label { color: var(--hint); font-size: 10px; font-weight: 850; letter-spacing: 0.08em; margin-top: 5px; text-transform: uppercase; }
.stat-divider { width: 1px; background: var(--line); margin: 3px 0; }

.currency-modal-overlay,
.ios-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  justify-content: center;
  padding: 18px;
  background: rgba(23, 32, 27, 0.48);
  animation: fade-in 0.18s ease;
}

.currency-modal-overlay { align-items: center; }

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

.currency-modal {
  width: 100%;
  max-width: 370px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  padding: 20px;
}

.currency-modal h3 {
  color: var(--text);
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: 19px;
  margin-bottom: 12px;
}

.currency-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  cursor: pointer;
  padding: 13px 12px;
  transition: background 0.12s ease;
}

.currency-option:hover,
.currency-option.selected { background: var(--accent-soft); }

.currency-option.selected::after {
  content: "✓";
  color: var(--accent-fill);
  font-weight: 900;
}

.currency-flag { font-size: 22px; }
.currency-name { flex: 1; font-weight: 850; }
.currency-code { color: var(--hint); font-size: 13px; font-weight: 750; }

.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 16px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(23, 32, 27, 0.08);
  animation: slide-in 0.25s ease;
}

.install-banner[hidden] { display: none; }

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

.install-banner-icon img { display: block; width: 40px; height: 40px; border-radius: 10px; }
.install-banner-text { flex: 1; min-width: 0; }
.install-banner-title { color: var(--text); font-size: 14px; font-weight: 850; }
.install-banner-sub { color: var(--hint); font-size: 12px; margin-top: 2px; }

.install-banner-btn {
  background: var(--accent-fill);
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 9px 13px;
}

.install-banner-x {
  background: none;
  border: 0;
  color: var(--hint);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 2px 6px 5px;
}

.ios-install-overlay { align-items: flex-end; z-index: 2000; }

.ios-install-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.22);
  padding: 20px 22px 24px;
}

.ios-install-sheet h3 { color: var(--text); font-size: 18px; margin-bottom: 10px; }

.ios-install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.ios-install-step-num {
  width: 25px;
  height: 25px;
  background: var(--accent-fill);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 850;
}

.ios-install-step-text { color: var(--text-soft); font-size: 14px; line-height: 1.5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: max-content;
  max-width: min(84vw, 430px);
  background: rgba(23, 32, 27, 0.94);
  border-radius: 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 360px) {
  .topbar { padding-left: 13px; padding-right: 13px; }
  .tabs { margin-left: 13px; margin-right: 13px; }
  .content { padding-left: 13px; padding-right: 13px; }
  .grid { gap: 8px; }
  .country-card { padding: 14px; }
  .row { padding-left: 15px; padding-right: 15px; }
  .row-title { font-size: 15px; }
  .currency-pill { padding-left: 11px; padding-right: 11px; }
}

@media (min-width: 720px) {
  .topbar,
  .tabs {
    width: min(100% - 32px, 560px);
    margin-left: auto;
    margin-right: auto;
  }

  .topbar { padding-left: 0; padding-right: 0; }
}
