/* =========================================================================
   P2P.[foundation] — Job Board Design System
   Light, clean, high-contrast. Built on the Foundation brand palette.
     Foundation Primary   #493FEE   (indigo)
     Foundation Secondary #958FEC   (periwinkle)
     Foundation Black      #131313
     Foundation White      #F5F5F5
   ========================================================================= */

:root {
  /* Brand */
  --primary: #493FEE;
  --primary-bright: #5B4EF2;
  --primary-glow: rgba(73, 63, 238, 0.30);
  --secondary: #958FEC;

  /* Surfaces & text */
  --paper: #F5F5F5;
  --card: #FFFFFF;
  --ink: #131313;
  --text: #131313;
  --text-dim: #52525E;
  --text-faint: #8A8A96;

  --line: rgba(19, 19, 19, 0.10);
  --line-strong: rgba(19, 19, 19, 0.16);

  /* Role ladder — deep → mid → periwinkle indigo (seniority) */
  --violet: #3B30D9;   /* Country Lead */
  --emerald: #493FEE;  /* Circle Admin + default accent */
  --emerald-bright: #5B4EF2;
  --emerald-glow: rgba(73, 63, 238, 0.30);
  --sky: #8A83E8;      /* Ambassador */

  /* Pay / earnings highlight (periwinkle tint + indigo text) */
  --amber: #958FEC;
  --amber-bright: #493FEE;

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;

  --shadow: 0 24px 60px -30px rgba(19, 19, 19, 0.28);
  --shadow-sm: 0 10px 30px -18px rgba(19, 19, 19, 0.22);

  --maxw: 1160px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Per-role accent (overridden on role pages) */
  --accent: var(--primary);
  --accent-bright: var(--primary-bright);
  --accent-glow: var(--primary-glow);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ------------------------------------------------------------------ layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--accent);
}

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); }
.h-xl { font-size: clamp(38px, 6vw, 66px); }
.h-lg { font-size: clamp(30px, 4.4vw, 46px); }
.h-md { font-size: clamp(22px, 2.6vw, 30px); }

.lead { font-size: clamp(17px, 2vw, 20px); color: var(--text-dim); max-width: 640px; }

.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(245, 245, 245, 0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; }

/* Brand lockup — interlocking-links icon + P2P.[foundation] wordmark */
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand-ico { height: 25px; display: flex; flex: 0 0 auto; }
.brand-ico svg { height: 100%; width: auto; display: block; }
@media (max-width: 420px) { .brand-ico { height: 20px; } }
/* The visible logo is the SVG lockup; keep the text wordmark for screen readers. */
.brand-word { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.nav-links { display: flex; align-items: center; gap: 28px; }
/* :not(.btn) so button text colour (white on indigo) isn't overridden here. */
.nav-links a:not(.btn) { font-size: 14.5px; color: var(--text-dim); font-weight: 550; transition: color .15s; }
.nav-links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-weight: 650; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #FFFFFF; box-shadow: 0 12px 30px -12px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 16px 40px -12px var(--accent-glow); transform: translateY(-1px); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ------------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 650; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text-dim);
}
.badge-live { color: var(--primary); background: rgba(73,63,238,0.08); border-color: rgba(73,63,238,0.28); }
.badge-soon { color: #6A63D4; background: rgba(149,143,236,0.12); border-color: rgba(149,143,236,0.45); }
.badge-pay  { color: var(--primary); background: rgba(149,143,236,0.14); border-color: rgba(149,143,236,0.45); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(73,63,238,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(73,63,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(73,63,238,0); }
}

/* --------------------------------------------------------------------- hero */
.hero { position: relative; padding: 84px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(55% 60% at 12% 0%, rgba(73,63,238,0.10), transparent 60%),
    radial-gradient(50% 55% at 92% 12%, rgba(149,143,236,0.20), transparent 60%),
    radial-gradient(45% 45% at 60% 100%, rgba(73,63,238,0.05), transparent 60%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.7;
  background-image:
    linear-gradient(rgba(19,19,19,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19,19,19,0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 40%, transparent 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: 22px; }
.hero .grad { background: linear-gradient(120deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.hero-note { margin-top: 20px; font-size: 14px; color: var(--text-faint); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow);
}
.hero-card h4 { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 18px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-num { font-size: 30px; font-weight: 850; letter-spacing: -0.03em; }
.stat-num.g { color: var(--primary); }
.stat-num.a { color: var(--secondary); }
.stat-num.v { color: var(--violet); }
.stat-lbl { font-size: 14px; color: var(--text-dim); text-align: right; }

/* --------------------------------------------------------------- stats strip */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-item { padding: 30px 20px; text-align: center; border-right: 1px solid var(--line); }
.strip-item:last-child { border-right: 0; }
.strip-item .n { font-size: 34px; font-weight: 850; letter-spacing: -0.03em; }
.strip-item .l { font-size: 13.5px; color: var(--text-faint); margin-top: 4px; }
@media (max-width: 720px) { .strip-grid { grid-template-columns: repeat(2, 1fr); } .strip-item:nth-child(2){border-right:0;} .strip-item:nth-child(1),.strip-item:nth-child(2){border-bottom:1px solid var(--line);} }

/* ---------------------------------------------------------------- role cards */
.roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
@media (max-width: 900px) { .roles-grid { grid-template-columns: 1fr; } }

.role-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .2s, box-shadow .2s;
}
.role-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--rc, var(--primary)), transparent);
}
.role-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--rc, var(--primary)) 40%, transparent); box-shadow: var(--shadow); }
.role-ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; margin-bottom: 20px;
  background: color-mix(in srgb, var(--rc, var(--primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc, var(--primary)) 30%, transparent);
}
.role-card h3 { font-size: 23px; margin-bottom: 6px; }
.role-tag { font-size: 13.5px; color: var(--rc, var(--primary)); font-weight: 650; margin-bottom: 16px; }
.role-card p { font-size: 15px; color: var(--text-dim); flex: 1; }
.role-pay { margin: 20px 0; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(149,143,236,0.12); border: 1px solid rgba(149,143,236,0.4); }
.role-pay .amt { font-size: 20px; font-weight: 800; color: var(--primary); }
.role-pay .sub { font-size: 13px; color: var(--text-dim); }
.role-card .btn { align-self: flex-start; }

