/* PlusLink — platform UI.
   This styles the marketing site, dashboard and admin only. Public profile
   pages are theme-driven and deliberately share nothing with this file, so a
   customer's page never inherits our brand. */

/* Outfit, self-hosted (see static/fonts/README.md — hotlinking Google's CDN
   would send every visitor's IP to Google and contradict our privacy policy).
   One variable file covers 300–800, so weights cost nothing extra. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent:      #2E5BFF;   /* primary CTA */
  --accent-deep: #1F44D6;   /* hover / pressed */
  --accent-soft: #EAEFFF;   /* tinted surfaces, badges */
  --ink:         #12141C;   /* a blue-black, not a flat black */
  --ink-soft:    #5A6072;
  --bg:          #FBFCFD;
  --surface:     #F1F3F8;
  --line:        #E3E7EF;
  --danger:      #C22F1E;
  --radius:      12px;
  --maxw:        1080px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
/* Mark + wordmark. The mark carries the blue so the word stays plain ink and
   reads at any size. */
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-mark { width: 21px; height: 21px; color: var(--accent); flex: none; display: block; }
.logo-word {
  font-weight: 700; font-size: 20px; letter-spacing: -0.035em; color: var(--ink);
}
.site-header nav { margin-left: auto; display: flex; gap: 20px; align-items: center; }
/* :not(.btn) matters — without it this wins on specificity and repaints the
   header's call-to-action button's white label in muted grey. */
.site-header nav a:not(.btn) { text-decoration: none; font-size: 15px; color: var(--ink-soft); }
.site-header nav a:not(.btn):hover { color: var(--ink); }
.site-header nav .btn { padding: 9px 18px; font-size: 15px; }

/* --- buttons --- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: var(--radius);
  text-decoration: none; text-align: center;
}
.btn:hover { background: var(--accent-deep); }
.btn.secondary { background: var(--surface); color: var(--ink); }
.btn.secondary:hover { background: var(--line); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.block { display: block; width: 100%; }
.btn:disabled, .btn.soon {
  background: var(--surface); color: var(--ink-soft); cursor: default;
}
.btn:disabled:hover, .btn.soon:hover { background: var(--surface); }

/* --- forms --- */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=url], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}
.field { margin-bottom: 18px; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

/* --- cards & layout --- */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.stack > * + * { margin-top: 16px; }

.notice {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); font-size: 14px; margin-bottom: 18px;
}
.notice.error { background: #FDECE8; color: #8A2A16; }
.notice.ok    { background: #E8F5EC; color: #1D6034; }

/* --- dashboard --- */
.urlbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
}
.urlbar-link { flex: 1 1 240px; min-width: 0; }
.urlbar-label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-soft);
}
.urlbar-link a {
  font-weight: 600; font-size: 17px; text-decoration: none;
  overflow-wrap: anywhere;
}
.urlbar .btn { padding: 9px 16px; font-size: 14px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.tabs a {
  padding: 10px 14px; text-decoration: none; font-size: 15px;
  color: var(--ink-soft); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs a.upsell { margin-left: auto; color: var(--accent); font-weight: 600; }

/* --- add-a-link disclosures --- */
.adder { border-top: 1px solid var(--line); }
.adder:first-of-type { border-top: 0; }
.adder > summary {
  cursor: pointer; padding: 13px 2px; font-weight: 600; font-size: 15px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.adder > summary::-webkit-details-marker { display: none; }
.adder > summary::after { content: "+"; margin-left: auto; color: var(--ink-soft); font-size: 20px; }
.adder[open] > summary::after { content: "−"; }
.adder .ico { font-size: 17px; }
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 3px 7px; border-radius: 6px;
}

/* --- link list --- */
.linklist { list-style: none; margin: 0; padding: 0; }
.linkrow {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
}
.linkrow.off { opacity: 0.55; }
.linkrow-move { display: flex; flex-direction: column; gap: 2px; }
.linkrow-move button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  width: 26px; height: 22px; cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}
.linkrow-move button:disabled { opacity: 0.3; cursor: default; }
.linkrow-thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none;
}
.linkrow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.linkrow-main strong { font-size: 15px; }
.linkrow-sub { font-size: 13px; color: var(--ink-soft); }
.linkrow-url {
  font-size: 12px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.linkrow-actions { display: flex; gap: 6px; flex: none; }
.linkrow-actions .btn { padding: 7px 12px; font-size: 13px; }
.linkrow-actions .danger { color: #B3300F; }

.avatar-preview {
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: var(--surface); display: grid; place-items: center; overflow: hidden;
  font-size: 32px; font-weight: 700; color: var(--ink-soft);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 560px) {
  .linkrow { flex-wrap: wrap; }
  .linkrow-main { flex: 1 1 100%; order: 3; }
  .linkrow-actions { margin-left: auto; }
}

/* --- design tab --- */
.design-split { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
.preview-pane { position: sticky; top: 88px; }
.phone {
  width: 300px; height: 600px; margin: 0 auto 8px;
  border: 8px solid #1A1A18; border-radius: 34px; overflow: hidden; background: #fff;
}
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }

.themegrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px;
}
.themecard { cursor: pointer; margin: 0; font-weight: 400; }
.themecard input { position: absolute; opacity: 0; pointer-events: none; }
.themecard .swatch {
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
  height: 84px; padding: 0 14px; border-radius: 10px;
  border: 2px solid var(--line);
}
.themecard input:checked + .swatch { border-color: var(--accent); }
.themecard .swatch-btn { display: block; height: 13px; border: 1.5px solid; }
.themename {
  display: flex; align-items: center; gap: 5px; justify-content: center;
  font-size: 13px; margin-top: 6px; font-weight: 600;
}
.themename .tag { font-size: 9px; padding: 2px 5px; }
.themecard.locked { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 900px) {
  .design-split { grid-template-columns: 1fr; }
  .preview-pane { position: static; order: -1; }
}

/* --- analytics --- */
.rangebar { display: flex; gap: 6px; margin-bottom: 16px; }
.rangebar a {
  padding: 7px 14px; border-radius: 999px; text-decoration: none;
  font-size: 14px; color: var(--ink-soft); background: var(--surface);
}
.rangebar a.on { background: var(--ink); color: #fff; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.stat .n { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.stat .l { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.chart .bar { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; }
.chart .bar span {
  display: block; width: 100%; min-height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.analytics-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.toplist { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toplist li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.toplist li:first-child { border-top: 0; }
.toplist .t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist .n { font-weight: 700; }

.locked-wrap { position: relative; }
.locked-blur { filter: blur(7px); opacity: 0.5; pointer-events: none; user-select: none; }
.locked-over {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 20px;
}

@media (max-width: 640px) {
  .analytics-split { grid-template-columns: 1fr; }
}

/* --- page unavailable (the only platform screen served under /{username}) --- */
.empty { max-width: 420px; margin: 12vh auto; text-align: center; padding: 0 20px; }
.empty .logo { justify-content: center; margin-bottom: 26px; }
.empty h1 { font-size: 24px; margin: 0 0 10px; letter-spacing: -0.02em; }
.empty p { color: var(--ink-soft); margin: 0 0 26px; }

/* --- footer --- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 64px;
  padding: 28px 0; font-size: 14px; color: var(--ink-soft);
}
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer .spacer { margin-left: auto; }

@media (max-width: 640px) {
  .site-header nav { gap: 12px; }
  .site-header nav a.hide-sm { display: none; }
}
