/* Parrhesia ambassador dashboard — on-brand, cinematic, dark-first. */
@font-face { font-family: "Cinzel"; font-weight: 400 900; src: local("Cinzel"); font-display: swap; }

* , *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background:
    radial-gradient(120% 70% at 50% -10%, rgba(201,162,75,0.10), transparent 55%),
    var(--obsidian);
  color: var(--bone); min-height: 100vh;
  font-family: var(--font-ui, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
:root { --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        --font-display: "Cinzel", "Times New Roman", serif; --line: rgba(242,238,227,0.12); --elev: #1C1810;
        --ease: cubic-bezier(.22,1,.36,1); }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; margin: 0; }
.muted { color: #A89E89; }
.small { font-size: 0.82rem; }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.95rem; padding: 0.85em 1.5em; border-radius: 100px;
  border: 1px solid transparent; transition: transform .4s cubic-bezier(.22,1,.36,1), background .3s, color .3s, border-color .3s; }
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: var(--gold); color: var(--obsidian); }
.btn--gold:hover { background: #d8b35e; }
.btn--ghost { border-color: var(--line); color: var(--bone); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--sm { padding: 0.6em 1.1em; font-size: 0.85rem; }
.btn--google { width: 100%; background: #fff; color: #1a1a1a; }
.btn--google:hover { background: #f2f2f2; }

/* ---- auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--elev); border: 1px solid var(--line);
  border-radius: 22px; padding: 2.6rem 2.2rem; text-align: center; box-shadow: 0 40px 80px -40px rgba(0,0,0,0.7); }
.auth-logo { width: min(78%, 290px); height: auto; margin: 0 auto 2rem; display: block; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card p.muted { margin: 0.4rem 0 1.6rem; }
.auth-card form { display: grid; gap: 0.7rem; }
.auth-card input { background: var(--obsidian); border: 1px solid var(--line); color: var(--bone);
  padding: 0.9em 1.1em; border-radius: 100px; font: inherit; text-align: center; }
.auth-card input:focus { outline: none; border-color: var(--gold); }
.divider { display: flex; align-items: center; gap: 1rem; color: #6f6857; font-size: 0.8rem; margin: 1.3rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fineprint { font-size: 0.72rem; color: #6f6857; margin-top: 1.4rem; }

/* ---- dashboard shell ---- */
.dash-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 3rem); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--obsidian) 80%, transparent); backdrop-filter: blur(14px); }
.brand-logo img { height: 20px; width: auto; }
.dash-header__right { display: flex; align-items: center; gap: 1rem; }
.login-link { background: none; border: 1px solid var(--line); color: var(--bone); font: inherit; font-size: 0.82rem;
  font-weight: 600; letter-spacing: 0.03em; padding: 0.5em 1.05em; border-radius: 100px; cursor: pointer; transition: all .3s; }
.login-link:hover { border-color: var(--gold); color: var(--gold); }