/* ------------------------------------------------------------ country listing */
.tabs { display: inline-flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(19,19,19,0.04); border: 1px solid var(--line); margin: 0 auto 36px; }
.tab { display: inline-flex; align-items: center; padding: 9px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; border: 0; background: transparent; transition: all .15s; }
.tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-bright)); color: #FFFFFF; }

.country-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) { .country-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .country-grid { grid-template-columns: repeat(2, 1fr); } }

.country {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.country:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.country .flag { font-size: 26px; line-height: 1; }
.country .info { min-width: 0; }
.country .name { font-weight: 700; font-size: 15px; }
.country .status { font-size: 12px; margin-top: 2px; font-weight: 600; }
.country .status.live { color: var(--primary); }
.country .status.soon { color: #6A63D4; }
.hidden { display: none !important; }

/* -------------------------------------------------------------- how it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); }
.step .num { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: 0.1em; }
.step h4 { font-size: 17px; margin: 12px 0 8px; }
.step p { font-size: 14px; color: var(--text-dim); }

/* ------------------------------------------------------------------ CTA band */
.cta {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  padding: 56px 44px; text-align: center;
  background: linear-gradient(135deg, rgba(73,63,238,0.10), rgba(149,143,236,0.16));
  border: 1px solid rgba(73,63,238,0.20);
}
.cta h2 { margin-bottom: 14px; }
.cta .lead { margin: 0 auto 28px; }

/* ------------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 40px; background: var(--card); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer p { color: var(--text-faint); font-size: 14px; max-width: 320px; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--text-dim); padding: 5px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-base { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ====================================================================
   ROLE DETAIL PAGES
   ==================================================================== */
.role-hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.role-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 70% at 18% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
}
.crumb { font-size: 14px; color: var(--text-faint); margin-bottom: 22px; }
.crumb a:hover { color: var(--accent); }
.role-hero h1 { font-size: clamp(34px, 5vw, 54px); margin: 12px 0 18px; }
.role-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.role-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; padding-bottom: 40px; }
@media (max-width: 920px) { .role-layout { grid-template-columns: 1fr; } }

.prose h2 { font-size: 26px; margin: 42px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin: 26px 0 10px; color: var(--ink); }
.prose p { color: var(--text-dim); margin-bottom: 14px; font-size: 16px; }
.prose ul { list-style: none; margin: 6px 0 18px; }
.prose li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--text-dim); font-size: 16px; }
.prose li::before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px;
  border-radius: 2px; background: var(--accent); transform: rotate(45deg);
}
.prose strong { color: var(--ink); font-weight: 650; }
.prose .divider { height: 1px; background: var(--line); margin: 40px 0; border: 0; }

.callout {
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--card); padding: 24px 26px; margin: 24px 0; box-shadow: var(--shadow-sm);
}
.callout.earn { background: rgba(149,143,236,0.12); border-color: rgba(149,143,236,0.45); box-shadow: none; }
.callout h3 { margin-top: 0 !important; color: var(--primary); }

.apply-card {
  position: sticky; top: 90px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow);
}
.apply-card .pay-big { font-size: 34px; font-weight: 850; letter-spacing: -0.03em; color: var(--accent); }
.apply-card .pay-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 22px; }
.apply-card .fact { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.apply-card .fact:first-of-type { border-top: 0; }
.apply-card .fact .k { color: var(--text-faint); min-width: 104px; }
.apply-card .fact .v { color: var(--ink); font-weight: 600; }
.apply-card .btn { width: 100%; justify-content: center; margin-top: 22px; }

/* ====================================================================
   APPLY PAGE
   ==================================================================== */
.form-wrap { max-width: 680px; margin: 0 auto; }
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.field label .req { color: var(--primary); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  background: #FBFBFD; border: 1px solid var(--line-strong); color: var(--ink);
  font-family: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(73,63,238,0.15); background: #fff;
}
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .field-row.three { grid-template-columns: 1fr; } }
.field label .opt { color: var(--text-faint); font-weight: 500; }
.form-note { font-size: 13.5px; color: var(--text-faint); margin-top: 18px; text-align: center; }

/* -------------------------------------------------- accessibility & states */
/* Visible keyboard focus ring for every interactive element. Mouse users are
   unaffected (:focus-visible), keyboard users get a clear, on-brand outline. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
.country:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Inputs already show a border+ring on :focus; mirror it for focus-visible. */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(73,63,238,0.15);
}

/* Disabled buttons (e.g. the submit button while a request is in flight). */
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:hover,
.btn[disabled]:hover { transform: none; box-shadow: none; }

/* Honour reduced-motion: kill smooth scroll, pulsing, and hover motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- utilities */
.mt-0 { margin-top: 0; }
/* Reveal is a progressive enhancement: content is fully visible by default,
   and only starts hidden once JS confirms it can animate it back in. */
.js-anim .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js-anim .reveal.in { opacity: 1; transform: none; }
