/* PubExa shared stylesheet — derived from v2 design tokens. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f5f6f8;
  --surface:  #ffffff;
  --border:   rgba(0,0,0,.08);
  --text:     #1f1f1f;
  --text-2:   #5f6368;
  --text-3:   #9aa0a6;
  --blue:     #1a73e8;
  --blue-g:   #e8f0fe;
  --green:    #188038;
  --green-g:  #e6f4ea;
  --orange:   #e37400;
  --orange-g: #fef7e0;
  --red:      #d93025;
  --red-g:    #fce8e6;
  --purple:   #7c4dff;
  --purple-g: #f3efff;
  --mono:     'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans:     'Nunito', 'Calibri', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}

html, body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.center {
  max-width: 420px;
  margin: 80px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 { font-size: 28px; margin-bottom: 8px; font-style: italic; }
h2 { font-size: 20px; margin: 24px 0 12px; }
h3 { font-size: 16px; margin: 16px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }

.subtitle { color: var(--text-2); margin-bottom: 24px; font-size: 15px; }

.muted { color: var(--text-2); }

label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 14px;
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="email"], input[type="password"], input[type="text"], input[type="url"],
textarea, select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .04s;
}
button:active, .btn:active { transform: translateY(1px); }
button[disabled], .btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1765cc; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f2f3f5; }

.btn-google {
  background: #fff;
  color: var(--text);
  border: 1px solid #dadce0;
  width: 100%;
  justify-content: center;
}
.btn-google:hover { background: #f8f9fa; border-color: #bdc1c6; }

.btn-block { width: 100%; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error-bar {
  background: var(--red-g);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}
.error-bar.show { display: block; }

.info-bar {
  background: var(--blue-g);
  color: var(--blue);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}
.info-bar.show { display: block; }

.success-bar {
  background: var(--green-g);
  color: var(--green);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}
.success-bar.show { display: block; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .brand {
  font-weight: 800;
  font-style: italic;
  font-size: 20px;
}
.topbar .brand .pill {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  font-style: normal;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.topbar .right { display: flex; align-items: center; gap: 16px; }
.topbar .who { color: var(--text-2); font-size: 13px; }

.nav a {
  margin-right: 18px;
  color: var(--text-2);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.nav a.active, .nav a:hover {
  color: var(--text);
  border-bottom-color: var(--blue);
  text-decoration: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.tag-active    { background: var(--green-g);  color: var(--green);  border-color: rgba(24,128,56,.2); }
.tag-pending   { background: var(--orange-g); color: var(--orange); border-color: rgba(227,116,0,.2); }
.tag-approved  { background: var(--blue-g);   color: var(--blue);   border-color: rgba(26,115,232,.2); }
.tag-rejected  { background: var(--red-g);    color: var(--red);    border-color: rgba(217,48,37,.2); }

.tiny { font-size: 12px; color: var(--text-3); }


/* ── Marketing homepage (pub / adv) ───────────────────────────────────── */
.mkt { --mkt-primary: #1A56C4; --mkt-primary-g: rgba(26,86,196,.08); }
.mkt[data-palette="adv"] { --mkt-primary: #1E9E4F; --mkt-primary-g: rgba(30,158,79,.08); }
.mkt .mkt-topbar { display:flex; align-items:center; justify-content:space-between; padding:18px 28px; border-bottom:1px solid var(--border); background:#fff; }
.mkt .mkt-topbar .logo { font-size:22px; }
.mkt .mkt-topbar .nav { display:flex; gap:14px; align-items:center; }
.mkt .mkt-topbar .nav a { color: var(--text-2); text-decoration:none; font-weight:600; font-size:14px; padding:8px 14px; border-radius:8px; }
.mkt .mkt-topbar .nav a:hover { color: var(--text-1); background: var(--mkt-primary-g); }
.mkt .mkt-topbar .nav a.cta { background: var(--mkt-primary); color:#fff; }
.mkt .mkt-topbar .nav a.cta:hover { filter: brightness(.95); }
.mkt .mkt-hero { padding:80px 28px 60px; text-align:center; background: linear-gradient(180deg,#fff 0%, var(--mkt-primary-g) 100%); }
.mkt .mkt-hero h1 { font-size: clamp(28px, 5vw, 44px); line-height:1.15; margin:0 0 12px; color: var(--text-1); font-weight:800; letter-spacing:-.5px; }
.mkt .mkt-hero p.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--text-2); max-width: 640px; margin: 0 auto 28px; line-height:1.55; }
.mkt .mkt-hero .cta-primary { display:inline-block; background: var(--mkt-primary); color:#fff; text-decoration:none; padding:14px 28px; border-radius:10px; font-weight:700; font-size:16px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.mkt .mkt-hero .cta-primary:hover { filter: brightness(.95); }
.mkt .mkt-features { max-width: 1040px; margin: 0 auto; padding: 60px 28px; display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.mkt .mkt-feature { background:#fff; border:1px solid var(--border); border-radius:12px; padding:28px 22px; }
.mkt .mkt-feature h3 { font-size:18px; margin:0 0 8px; color: var(--text-1); font-weight:700; }
.mkt .mkt-feature p { margin:0; color: var(--text-2); line-height:1.55; font-size:14.5px; }
.mkt .mkt-footer { border-top:1px solid var(--border); padding: 24px 28px; color: var(--text-3); font-size:13px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.mkt .mkt-footer a { color: var(--text-2); text-decoration:none; margin-left:14px; }
.mkt .mkt-footer a:hover { text-decoration:underline; }
@media (max-width: 640px) {
    .mkt .mkt-topbar { padding: 14px 18px; }
    .mkt .mkt-hero   { padding: 56px 18px 44px; }
    .mkt .mkt-features { padding: 44px 18px; }
    .mkt .mkt-footer { padding: 20px 18px; }
}

/* ── Password eye toggle (applied at runtime by common/api.js) ─────────── */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] { padding-right: 40px; position: relative; z-index: 1; }
.pw-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; /* eye must sit above the input so a real click hits the button, not the field */
    background: transparent; border: 0; padding: 6px; cursor: pointer;
    color: #6b7280; line-height: 0; border-radius: 6px;
}
.pw-eye:hover { color: #111; background: rgba(0,0,0,.04); }
.pw-eye:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
/* Keep the eye perfectly still on press: the global button:active{transform:translateY(1px)} (styles.css ~:111)
   otherwise shifts the button off the stationary cursor mid-press, so pointerup lands on the input and no
   click fires. .pw-eye:active (0,2,0) out-specifies button:active (0,1,1), so no !important needed. */
.pw-eye:active { transform: translateY(-50%); }
.pw-eye svg { width: 18px; height: 18px; display: block; }
/* The inline SVG (and its path/line/circle children) must not swallow the click — let pointer
   events fall through to the .pw-eye button so its handler fires on a real mouse click. */
.pw-eye svg, .pw-eye svg * { pointer-events: none; }

/* ── Canonical PubExa brand on auth / onboarding pages ──────────────── */
.auth-brand {
    display: inline-block;
    font-size: clamp(28px, 5vw, 32px);
    margin: 0 auto 20px;
    text-decoration: none;
    text-align: center;
}
main.center > .auth-brand { display: block; }

/* ── Shared PubExa logo: single source of truth (every page links this) ── */
.px-logo { text-decoration: none; display: inline-flex; align-items: center; }
.px-logo:hover { opacity: .9; }
.px-appbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--border, #e5e7eb); }

/* PubExa image logo — single source of truth (replaces text wordmark) */
.px-logo-img { height: 30px; width: auto; display: block; }
.auth-brand .px-logo-img { margin: 0 auto; }
@media (max-width: 600px) { .px-logo-img { height: 24px; } }

/* ── Advertiser landing split-screen (embedded signup) ─────────────────── */
.adv-split { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "intro form" "benefits form"; min-height: 100vh; }
.adv-split .adv-intro    { grid-area: intro; background: var(--mkt-primary); color: #fff; padding: 72px 56px 20px; }
.adv-split .adv-intro h1 { color: #fff; font-style: normal; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.5px; margin: 0 0 16px; }
.adv-split .adv-intro .lead { color: rgba(255,255,255,.92); font-size: clamp(16px, 2vw, 18px); line-height: 1.55; margin: 0; max-width: 520px; }
.adv-split .adv-benefits { grid-area: benefits; background: var(--mkt-primary); color: #fff; padding: 8px 56px 72px; display: flex; align-items: flex-start; }
.adv-split .adv-benefits-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.adv-split .adv-benefits-list li { position: relative; padding-left: 30px; line-height: 1.5; }
.adv-split .adv-benefits-list li::before { content: '\2713'; position: absolute; left: 0; top: 0; font-weight: 800; color: #fff; }
.adv-split .adv-benefits-list strong { display: block; font-weight: 700; font-size: 15.5px; margin-bottom: 2px; color: #fff; }
.adv-split .adv-benefits-list span { color: rgba(255,255,255,.85); font-size: 14px; }
.adv-split .adv-form { grid-area: form; display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.adv-split .adv-form .center { margin: 0; width: 100%; max-width: 420px; }
@media (max-width: 860px) {
  .adv-split { grid-template-columns: 1fr; grid-template-areas: "intro" "form" "benefits"; min-height: 0; }
  .adv-split .adv-intro    { padding: 40px 22px 18px; text-align: center; }
  .adv-split .adv-intro .lead { margin: 0 auto; }
  .adv-split .adv-form     { padding: 28px 18px; }
  .adv-split .adv-benefits { padding: 24px 22px 40px; }
}

/* ── Refined auth look — SCOPED to the signup screens only (main.center.auth-fine).
   Lighter weights + more whitespace + softer borders. Affects nothing else in the app. ── */
main.center.auth-fine {
  max-width: 440px;
  margin: 96px auto;
  padding: 44px 40px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.05);
}
main.center.auth-fine h1 {
  font-weight: 500; font-style: normal; font-size: 26px;
  letter-spacing: -.2px; margin-bottom: 10px; color: var(--text);
}
main.center.auth-fine .subtitle {
  font-weight: 300; font-size: 15px; color: var(--text-2);
  margin-bottom: 30px; line-height: 1.6;
}
main.center.auth-fine label {
  font-weight: 400; color: var(--text-2); margin-top: 18px;
}
main.center.auth-fine input[type="email"],
main.center.auth-fine input[type="password"],
main.center.auth-fine input[type="text"],
main.center.auth-fine input[type="url"] {
  padding: 12px 14px; font-size: 14.5px; line-height: 1.6;
  border-color: rgba(0,0,0,.10);
}
main.center.auth-fine .consent { color: var(--text-2); line-height: 1.55; }
main.center.auth-fine .btn-primary { font-weight: 500; padding: 12px 16px; }
main.center.auth-fine .divider { color: var(--text-3); margin: 24px 0 16px; }
main.center.auth-fine .subtitle + form,
main.center.auth-fine form { margin-top: 4px; }
