/* Mediawide partner portal. Tokens are www.mediawide.com's (mw-hub-ui.css): Inter, blue #0B6BDE,
   navy #0F172A, orange #FFA108, tint #EAF2FD, line #E5E7EB. */
:root {
  --mw-blue: #0B6BDE;
  --mw-blue-dark: #0957B5;
  --mw-tint: #EAF2FD;
  --mw-dark: #0F172A;
  --mw-accent: #FFA108;
  --mw-line: #E5E7EB;
  --mw-text: #1E293B;
  --mw-muted: #64748B;
  --mw-bg: #F8FAFC;
  --mw-card: #FFFFFF;
  --mw-radius: 14px;
  --mw-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --mw-ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mw-text);
  background: var(--mw-bg);
}
a { color: var(--mw-blue); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: #fff; padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--mw-line); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--mw-dark); }
.brand img { height: 40px; width: auto; }
.brand span { font-size: 14px; font-weight: 600; color: var(--mw-muted); padding-left: 14px; border-left: 1px solid var(--mw-line); }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--mw-dark); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--mw-blue); }
.site-nav .who { color: var(--mw-muted); font-weight: 400; font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--mw-ease), color .2s var(--mw-ease), border-color .2s var(--mw-ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--mw-blue); color: #fff; }
.btn-primary:hover { background: var(--mw-blue-dark); }
.btn-accent { background: var(--mw-accent); color: var(--mw-dark); }
.btn-accent:hover { background: #F09300; }
.btn-ghost { background: transparent; color: var(--mw-blue); border-color: var(--mw-blue); }
.btn-ghost:hover { background: var(--mw-tint); }
.btn-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-light:hover { border-color: #fff; }
.btn-sm { padding: 10px 16px; font-size: 14px; }

/* Hero */
.hero { background: var(--mw-dark); color: #fff; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -160px; top: -200px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 107, 222, .55), rgba(11, 107, 222, 0) 70%); pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 64px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mw-accent); margin: 0 0 14px; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 18px; max-width: 760px; }
.hero p.lead { font-size: 18px; color: #CBD5E1; max-width: 700px; margin: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.crumbs { font-size: 14px; margin: 0 0 18px; color: #94A3B8; }
.crumbs a { color: #CBD5E1; text-decoration: none; }
.crumbs a:hover { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Access card (landing) */
.access-card { background: #fff; color: var(--mw-text); border-radius: var(--mw-radius); padding: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.access-card h2 { font-size: 22px; margin: 0 0 8px; color: var(--mw-dark); }
.access-card p { margin: 0 0 16px; font-size: 15px; color: var(--mw-muted); }
.access-card .domains { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.access-card .domains li { background: var(--mw-tint); color: var(--mw-blue-dark); font-weight: 600; font-size: 14px; padding: 5px 12px; border-radius: 999px; }
.access-card .btn { width: 100%; }
.access-card .fine { font-size: 13px; margin: 14px 0 0; }
/* Landing page states, set by the Worker: out (no session), in (allowed), pending (signed in, awaiting approval). */
[data-session="in"] .when-out, [data-session="pending"] .when-out,
[data-session="out"] .when-in, [data-session="pending"] .when-in,
[data-session="out"] .when-pending, [data-session="in"] .when-pending,
[data-session="out"] .when-signed { display: none !important; }

/* Sections */
main { display: block; }
.section { padding: 64px 0; }
.section h2.title { font-size: 28px; letter-spacing: -.01em; color: var(--mw-dark); margin: 0 0 8px; }
.section p.sub { color: var(--mw-muted); margin: 0 0 32px; max-width: 720px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card {
  background: var(--mw-card); border: 1px solid var(--mw-line); border-radius: var(--mw-radius); padding: 28px;
  display: flex; flex-direction: column; box-shadow: var(--mw-shadow); text-decoration: none; color: inherit;
  transition: transform .25s var(--mw-ease), border-color .25s var(--mw-ease);
}
a.card:hover { transform: translateY(-3px); border-color: var(--mw-blue); }
.card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--mw-tint); display: grid; place-items: center; margin-bottom: 18px; }
.card .icon svg { width: 24px; height: 24px; }
.card .kicker { font-size: 13px; font-weight: 600; color: var(--mw-blue); margin: 0 0 4px; }
.card h3 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; color: var(--mw-dark); }
.card p { margin: 0 0 20px; color: var(--mw-muted); font-size: 15px; flex: 1; }
.card .more { font-weight: 600; color: var(--mw-blue); display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.card .more small { color: var(--mw-muted); font-weight: 500; font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); padding: 24px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mw-blue); color: #fff; font-weight: 700; margin-bottom: 12px; }
.steps strong { display: block; color: var(--mw-dark); margin-bottom: 4px; }
.steps span { color: var(--mw-muted); font-size: 15px; }

/* Document list */
.docs { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.doc {
  background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); padding: 24px;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; align-items: start; box-shadow: var(--mw-shadow);
}
.badge { width: 56px; height: 64px; border-radius: 8px; display: grid; place-items: end center; padding-bottom: 9px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #fff; position: relative; }
.badge::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 14px 14px 0; border-color: transparent var(--mw-bg) rgba(255, 255, 255, .35) transparent; }
.badge-pdf { background: #DC3545; }
.badge-pptx { background: #E8590C; }
.badge-docx { background: var(--mw-blue); }
.badge-zip { background: var(--mw-dark); }
.doc h3 { font-size: 18px; margin: 0 0 4px; color: var(--mw-dark); }
.doc .audience { display: inline-block; font-size: 13px; font-weight: 600; color: var(--mw-blue-dark); background: var(--mw-tint); padding: 3px 10px; border-radius: 999px; margin: 0 0 10px; }
.doc p { margin: 0 0 8px; color: var(--mw-text); font-size: 15px; }
.doc .meta { font-size: 13px; color: var(--mw-muted); margin: 0; word-break: break-word; }
.doc .actions { display: flex; flex-direction: column; gap: 8px; }

.others { display: flex; flex-wrap: wrap; gap: 12px; }

/* Message pages */
.message { padding: 96px 0; text-align: center; }
.message h1 { font-size: 34px; color: var(--mw-dark); margin: 0 0 12px; }
.message p { color: var(--mw-muted); max-width: 560px; margin: 0 auto 28px; }

/* Footer */
.site-footer { background: var(--mw-dark); color: #94A3B8; font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-top: 36px; padding-bottom: 36px; }
.site-footer img { height: 34px; width: auto; }
.site-footer a { color: #CBD5E1; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0; }

:focus-visible { outline: 3px solid var(--mw-accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .cards, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .brand img { height: 34px; }
  .site-nav { gap: 14px; font-size: 14px; }
  .site-nav .who, .site-nav .nav-sections { display: none; }
  .hero .wrap { padding-top: 44px; padding-bottom: 44px; }
  .section { padding: 44px 0; }
  .doc { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px; }
  .badge { width: 44px; height: 52px; font-size: 10px; }
  .doc .actions { grid-column: 1 / -1; flex-direction: row; }
  .doc .actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.section.section-tight { padding-top: 0; }
.nav-sections { display: contents; }
.card p.kicker { flex: none; }
.others .btn { white-space: normal; text-align: left; line-height: 1.3; }

.empty { background: #fff; border: 1px dashed #CBD5E1; border-radius: var(--mw-radius); padding: 40px 28px; text-align: center; }
.empty .icon { width: 56px; height: 56px; border-radius: 14px; background: var(--mw-tint); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .icon svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; color: var(--mw-dark); font-size: 20px; }
.empty p { margin: 0 auto; color: var(--mw-muted); max-width: 520px; }

/* Admin */
.admin .hero .wrap { padding-top: 40px; padding-bottom: 40px; }
.admin .hero h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.admin .section { padding: 40px 0; }
.admin .section + .section { padding-top: 0; }
.admin h2.title { font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat { background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); padding: 20px; }
.stat h3 { margin: 0 0 12px; font-size: 16px; color: var(--mw-dark); }
.stat dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 14px; }
.stat dt { color: var(--mw-muted); }
.stat dd { margin: 0; font-weight: 700; color: var(--mw-dark); text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--mw-line); vertical-align: top; }
table.data th { background: #F1F5F9; color: var(--mw-muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.nowrap { white-space: nowrap; }
table.data .empty-row { color: var(--mw-muted); text-align: center; padding: 24px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--mw-tint); color: var(--mw-blue-dark); white-space: nowrap; }
.pill-download, .pill-zip { background: #DCFCE7; color: #166534; }
.pill-signin { background: #EDE9FE; color: #5B21B6; }
.pill-denied, .pill-request { background: #FEF3C7; color: #92400E; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters label, .form-row label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--mw-muted); }
.filters .check { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--mw-text); padding-bottom: 10px; }
input[type=text], input[type=email], select {
  font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid #CBD5E1; border-radius: 10px; background: #fff; color: var(--mw-text); min-width: 180px;
}
input:focus, select:focus { outline: 2px solid var(--mw-blue); outline-offset: 1px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: #fff; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); padding: 18px; margin-bottom: 16px; }
.inline-form { display: inline; margin: 0; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--mw-blue); cursor: pointer; }
.btn-link.danger { color: #B91C1C; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.notice { background: #DCFCE7; color: #166534; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.notice.error { background: #FEE2E2; color: #991B1B; }
.muted { color: var(--mw-muted); }
.message .btn-row { justify-content: center; }
main { min-height: calc(100vh - 73px - 106px); }
