@import url('https://fonts.googleapis.com/css2?family=Montserrat+Alternates:wght@500;600;700;800;900&display=swap');

:root {
  color-scheme: dark;
  --bg: #050706;
  --panel: rgba(17, 21, 19, .82);
  --panel-2: #121613;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #f5f7f3;
  --muted: #9aa39d;
  --acid: #caff45;
  --violet: #a88cff;
  --coral: #ff7a68;
  --danger: #ff6d77;
  --radius: 24px;
  --font: "Montserrat Alternates", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(168, 140, 255, .16), transparent 30rem),
    radial-gradient(circle at 92% 28%, rgba(202, 255, 69, .11), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.hidden { display: none !important; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 50;
}

.topbar {
  width: min(1440px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -.04em; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--acid);
  color: #080b08;
  font-size: 13px;
  box-shadow: 0 0 32px rgba(202, 255, 69, .18);
}
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .12em; display: block; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 10px; }

.button, .icon-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.button:hover, .icon-button:hover { transform: translateY(-2px); border-color: rgba(202, 255, 69, .7); }
.button.primary { background: var(--acid); color: #080b08; border-color: var(--acid); }
.button.violet { background: var(--violet); color: #0a0810; border-color: var(--violet); }
.button.danger { border-color: rgba(255, 109, 119, .5); color: #ff9ba3; }
.button.compact { padding: 9px 12px; font-size: 13px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }

.partner-hero {
  width: min(1440px, calc(100% - 40px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: clamp(68px, 10vw, 150px) 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  align-items: center;
  gap: clamp(44px, 8vw, 120px);
  position: relative;
}
.eyebrow { color: var(--acid); text-transform: uppercase; font-size: 13px; font-weight: 900; letter-spacing: .14em; }
.partner-hero h1 {
  margin: 18px 0 24px;
  max-width: 900px;
  font-size: clamp(46px, 7vw, 108px);
  line-height: .9;
  letter-spacing: -.075em;
  text-transform: uppercase;
}
.partner-hero h1 em { color: var(--acid); font-style: normal; }
.partner-hero .lead { max-width: 720px; color: #c5cbc7; font-size: clamp(18px, 2vw, 26px); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-actions .button { padding: 16px 22px; }

.money-orbit { aspect-ratio: 1; position: relative; display: grid; place-items: center; }
.money-orbit::before, .money-orbit::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(202, 255, 69, .34);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}
.money-orbit::after { inset: 20%; border-style: dashed; animation-direction: reverse; animation-duration: 12s; }
.money-core {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 36%;
  display: grid;
  place-content: center;
  text-align: center;
  transform: rotate(-8deg);
  background: linear-gradient(145deg, var(--acid), #82d916);
  color: #071006;
  box-shadow: 0 35px 100px rgba(130, 217, 22, .25);
}
.money-core strong { font-size: clamp(58px, 9vw, 118px); letter-spacing: -.08em; line-height: .8; }
.money-core span { font-size: 13px; font-weight: 900; letter-spacing: .12em; margin-top: 14px; }
.orbit-label { position: absolute; padding: 11px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(7, 10, 8, .88); font-weight: 800; font-size: 13px; }
.orbit-label.one { top: 10%; right: 2%; }
.orbit-label.two { left: 0; bottom: 18%; }
.orbit-label.three { right: 4%; bottom: 6%; color: var(--acid); }
@keyframes spin { to { transform: rotate(360deg); } }

.partner-flow { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 110px 0; }
.partner-flow h2 { font-size: clamp(40px, 6vw, 78px); line-height: .95; letter-spacing: -.06em; margin: 0 0 50px; text-transform: uppercase; }
.flow-line { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); }
.flow-step { min-height: 300px; padding: 28px; border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.flow-step:last-child { border-right: 0; }
.flow-step > span { color: var(--acid); font-weight: 900; font-size: 13px; }
.flow-step h3 { margin: 80px 0 12px; font-size: clamp(22px, 3vw, 36px); letter-spacing: -.04em; }
.flow-step p { color: var(--muted); max-width: 330px; }
.flow-step b { position: absolute; right: -10px; bottom: -45px; color: rgba(255,255,255,.035); font-size: 170px; line-height: 1; }

.terms-strip { background: var(--acid); color: #081006; }
.terms-inner { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.terms-inner div { border-left: 2px solid rgba(8,16,6,.25); padding-left: 20px; }
.terms-inner strong { display: block; font-size: clamp(34px, 5vw, 64px); letter-spacing: -.07em; line-height: 1; }
.terms-inner span { font-weight: 800; font-size: 14px; }

.partner-cta { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 120px 0; text-align: center; }
.partner-cta h2 { font-size: clamp(42px, 7vw, 96px); line-height: .9; letter-spacing: -.07em; margin: 0 0 24px; text-transform: uppercase; }
.partner-cta p { color: var(--muted); font-size: 18px; }

.join-section {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0;
  scroll-margin-top: 20px;
}
.join-heading { max-width: 900px; margin-bottom: 46px; }
.join-heading h2 { margin: 12px 0 22px; font-size: clamp(42px, 7vw, 92px); line-height: .9; letter-spacing: -.07em; text-transform: uppercase; }
.join-heading > p:last-child { max-width: 720px; color: var(--muted); font-size: 18px; }
.auth-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.auth-card { position: relative; border: 1px solid var(--line); border-radius: 28px; background: var(--panel); padding: clamp(24px, 4vw, 46px); overflow: hidden; }
.auth-card-primary { border-color: rgba(202, 255, 69, .34); box-shadow: 0 24px 90px rgba(202, 255, 69, .06); }
.auth-card h3 { margin: 12px 0 6px; font-size: clamp(27px, 3vw, 42px); letter-spacing: -.05em; }
.auth-card > p { color: var(--muted); margin: 0 0 26px; }
.auth-number { color: var(--acid); font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.auth-card .secure-note a { color: #d5caff; text-decoration: underline; text-underline-offset: 3px; }

.app-shell { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 80px; }
.app-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 34px 0; }
.app-heading h1 { margin: 0; font-size: clamp(36px, 5vw, 72px); line-height: .95; letter-spacing: -.06em; text-transform: uppercase; }
.app-heading p { margin: 10px 0 0; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); position: relative; overflow: hidden; }
.stat-card::after { content: ""; width: 90px; height: 90px; border-radius: 50%; position: absolute; right: -45px; bottom: -45px; background: var(--accent, var(--acid)); filter: blur(20px); opacity: .13; }
.stat-card span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-card strong { display: block; margin-top: 22px; font-size: clamp(28px, 3vw, 46px); line-height: 1; letter-spacing: -.06em; }
.stat-card.acid { --accent: var(--acid); }
.stat-card.violet { --accent: var(--violet); }
.stat-card.coral { --accent: var(--coral); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: 18px; margin-top: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.panel-head small { color: var(--muted); }
.panel-body { padding: 24px; }

.ref-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 16px; background: #090c0a; }
.ref-box input { min-width: 0; border: 0; background: transparent; color: #fff; padding: 8px 10px; outline: 0; font-weight: 700; }
.ref-box button { border: 0; background: var(--acid); color: #081006; border-radius: 11px; padding: 10px 16px; font-weight: 900; cursor: pointer; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 15px 14px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 28px !important; text-align: center; }
.status { display: inline-flex; border-radius: 999px; padding: 6px 9px; background: rgba(255,255,255,.07); color: #c6ccc8; font-size: 11px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.status.paid, .status.approved { background: rgba(202,255,69,.12); color: var(--acid); }
.status.pending { background: rgba(168,140,255,.14); color: #c9b9ff; }
.status.rejected, .status.failed, .status.refunded, .status.chargeback { background: rgba(255,109,119,.12); color: #ff9aa2; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 7px; color: #cbd1cd; font-size: 13px; font-weight: 800; }
.form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #090c0a;
  color: #fff;
  padding: 13px 14px;
  outline: 0;
  resize: vertical;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(202,255,69,.08); }
.form-message { min-height: 22px; margin: 0; color: var(--muted); font-size: 13px; }
.form-message.error { color: #ff9aa2; }
.form-message.success { color: var(--acid); }
.calculation { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calculation div { border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: rgba(255,255,255,.025); }
.calculation span { color: var(--muted); display: block; font-size: 11px; }
.calculation strong { display: block; margin-top: 5px; }
.secure-note { color: var(--muted); font-size: 12px; border-left: 2px solid var(--violet); padding-left: 10px; }

.admin-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.sidebar { position: sticky; top: 22px; border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: var(--panel); }
.sidebar strong { display: block; margin: 8px 8px 22px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { padding: 12px; border-radius: 11px; color: var(--muted); font-weight: 700; font-size: 14px; }
.sidebar a:hover { color: #fff; background: rgba(255,255,255,.05); }
.admin-main { min-width: 0; }
.admin-section { scroll-margin-top: 20px; margin-top: 18px; }
.admin-section:first-child { margin-top: 0; }
.partner-list { display: grid; gap: 10px; }
.partner-row { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); padding: 16px; display: grid; grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(80px, .5fr)) auto; gap: 16px; align-items: center; }
.partner-row h3 { margin: 0; font-size: 16px; }
.partner-row small { color: var(--muted); }
.partner-row .metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.partner-row .metric strong { font-size: 14px; }
.row-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.webhook-box { border: 1px dashed rgba(168,140,255,.45); background: rgba(168,140,255,.06); border-radius: 16px; padding: 16px; }
.webhook-box code { color: #cfbeff; overflow-wrap: anywhere; }

.login-wrap { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 20px; }
.login-card { width: min(480px, 100%); border: 1px solid var(--line); border-radius: 28px; background: var(--panel); padding: clamp(24px, 5vw, 46px); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.login-card h1 { font-size: clamp(34px, 6vw, 56px); line-height: .95; letter-spacing: -.06em; margin: 16px 0; }
.login-card p { color: var(--muted); }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 14px 17px; border-radius: 13px; background: #e8ffd0; color: #091108; font-weight: 800; box-shadow: 0 18px 60px rgba(0,0,0,.35); z-index: 100; transform: translateY(140%); transition: transform .25s ease; }
.toast.show { transform: translateY(0); }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar a { white-space: nowrap; }
  .partner-row { grid-template-columns: minmax(180px, 1fr) repeat(2, .5fr); }
  .partner-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 760px) {
  .topbar, .partner-hero, .partner-flow, .terms-inner, .partner-cta, .join-section, .app-shell { width: min(calc(100% - 24px), 1440px); }
  .topbar { min-height: 68px; }
  .brand-name { display: none; }
  .topnav { min-width: 0; }
  .topnav .course-link { display: none; }
  .topnav .button { padding: 10px 12px; font-size: 12px; }
  .partner-hero { grid-template-columns: 1fr; padding-top: 54px; min-height: auto; }
  .partner-hero h1 { font-size: clamp(32px, 8.5vw, 48px); letter-spacing: -.07em; overflow-wrap: anywhere; }
  .partner-hero .hero-actions { flex-direction: column; align-items: stretch; }
  .partner-hero .hero-actions .button { width: 100%; text-align: center; }
  .money-orbit { width: min(520px, 100%); margin: 0 auto; }
  .flow-line { grid-template-columns: 1fr; }
  .flow-step { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-step h3 { margin-top: 52px; }
  .terms-inner { grid-template-columns: 1fr; }
  .auth-grid { grid-template-columns: 1fr; }
  .join-section { padding: 86px 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 125px; padding: 16px; }
  .app-heading { align-items: start; flex-direction: column; }
  .panel-head, .panel-body { padding: 18px; }
  .partner-row { grid-template-columns: 1fr 1fr; }
  .partner-row > div:first-child { grid-column: 1 / -1; }
  .data-table th, .data-table td { padding: 12px 10px; }
}

@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 110px; }
  .ref-box { grid-template-columns: 1fr; }
  .ref-box button { width: 100%; }
  .partner-row { grid-template-columns: 1fr; }
  .partner-row > div:first-child, .partner-row .row-actions { grid-column: auto; }
  .calculation { grid-template-columns: 1fr; }
  [data-create-partner-form] { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
