/* ==========================================================================
   3 Countries Meeting — market.css
   A flag-themed design system for Nigeria · Ghana · South Africa.
   Theme tokens (--brand, --accent, --cta…) are injected per request by
   layouts/app.blade.php from config/markets.php.
   ========================================================================== */

:root {
    --brand: #008751;
    --brand-dark: #075e3c;
    --brand-soft: #e6f5ee;
    --accent: #f0b429;
    --cta: #f0b429;
    --cta-ink: #1a1205;
    --page: #f7faf8;
    --ink: #0d1f18;

    --card: #ffffff;
    --muted: #63756e;
    --line: #e6ebe8;
    --radius: 20px;
    --radius-sm: 13px;
    --shadow: 0 2px 4px rgba(13, 31, 24, .04), 0 12px 28px -14px rgba(13, 31, 24, .16);
    --shadow-lg: 0 4px 8px rgba(13, 31, 24, .05), 0 26px 50px -22px rgba(13, 31, 24, .28);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hand: 'Caveat', 'Segoe Script', cursive;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.mk {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 72px; /* room for the mobile bottom bar */
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ── Top navigation ─────────────────────────────────────────────── */
.mk-nav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.mk-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.mk-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; }
.mk-logo-mark {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
    color: #fff; font-weight: 900; font-size: 15px; position: relative; overflow: hidden;
    background: var(--brand);
    box-shadow: 0 6px 16px -8px var(--brand);
}
/* thin flag stripe on the logo mark */
.mk-logo-mark::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: linear-gradient(90deg, var(--brand) 33%, var(--accent) 33% 66%, var(--brand-dark) 66%);
}
.mk-nav-links { display: none; gap: 2px; }
.mk-nav-links a {
    padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted);
    transition: .16s;
}
.mk-nav-links a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.mk-nav-links a.on { background: var(--brand); color: #fff; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 12px 20px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--card); color: var(--ink);
    font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
    transition: transform .14s, box-shadow .14s, background .14s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-cta {
    background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
    background-size: 220% 100%; border-color: transparent; color: var(--cta-ink);
    box-shadow: 0 14px 30px -12px var(--accent);
    animation: mkSweep 3.4s linear infinite;
}
@keyframes mkSweep { to { background-position: 220% 50%; } }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-dark); font-weight: 600; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }
.card-hover { transition: transform .16s, box-shadow .16s, border-color .16s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 26%, var(--line)); }

/* Group card */
.gcard { position: relative; display: block; overflow: hidden; }
.gcard::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 5px;
    background: var(--gc, var(--brand));
}
.gcard-inner { padding-left: 12px; }
.gcard-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.pot-amount { font-size: 26px; font-weight: 900; letter-spacing: -.03em; color: var(--brand-dark); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
    position: relative; overflow: hidden; border-radius: 26px; color: #fff;
    padding: 30px 24px 26px; background: var(--brand);
    background-image: radial-gradient(1200px 320px at 10% -20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
                      linear-gradient(160deg, var(--brand), var(--brand-dark));
    box-shadow: var(--shadow-lg);
}
.hero::after {
    content: ''; position: absolute; right: -40px; top: -40px; width: 190px; height: 190px;
    border-radius: 50%; background: color-mix(in srgb, var(--accent) 34%, transparent);
    filter: blur(6px);
}
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 6vw, 42px); line-height: 1.05; letter-spacing: -.03em; font-weight: 900; }
.hero p { margin: 0 0 18px; font-size: 16px; opacity: .95; max-width: 46ch; }
.hero .hand { font-family: var(--hand); font-size: 22px; color: var(--accent); display: block; margin-bottom: 2px; }

