@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/proximanova-regular.woff2") format("woff2"), url("../fonts/proximanova-regular.woff") format("woff");
  font-weight: 400;
}

@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/proximanova-semibold.woff2") format("woff2"), url("../fonts/proximanova-semibold.woff") format("woff");
  font-weight: 600;
}

:root {
  --yellow: #ffe600;
  --blue: #3483fa;
  --blue-hover: #2968c8;
  --bg: #ededed;
  --text: #111820;
  --muted: #5f6368;
  --line: #dedede;
  --success: #00a650;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Proxima Nova", Arial, sans-serif;
  font-size: 16px;
}

a { color: #2968ff; text-decoration: none; }

.ml-topbar {
  height: 56px;
  background: var(--yellow);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.ml-topbar__inner {
  width: min(1130px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ml-logo img {
  display: block;
  width: 126px;
  height: auto;
}

.ml-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}

.ml-nav a { color: #1f1f1f; }

.register-shell {
  min-height: calc(100vh - 146px);
}

.intro,
.form-screen,
.admin-shell,
.admin-login,
.partner-shell {
  width: min(1130px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
  color: #555;
  font-size: 14px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 90px;
  align-items: start;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 18px;
  padding: 5px 10px;
  border-radius: 4px;
  color: #066839;
  background: #dff7ea;
  font-size: 13px;
  font-weight: 600;
}

h1 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
}

p { line-height: 1.45; }

ul {
  margin: 12px 0 14px;
  padding-left: 28px;
  line-height: 1.55;
}

.benefit-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.benefit-list li::marker {
  color: var(--blue);
}

.form-callout {
  align-self: end;
  min-height: 96px;
  padding: 18px;
  border-left: 4px solid var(--yellow);
  border-radius: 6px;
  background: #fffbe0;
}

.form-callout strong {
  display: block;
  margin-bottom: 6px;
}

.form-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.intro-art {
  width: 155px;
  justify-self: center;
  margin-top: 102px;
  opacity: .9;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 44px 0 78px;
}

.consent input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

button,
.primary,
.secondary-link {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.primary:hover { background: var(--blue-hover); }

.primary:disabled {
  color: rgba(0, 0, 0, .28);
  background: rgba(65, 137, 230, .2);
  cursor: default;
}

.secondary {
  color: #2968ff;
  background: rgba(65, 137, 230, .14);
}

.secondary:disabled {
  color: rgba(0, 0, 0, .32);
  cursor: default;
}

.text-button {
  padding: 0 28px;
  color: #2968ff;
  background: transparent;
}

.danger {
  color: #b00020;
  background: #ffe9ed;
}

.notice {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 26px 0 24px;
  padding: 18px;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #e3e3e3;
  font-size: 14px;
}

.notice strong {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
}

.request-card,
.success-card,
.summary-card,
.table-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.login-card {
  width: min(430px, 100%);
  margin: 72px auto 0;
  padding: 30px 28px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.login-card .field {
  margin-bottom: 16px;
}

.card-head {
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--line);
}

.card-head p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 34px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px 38px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  position: relative;
}

.field input,
.field select,
.combo-trigger {
  width: 100%;
  min-height: 50px;
  border: 1px solid #b8b8b8;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  font: inherit;
  text-align: left;
  outline: none;
}

.field input:focus,
.field select:focus,
.combo-trigger:focus,
.commerce-field.is-open .combo-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.field.is-invalid input,
.field.is-invalid .combo-trigger,
.field.is-invalid .phone-control {
  border-color: #f23d4f;
}

.error {
  min-height: 17px;
  color: #b00020;
  font-size: 12px;
}

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

.chevron {
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
}

.combo-menu {
  position: absolute;
  top: 78px;
  left: 0;
  right: 0;
  z-index: 20;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 6px 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.search-box {
  margin: 10px 14px 8px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--blue);
  border-radius: 18px;
  padding: 0 12px;
}

.search-box input {
  min-height: 36px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.search-box input:focus { box-shadow: none; }

.combo-menu ul {
  max-height: 236px;
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
  overflow: auto;
}

.combo-menu li {
  min-height: 48px;
  padding: 14px 16px;
  cursor: pointer;
}

.combo-menu li:hover,
.combo-menu li.is-selected {
  color: #2968ff;
  background: #f5f9ff;
}

.phone-control {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  min-height: 50px;
  border: 1px solid #b8b8b8;
  border-radius: 6px;
  background: #fff;
}

.phone-control select,
.phone-control input {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.phone-control select {
  border-right: 1px solid #ddd;
  padding-left: 12px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-top: 1px solid var(--line);
}

.card-actions > div {
  display: flex;
  gap: 8px;
}

.success-screen {
  min-height: calc(100vh - 56px);
  position: relative;
  background: #fff;
}

.success-band {
  height: 108px;
  background: linear-gradient(180deg, #00a650 0, #00a650 36px, rgba(0, 166, 80, .16) 108px);
}

.success-content {
  width: min(560px, calc(100% - 32px));
  margin: -82px auto 0;
}

.success-card {
  min-height: 150px;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
}

.success-card p,
.summary-card p {
  margin: 0 0 12px;
  color: #555;
  font-size: 14px;
}

.success-card h1 {
  margin-bottom: 14px;
  font-size: 32px;
}

.success-check {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 34px;
}

.summary-card {
  margin-top: 18px;
  padding: 26px 24px;
}

.success-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.secondary-link {
  color: #2968ff;
  background: rgba(65, 137, 230, .14);
}

.ml-footer {
  padding: 18px 0 16px;
  border-top: 1px solid #ddd;
  color: #606060;
  background: #fff;
  font-size: 12px;
}

.ml-footer > div,
.ml-footer > p {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.ml-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 8px;
}

.ml-footer a { color: #333; }

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-head p {
  margin: 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.lead-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.lead-stats article {
  padding: 20px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.lead-stats strong {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
}

.lead-stats span { color: var(--muted); }

.table-card {
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.table-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.link-manager {
  margin-bottom: 18px;
}

.link-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.referral-list {
  display: grid;
}

.referral-card {
  display: grid;
  grid-template-columns: minmax(180px, .6fr) minmax(260px, 1fr) minmax(290px, auto);
  gap: 18px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}

.referral-card:first-child {
  border-top: 0;
}

.referral-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.referral-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.referral-links {
  display: grid;
  gap: 8px;
}

.referral-links span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.referral-url {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #333;
  background: #f7f7f7;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mini-button {
  min-height: 38px;
  padding: 0 14px;
  color: #2968ff;
  background: rgba(65, 137, 230, .14);
  font-size: 14px;
}

.mini-button.is-active {
  color: #fff;
  background: var(--blue);
}

.danger-mini {
  color: #b00020;
  background: #ffe9ed;
}

.danger-mini:hover {
  background: #ffdce4;
}

.origin-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 6px;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  color: #134e2a;
  background: #e0f6e9;
  font-size: 12px;
  font-weight: 600;
}

.whatsapp-tag {
  color: #063f25;
  background: #c9f2da;
}

.admin-whatsapp-tag {
  color: #1b4d8f;
  background: #e4efff;
}

.admin-tag {
  color: #525252;
  background: #eeeeee;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.admin-search input {
  width: 260px;
  min-height: 40px;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

.empty-state {
  padding: 54px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.lead-list {
  display: grid;
}

.lead-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(180px, auto);
  gap: 18px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.lead-card:first-child { border-top: 0; }

.lead-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.lead-card p {
  margin: 5px 0;
  color: #545454;
  font-size: 14px;
}

.lead-card strong { color: #222; }

.whatsapp {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  color: #fff;
  background: var(--success);
  font-weight: 600;
}

.lead-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.transfer-box {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.transfer-box label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.transfer-box select {
  min-height: 38px;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.partner-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 15px;
  }

  body *,
  body *::before,
  body *::after {
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p,
  li,
  span,
  a,
  label,
  strong {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .ml-topbar {
    height: auto;
    min-height: 56px;
  }

  .ml-topbar__inner {
    width: 100%;
    max-width: 100vw;
    min-height: 56px;
    padding: 8px 16px;
  }

  .ml-logo img {
    width: 112px;
  }

  .ml-nav {
    gap: 12px;
    justify-content: flex-end;
    font-size: 13px;
  }

  .ml-nav a {
    white-space: nowrap;
  }

  .intro,
  .form-screen,
  .admin-shell,
  .admin-login,
  .partner-shell {
    width: 100%;
    max-width: 100vw;
    padding: 24px 14px 56px;
  }

  .crumb {
    margin-bottom: 24px;
    overflow: hidden;
    white-space: nowrap;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .intro-art {
    display: none;
  }

  .benefit-list {
    padding-left: 22px;
  }

  .consent {
    margin: 28px 0 30px;
  }

  .primary,
  .secondary,
  .secondary-link,
  .text-button,
  button {
    width: 100%;
    min-height: 48px;
  }

  .notice {
    align-items: flex-start;
    margin: 18px 0;
    padding: 14px;
  }

  .request-card,
  .success-card,
  .summary-card,
  .table-card,
  .login-card {
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
  }

  .card-head {
    padding: 22px 18px 20px;
  }

  .card-body {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 18px;
  }

  .field input,
  .field select,
  .combo-trigger,
  .phone-control,
  .admin-search input,
  .transfer-box select {
    min-width: 0;
    font-size: 16px;
  }

  .combo-menu {
    top: 76px;
    max-height: min(330px, 70vh);
    overflow: hidden;
  }

  .combo-menu ul {
    max-height: 240px;
  }

  .phone-control {
    grid-template-columns: 88px 1fr;
  }

  .phone-control select {
    padding-left: 8px;
  }

  .form-callout {
    min-height: 0;
  }

  .card-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 12px;
    padding: 18px;
  }

  .card-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .card-actions .text-button {
    justify-content: center;
  }

  .success-content {
    width: 100%;
    padding: 0 14px 48px;
  }

  .success-card {
    min-height: 0;
    padding: 24px 20px;
  }

  .success-card h1 {
    font-size: 28px;
  }

  .success-check {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 30px;
  }

  .success-actions {
    flex-direction: column;
  }

  .login-card {
    margin: 32px auto 0;
    padding: 24px 20px;
  }

  .admin-head,
  .table-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .lead-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .lead-stats article {
    min-width: 0;
    padding: 16px 14px;
  }

  .lead-stats strong {
    font-size: 24px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .lead-stats span {
    font-size: 14px;
  }

  .link-form {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .referral-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .referral-links,
  .referral-url {
    min-width: 0;
  }

  .referral-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: 8px;
  }

  .mini-button {
    width: 100%;
    padding: 0 10px;
    text-align: center;
  }

  .admin-search {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .admin-search input {
    width: 100%;
  }

  .lead-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .lead-card h3 {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .lead-card p {
    overflow-wrap: anywhere;
  }

  .lead-actions {
    gap: 8px;
  }

  .whatsapp {
    width: 100%;
  }

  .transfer-box {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .ml-logo img {
    width: 96px;
  }

  .ml-nav {
    gap: 10px;
    font-size: 12px;
  }

  .lead-stats {
    grid-template-columns: 1fr 1fr;
  }

  .lead-stats strong {
    font-size: 22px;
  }

  .referral-actions {
    grid-template-columns: 1fr;
  }

  .card-actions > div {
    grid-template-columns: 1fr;
  }
}
