/* The ambassador pages: the public application page and the ambassador's own page. Builds on platform.css
   and only applies inside <body class="ambassador-page">, so host pages are not affected. */

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 20; padding: 10px 14px; border-radius: 8px;
  background: var(--green); color: white; font-weight: 700; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.ambassador-page h1, .ambassador-page h2 { text-wrap: balance; }
.ambassador-page p { text-wrap: pretty; }
.ambassador-page .btn { transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.ambassador-page .btn:active { transform: translateY(0) scale(0.98); }
.ambassador-page .btn:focus-visible, .ambassador-page a:focus-visible { outline: 3px solid rgba(23, 98, 75, 0.4); outline-offset: 2px; }
.ambassador-page [tabindex="-1"]:focus { outline: none; }

/* ---------------------------------------------------------------------------------------------
   Application page */

/* The landing page's city picture under a green tint. On large screens the panel stays in place while
   the form scrolls past it. */
.amb-aside {
  position: relative; isolation: isolate; overflow: hidden;
  background: #16342b url("/assets/images/hero-city.webp") center / cover no-repeat;
}
.amb-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(165deg, rgba(22, 52, 43, 0.97) 0%, rgba(22, 52, 43, 0.88) 50%, rgba(22, 52, 43, 0.72) 100%);
}
@media (min-width: 901px) {
  .amb-aside { position: sticky; top: 0; align-self: start; height: 100svh; }
}
.amb-eyebrow { margin: 0 0 14px; color: var(--gold); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.amb-pitch h1 { margin-bottom: 16px; font-size: clamp(2.3rem, 4vw, 3.3rem); line-height: 1.02; letter-spacing: -0.01em; }

/* How it works: four numbered steps joined by a thin line. */
.amb-steps { counter-reset: step; display: grid; max-width: 440px; margin: 30px 0 0; padding: 0; list-style: none; }
.amb-steps li {
  counter-increment: step; position: relative;
  display: grid; grid-template-columns: 32px 1fr; column-gap: 14px; padding-bottom: 18px;
}
.amb-steps li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid rgba(215, 168, 64, 0.65); border-radius: 50%; color: var(--gold); font-size: 0.85rem; font-weight: 800;
}
.amb-steps li::after { content: ""; position: absolute; top: 36px; bottom: 4px; left: 16px; width: 1px; background: rgba(255, 255, 255, 0.2); }
.amb-steps li:last-child { padding-bottom: 0; }
.amb-steps li:last-child::after { display: none; }
.amb-steps strong { color: white; font-size: 0.98rem; font-weight: 650; }
.amb-steps span { color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; line-height: 1.45; }
.amb-aside .auth-footnote a { color: white; font-weight: 700; }

.amb-main { align-content: start; padding-top: clamp(28px, 6vw, 72px); padding-bottom: 40px; }
.amb-card { width: min(100%, 520px); }

/* Estimator */
.estimator {
  margin: 0 0 40px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 20px 44px rgba(22, 52, 43, 0.09);
}
.estimator h2 { margin: 0 0 18px; font-size: 1.55rem; }
.estimator-field { margin-bottom: 14px; }
.estimator-field label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 0.86rem; font-weight: 650; }
.estimator-field output { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.estimator-field input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; min-height: 0; margin: 2px 0 0; padding: 0;
  border: 0; background: transparent; cursor: pointer; --fill: 50%;
}
.estimator-field input[type="range"]:focus { outline: none; }
.estimator-field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--green) var(--fill), #d5e1da var(--fill));
}
.estimator-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border: 2px solid var(--green); border-radius: 50%;
  background: white; box-shadow: 0 2px 6px rgba(22, 52, 43, 0.25); transition: transform 0.15s ease;
}
.estimator-field input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: #d5e1da; }
.estimator-field input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--green); }
.estimator-field input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border: 2px solid var(--green); border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(22, 52, 43, 0.25);
}
.estimator-field input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.estimator-field input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(23, 98, 75, 0.22); }
.estimator-field input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(23, 98, 75, 0.22); }
.estimator-result { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; margin: 20px 0 14px; }
.estimator-result > div { padding: 14px 16px; border-radius: 12px; background: var(--soft-green); }
.estimator-result span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.estimator-result strong {
  display: block; margin-top: 2px; font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 600;
  line-height: 1.15; font-variant-numeric: tabular-nums;
}
.estimator-result .estimator-total { background: #16342b; }
.estimator-result .estimator-total span { color: rgba(255, 255, 255, 0.72); }
.estimator-result .estimator-total strong { color: var(--gold); font-size: 1.85rem; }
.estimator .fine-print { color: var(--muted); }

/* Form */
.amb-form-head h2 { margin-bottom: 6px; font-size: clamp(1.75rem, 3vw, 2.1rem); }
.amb-form-head p { margin: 0 0 22px; color: var(--muted); }
.amb-form { gap: 20px; }
.amb-group { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.amb-group + .amb-group { margin-top: 14px; }
.amb-group legend {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 0;
  color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-weight: 600;
}
.amb-group legend span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft-green);
  color: var(--green); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 0.8rem; font-weight: 800;
}
.amb-group .field label span { color: var(--muted); font-weight: 600; }
.amb-submit { width: 100%; min-height: 52px; font-size: 1rem; }
.amb-submit:hover { box-shadow: 0 10px 24px rgba(23, 98, 75, 0.25); }
.amb-legal { width: min(100%, 520px); margin: 32px 0 0; color: var(--muted); font-size: 0.8rem; text-align: center; }
.amb-legal a { color: inherit; }