/* ── Pills / chips / badges ─────────────────────────────────────── */
.pillbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.pillbar::-webkit-scrollbar { display: none; }
.pill {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card); font-size: 13.5px; font-weight: 700; color: var(--muted);
    min-height: 40px; transition: .15s;
}
.pill:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--brand-dark); }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill .count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.pill.on .count { background: rgba(255,255,255,.22); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 8px 13px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--brand) 34%, var(--line));
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 13.5px;
    cursor: pointer; font-family: inherit; transition: .14s;
}
.chip:hover, .chip.on { background: var(--brand); border-style: solid; border-color: var(--brand); color: #fff; }

.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
    background: var(--brand-soft); color: var(--brand-dark);
}
.badge-gold { background: color-mix(in srgb, var(--accent) 26%, #fff); color: #7a5600; }
.badge-live { background: #e11d48; color: #fff; }
.badge-live i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: mkFlash 1s steps(2, start) infinite; }
@keyframes mkFlash { 50% { opacity: .35; } }
.badge-cert { background: #e0edff; color: #1d4ed8; }

/* Country colour-code tag — one per market */
.ccode {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 6px;
    border-radius: 999px; font-size: 10.5px; font-weight: 900; letter-spacing: .06em;
    text-transform: uppercase; color: #fff; background: var(--cc, var(--brand));
}
.ccode span.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.85); }

/* ── Avatar ─────────────────────────────────────────────────────── */
.avatar {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
    color: #fff; font-weight: 900; font-size: 15px; flex: none;
    background: var(--av, var(--brand));
}
.avatar-lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ── Stats ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { gap: 16px; }
}
@media (min-width: 980px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .mk-nav-links { display: flex; }
    .gcard-large { grid-column: span 2; }
}
.stat { position: relative; overflow: hidden; }
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 30px; font-weight: 900; letter-spacing: -.03em; margin-top: 4px; }
.stat .v small { font-size: 15px; font-weight: 800; color: var(--muted); margin-left: 2px; }
.stat .em { position: absolute; right: 14px; top: 12px; font-size: 20px; opacity: .9; }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Progress */
.progress { height: 9px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress.gold > i { background: var(--accent); }

/* ── Ticker (live activity) ─────────────────────────────────────── */
.ticker { overflow: hidden; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.ticker-track { display: flex; gap: 34px; width: max-content; padding: 10px 16px; animation: mkTicker 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes mkTicker { to { transform: translateX(-50%); } }
.ticker-item { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.ticker-item b { color: var(--ink); font-weight: 700; }

/* ── Stickers (the human touch) ─────────────────────────────────── */
.sticker {
    display: inline-block; padding: 5px 12px; border-radius: 12px; font-weight: 900; font-size: 13px;
    background: var(--accent); color: var(--cta-ink); transform: rotate(-2.5deg);
    box-shadow: 0 8px 18px -10px rgba(0,0,0,.4);
}
.sticker.right { transform: rotate(2.5deg); }
.squiggle { display: block; width: 118px; height: 10px; margin-top: 2px; color: var(--accent); }
.hand { font-family: var(--hand); font-size: 21px; color: var(--brand-dark); }

/* ── Money block ────────────────────────────────────────────────── */
.money { display: inline-flex; align-items: baseline; gap: 2px; }
.money .sym { font-size: .62em; font-weight: 900; opacity: .8; margin-right: 1px; }
.money .suf { font-size: .55em; font-weight: 900; color: var(--brand); }

/* ── Bars / nav bottom ──────────────────────────────────────────── */
.bnav {
    position: fixed; inset: auto 0 0 0; z-index: 45; display: flex;
    background: var(--card); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -12px rgba(0,0,0,.25);
}
.bnav a, .bnav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; border: 0; background: none; font: inherit; color: var(--muted);
    font-size: 10.5px; font-weight: 700; cursor: pointer;
}
.bnav a.on, .bnav a:hover { color: var(--brand-dark); }
.bnav .ic { font-size: 19px; }
@media (min-width: 768px) { .bnav { display: none; } body.mk { padding-bottom: 0; } }

/* ── Footer ─────────────────────────────────────────────────────── */
.mk-foot { margin-top: 40px; border-top: 1px solid var(--line); background: var(--card); }
.mk-foot-inner { padding: 22px 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.flagline { height: 4px; display: flex; }
.flagline i { flex: 1; }

/* ── Country switcher ───────────────────────────────────────────── */
.cswitch { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--line); }
.cswitch a { padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.cswitch a.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(0,0,0,.25); }

/* ── Forms ──────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.input, select.input, textarea.input {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px;
    background: var(--card); font: inherit; font-size: 15px; color: var(--ink); min-height: 48px;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.err { color: #b91c1c; font-size: 12.5px; margin-top: 5px; }

/* ── Flash ──────────────────────────────────────────────────────── */
.flash { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; display: flex; gap: 9px; align-items: center; }
.flash-ok { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line)); }
.flash-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Reveal animation ───────────────────────────────────────────── */
.rise { animation: mkRise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes mkRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.d1 { animation-delay: .06s } .d2 { animation-delay: .12s } .d3 { animation-delay: .18s } .d4 { animation-delay: .24s }

@media (prefers-reduced-motion: reduce) {
    .btn-cta, .ticker-track, .badge-live i, .rise { animation: none !important; }
}

.mk-logo-mark .spin { transform-origin: 20px 20px; animation: mkSpin 6s linear infinite; }
.mk-logo-mark .pulse { transform-origin: 20px 20px; animation: mkPulse 2.4s ease-in-out infinite; }
@keyframes mkSpin { to { transform: rotate(360deg); } }
@keyframes mkPulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .mk-logo-mark .spin, .mk-logo-mark .pulse { animation: none; }
}
.hairline { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.dotted { border-top: 2px dotted var(--line); margin: 16px 0; border-bottom: 0; }
.kbd { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); }
.scroll-x { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.scroll-x > * { scroll-snap-align: start; flex: 0 0 78%; max-width: 330px; }
@media (min-width: 760px) { .scroll-x > * { flex: 0 0 31%; } }