.dash-body { width: min(100% - 2.5rem, 1080px); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) 0 5rem; }
.welcome { margin-bottom: 2rem; }
.welcome h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-top: 0.5rem; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat { background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.5rem; }
.stat__label { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: #A89E89; }
.stat__value { font-family: var(--font-display); font-size: 2rem; margin-top: 0.3rem; color: var(--bone); }
.stat__sub { font-size: 0.8rem; color: #8d846f; margin-top: 0.2rem; }
.stat:first-child .stat__value { color: var(--gold); }

/* panels */
.panel-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; margin-bottom: 1.4rem; }
.panel { background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; }
.panel h3 { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #A89E89; margin-bottom: 1.1rem; }

.link-row, .code-edit { display: flex; gap: 0.5rem; }
.link-row input, .code-edit input { flex: 1; min-width: 0; background: var(--obsidian); border: 1px solid var(--line);
  color: var(--bone); padding: 0.7em 1em; border-radius: 100px; font: inherit; font-size: 0.9rem; }
.link-row input:focus, .code-edit input:focus { outline: none; border-color: var(--gold); }
.code-row { margin-top: 1.1rem; }
.code-row label { display: block; font-size: 0.78rem; color: #A89E89; margin-bottom: 0.4rem; }
.code-prefix { align-self: center; color: #6f6857; font-size: 0.82rem; white-space: nowrap; }

.progress { height: 8px; background: var(--obsidian); border: 1px solid var(--line); border-radius: 100px; overflow: hidden; margin: 0.5rem 0 0.7rem; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--golden-smoke), var(--gold)); border-radius: 100px; transition: width .8s cubic-bezier(.22,1,.36,1); }
.progress__bar.gold { background: var(--gold); }
.tier-legend { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 0.75rem; color: #6f6857; }
.tier-legend .on { color: var(--gold); font-weight: 700; }
.payout-cta { margin-top: 1.1rem; }

/* conversions table */
table.conv { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.conv th { text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #8d846f; padding: 0 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
table.conv td { padding: 0.85rem 0.6rem; border-bottom: 1px solid rgba(242,238,227,0.06); }
.pill { font-size: 0.72rem; font-weight: 600; padding: 0.25em 0.7em; border-radius: 100px; text-transform: capitalize; }
.pill--pending { background: rgba(201,162,75,0.16); color: var(--gold); }
.pill--paid { background: rgba(120,180,120,0.16); color: #8fce8f; }

/* toast */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 20px); opacity: 0;
  background: var(--gold); color: var(--obsidian); font-weight: 600; font-size: 0.9rem; padding: 0.8em 1.3em;
  border-radius: 100px; z-index: 100; transition: all .35s cubic-bezier(.22,1,.36,1); box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ============ interaction polish — hovers, motion, depth ============ */

/* stat cards: lift + gold edge glow, value warms to gold */
.stat { position: relative; transition: transform .45s var(--ease), border-color .45s var(--ease), box-shadow .45s var(--ease), background .45s var(--ease); will-change: transform; }
.stat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 120% at 50% -20%, rgba(201,162,75,0.10), transparent 60%); opacity: 0; transition: opacity .45s var(--ease); }
.stat:hover { transform: translateY(-5px); border-color: rgba(201,162,75,0.5);
  box-shadow: 0 26px 54px -30px rgba(0,0,0,0.75), 0 0 0 1px rgba(201,162,75,0.14); }
.stat:hover::after { opacity: 1; }
.stat:hover .stat__value { color: var(--gold); }
.stat__value { transition: color .45s var(--ease); }

/* panels: subtle raise + brighter edge */
.panel { transition: border-color .45s var(--ease), box-shadow .45s var(--ease), transform .45s var(--ease); }
.panel:hover { border-color: rgba(242,238,227,0.22); box-shadow: 0 30px 64px -38px rgba(0,0,0,0.7); }

/* conversion rows highlight on hover */
table.conv tbody tr { transition: background .25s var(--ease); }
table.conv tbody tr:hover { background: rgba(201,162,75,0.06); }

/* inputs: hover + focus feedback */
.link-row input, .code-edit input, .auth-card input { transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.link-row input:hover, .code-edit input:hover { border-color: rgba(242,238,227,0.3); }
.auth-card input:focus, .link-row input:focus, .code-edit input:focus { box-shadow: 0 0 0 3px rgba(201,162,75,0.15); }

/* tier legend ticks */
.tier-legend span { transition: color .3s var(--ease), transform .3s var(--ease); }
.tier-legend span:hover { color: var(--bone); }
.tier-legend .on { transform: translateY(-1px); }

/* logo + buttons micro-interactions */
.brand-logo img { transition: opacity .3s var(--ease); }
.dash-header .brand-logo:hover img { opacity: 0.78; }
.btn:active { transform: translateY(0) scale(0.985); }
.login-link:active { transform: scale(0.97); }
.btn.copied { background: #8fce8f; color: var(--obsidian); }

/* pills get a hairline + hover */
.pill { transition: filter .3s var(--ease); }
table.conv tbody tr:hover .pill { filter: brightness(1.12); }

/* moving sheen across progress bars */
.progress__bar { position: relative; overflow: hidden; }
.progress__bar::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: translateX(-120%); animation: sheen 3.4s var(--ease) infinite; }
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(220%); } }

/* gentle staggered entrance for the dashboard grid */
.dash-body .stat, .dash-body .panel { animation: rise .6s var(--ease) both; }
.dash-body .stats .stat:nth-child(2) { animation-delay: .05s; }
.dash-body .stats .stat:nth-child(3) { animation-delay: .1s; }
.dash-body .stats .stat:nth-child(4) { animation-delay: .15s; }
.dash-body .panel-grid .panel:nth-child(2) { animation-delay: .08s; }
.dash-body .panel-grid .panel:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* auth card: lift the whole card a touch on hover, glow the focused field group */
.auth-card { transition: box-shadow .5s var(--ease), transform .5s var(--ease); }
.auth-card:hover { box-shadow: 0 50px 100px -50px rgba(0,0,0,0.8), 0 0 0 1px rgba(201,162,75,0.12); }

/* richer card hovers — gold top-accent sweeps in, stronger lift, labels warm */
.stat, .panel { overflow: hidden; }
.stat::before, .panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transform: scaleX(0.3); transform-origin: center;
  transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none;
}
.stat:hover::before, .panel:hover::before { opacity: 1; transform: scaleX(1); }
.stat:hover { transform: translateY(-6px); }
.panel:hover { transform: translateY(-3px); }
.stat:hover .stat__label { color: var(--gold); }
.panel:hover h3 { color: #c9b48a; }
/* card surface lightens a hair + gold ring deepens */
.stat:hover, .panel:hover { background: #221d12; }
/* the gold value in the first stat gets a soft glow on hover */
.stat:first-child:hover .stat__value { text-shadow: 0 0 24px rgba(201,162,75,0.4); }
/* buttons inside cards pop */
.panel:hover .btn--gold { box-shadow: 0 10px 26px -10px rgba(201,162,75,0.5); }

@media (prefers-reduced-motion: reduce) {
  .progress__bar::after { animation: none; }
  .dash-body .stat, .dash-body .panel { animation: none; }
  .stat:hover, .panel:hover { transform: none; }
  * { transition-duration: 0.01ms !important; }
}

@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* ============ fit-to-screen compaction (no page scroll) + bigger logo ============ */
html, body { height: 100%; }
body { height: 100vh; overflow: hidden; }
.auth-wrap { height: 100vh; overflow: auto; }

.dash-header { height: 60px; padding-top: 0; padding-bottom: 0; }
.dash-header .brand-logo img { height: 36px; }          /* bigger logo on the dashboard */

.dash-body {
  height: calc(100vh - 60px);
  display: flex; flex-direction: column; gap: 0.85rem;
  padding: 1.2rem 0; overflow: hidden;
}
.welcome { margin-bottom: 0; }
.welcome h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); margin-top: 0.15rem; }
.stats { margin-bottom: 0; flex: 0 0 auto; gap: 0.8rem; }
.stat { padding: 1.05rem 1.25rem; }
.stat__value { font-size: 1.7rem; }
.panel-grid { margin-bottom: 0; flex: 0 0 auto; gap: 0.8rem; }
.panel { padding: 1.25rem 1.3rem; }
.panel h3 { margin-bottom: 0.85rem; }
.panel--conv { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.conv-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.3rem; }
table.conv thead th { position: sticky; top: 0; background: var(--elev); z-index: 1; }

/* short or narrow screens: fall back to natural scroll rather than clipping */
@media (max-height: 700px), (max-width: 880px) {
  body { overflow: auto; height: auto; }
  .dash-body { height: auto; overflow: visible; }
}