/* After sending */
.amb-done { padding-top: 12px; }
.amb-done-mark {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border-radius: 50%;
  background: var(--soft-green); color: var(--green); font-size: 1.6rem; font-weight: 800;
}
.amb-next { display: grid; gap: 10px; margin: 0; padding-left: 20px; }
.amb-next li::marker { color: var(--green); font-weight: 800; }
.amb-next a { color: var(--green); font-weight: 700; }

@media (max-width: 900px) {
  .amb-aside { gap: 20px; padding: 22px 20px 26px; }
  .amb-pitch h1 { font-size: 2.05rem; }
  .amb-pitch > p { font-size: 0.95rem; }
  /* On phones the steps sit two by two so the form is not pushed far down. */
  .amb-steps { grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: 20px; }
  .amb-steps li { grid-template-columns: 26px 1fr; column-gap: 10px; padding-bottom: 0; }
  .amb-steps li::before { width: 26px; height: 26px; font-size: 0.74rem; }
  .amb-steps li::after { display: none; }
  .amb-steps strong { font-size: 0.88rem; }
  .amb-steps span { font-size: 0.8rem; }
  .amb-main { padding: 24px 16px 36px; }
}
@media (max-width: 640px) {
  .estimator { padding: 18px; border-radius: 14px; }
  .estimator-result { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------------------------
   The ambassador's own page */

.amb-center { justify-items: center; align-content: start; padding-top: clamp(32px, 8vw, 88px); }
.amb-panel {
  width: min(100%, 440px); padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 20px 44px rgba(22, 52, 43, 0.08);
}
.amb-panel h1 { margin-bottom: 8px; font-size: 2rem; }
.amb-panel > p { color: var(--muted); }
.amb-panel .btn-primary { width: 100%; min-height: 48px; }
.amb-panel .auth-alt a { color: var(--green); }

/* Your link and money, on a deep green card. */
.amb-link-card { border: 0; background: #16342b; color: white; box-shadow: 0 20px 44px rgba(22, 52, 43, 0.18); }
.amb-link-card h2 { color: white; }
.amb-link-card .card-head p { color: rgba(255, 255, 255, 0.72); }
.amb-link-card .referral-link input { border-color: transparent; font-weight: 600; }
.amb-link-card .btn-quiet { border-color: rgba(255, 255, 255, 0.3); background: transparent; color: white; }
.amb-link-card .btn-quiet:hover { background: rgba(255, 255, 255, 0.1); }
.amb-link-card .btn-primary { background: var(--gold); color: #1f2a26; }
.amb-link-card .btn-primary:hover { background: #e0b44f; }
.amb-link-card .metric { background: rgba(255, 255, 255, 0.08); }
.amb-link-card .metric span { color: rgba(255, 255, 255, 0.7); }
.amb-link-card .metric strong { color: white; font-variant-numeric: tabular-nums; }
.amb-link-card .metric:first-child strong { color: var(--gold); }
.amb-link-card .fine-print { color: rgba(255, 255, 255, 0.68); }

@media (max-width: 640px) {
  /* What is ready to be paid takes the full width; the other two share a row. */
  .amb-link-card .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .amb-link-card .metric:first-child { grid-column: 1 / -1; }
  .amb-link-card .metric { padding: 12px 14px; }
  .amb-link-card .metric strong { font-size: 1.05rem; white-space: nowrap; }
  .amb-link-card .metric:first-child strong { font-size: 1.7rem; }
}

#dashPanel .card { border-radius: 14px; }
.ambassador-page .cell-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ambassador-page td { white-space: normal; vertical-align: top; }
.ambassador-page td strong { font-weight: 650; }
.ambassador-page .empty { border-radius: 12px; }
#invitesBody:not(:empty) { margin-top: 22px; }
