/* Landing: purple field, the form is a parcel tag; the referrer stub is the one bold element. */
.landing {
  background: var(--purple);
  min-height: 100vh;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "brand" "intro" "tag" "next";
  row-gap: 22px;
}

.brand { grid-area: brand; }
.brand img { display: block; }

/* ---- intro */
.intro { grid-area: intro; color: var(--white); }

.intro h1 {
  font-size: 28px;
  line-height: 1.45;
  font-weight: 800;
  letter-spacing: -0.2px;
  max-width: 14em;
}

.lede {
  margin-top: 12px;
  max-width: 34em;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.8;
}

/* ---- the tag */
.tag {
  grid-area: tag;
  position: relative;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 24px 48px -24px rgba(34, 6, 42, 0.55);
}

.stub {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 20px;
  background: var(--yellow);
  border-radius: 20px 20px 0 0;
  /* perforation */
  border-bottom: 2px dashed rgba(40, 40, 40, 0.35);
}

/* notches where the stub tears off */
.stub::before,
.stub::after {
  content: "";
  position: absolute;
  bottom: -11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple);
}
.stub::before { right: -10px; }
.stub::after { left: -10px; }

.stub-sign {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 50%;
  background: var(--white);
}

.stub-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
}

.stub-code {
  font-size: 14px;
  line-height: 1.6;
}

.stub-code b {
  font-weight: 800;
  font-size: 18px;
  margin-inline-start: 4px;
  letter-spacing: 1px;
}

/* ---- form */
.sheet {
  padding: 24px 20px 22px;
}

.sheet-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 18px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.field { margin-bottom: 14px; }

.field label,
.location legend,
.sub-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--tint);
  font-size: 16px; /* stops iOS zoom on focus */
  line-height: 1.6;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

textarea { resize: vertical; min-height: 76px; }

input[dir="ltr"] { text-align: left; }
input[dir="ltr"]:placeholder-shown { text-align: right; }

input::placeholder,
textarea::placeholder { color: #9A8FA0; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(112, 31, 131, 0.16);
}

.field.is-invalid input {
  border-color: var(--error);
  background: #FFF7F6;
}

.error {
  min-height: 0;
  color: var(--error);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 4px;
}
.error:empty { display: none; }

/* location */
.location {
  margin: 6px 0 14px;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
}

.location legend {
  padding: 0 6px;
  margin-inline-start: -6px;
}

.optional {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-inline-start: 4px;
}

.hint {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 12px;
}

.geo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.geo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--purple);
  border-radius: 999px;
  background: var(--white);
  color: var(--purple);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.geo-btn:hover { background: var(--tint); }
.geo-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.geo-btn.is-set {
  background: var(--purple);
  color: var(--white);
}

.geo-clear {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.geo-status {
  font-size: 13.5px;
  line-height: 1.7;
  margin: 8px 0 12px;
  color: var(--muted);
}
.geo-status:empty { display: none; }
.geo-status.is-error { color: var(--error); }
.geo-status.is-ok { color: var(--ok); }

.sub-label { margin-top: 4px; }

/* map pin (static/mappin.js) */
.map {
  height: 260px;
  margin-bottom: 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--tint);
}
.map[hidden] { display: none; }
.mappin {
  position: relative;
  overflow: hidden;
  direction: ltr;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.mappin:active { cursor: grabbing; }
.mappin-tiles img {
  position: absolute;
  left: 0;
  top: 0;
  width: 256px;
  height: 256px;
  max-width: none;
  pointer-events: none;
}
/* The pin's tip marks the centre of the box. */
.mappin-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 40px;
  margin: -40px 0 0 -15px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Cpath d='M15 0C6.7 0 0 6.6 0 14.8 0 25.9 15 40 15 40s15-14.1 15-25.2C30 6.6 23.3 0 15 0Z' fill='%23701F83'/%3E%3Ccircle cx='15' cy='14.5' r='5.5' fill='%23fff'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.mappin-zoom {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  gap: 4px;
}
.mappin-zoom button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.mappin-zoom button:disabled { opacity: .4; cursor: default; }
.mappin-credit {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 1px 6px;
  background: rgba(255, 255, 255, .8);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

/* honeypot */
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.form-error {
  color: var(--error);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
.form-error:empty { display: none; }

.submit {
  display: block;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--purple);
  color: var(--white);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}
.submit:hover { background: var(--purple-deep); }
.submit:active { transform: translateY(1px); }
.submit[aria-busy="true"] { opacity: 0.75; cursor: progress; }

.privacy {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

/* ---- code step (OTP) */
.otp .sheet-title { outline: none; }

.otp-lede {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.otp-lede b { font-weight: 800; }

.otp .otp-input {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
}

.otp-timer {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: -4px 0 12px;
}
.otp-timer.is-expired { color: var(--error); font-weight: 700; }

.link-btn {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--purple);
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---- success */
.done {
  padding: 44px 28px 48px;
  text-align: center;
  outline: none;
}

.done-mark {
  display: block;
  margin: 0 auto 20px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.done-mark circle {
  stroke: var(--yellow);
  stroke-width: 4;
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  animation: draw 0.6s ease-out forwards;
}
.done-mark path {
  stroke: var(--purple);
  stroke-width: 5;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: draw 0.35s 0.45s ease-out forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.done-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.9;
  max-width: 22em;
  margin: 0 auto;
}

/* ---- next steps */
.next {
  grid-area: next;
  color: var(--white);
}

.next h2 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 14px;
}

.next ol {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.next li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 46px;
  min-height: 34px;
}

.next li::before {
  content: counter(step, persian);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  line-height: 32px;
  text-align: center;
}

.next b {
  display: block;
  font-weight: 700;
  line-height: 1.6;
}

.next span {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

/* ---- wider screens */
@media (min-width: 560px) {
  .page { padding: 32px 32px 64px; }
  .sheet { padding: 28px 28px 24px; }
  .stub { padding: 20px 28px 22px; }
  .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }
}

@media (min-width: 960px) {
  .page {
    grid-template-columns: minmax(0, 1fr) 470px;
    grid-template-areas:
      "brand tag"
      "intro tag"
      "next  tag";
    grid-template-rows: auto auto 1fr;
    column-gap: 72px;
    row-gap: 0;
    padding-top: 48px;
    align-items: start;
  }
  .intro { padding-top: 88px; }
  .intro h1 { font-size: 44px; line-height: 1.35; }
  .lede { margin-top: 18px; font-size: 17px; }
  .next { padding-top: 56px; }
}

.me-link {
  margin-top: 18px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
}
.me-link a { color: var(--yellow); font-weight: 700; }

/* ---- brand field, shared with /panel and the campaign landings: light lavender, the winding
   purple road at the bottom, purple text instead of white. */
.landing.brandfield {
  background-color: #F6F1FA;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 420' preserveAspectRatio='none'%3E%3Cpath d='M-40 380 C 260 250, 420 420, 700 300 S 1100 120, 1260 210 L 1260 470 L -40 470 Z' fill='%23701F83'/%3E%3Cpath d='M-40 380 C 260 250, 420 420, 700 300 S 1100 120, 1260 210' fill='none' stroke='%238E3BA3' stroke-width='14'/%3E%3Cpath d='M-40 420 C 260 300, 430 460, 720 350 S 1100 190, 1260 270' fill='none' stroke='%23fff' stroke-width='6' stroke-dasharray='34 30' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E"),
    radial-gradient(55% 40% at 0% 0%, rgba(142, 59, 163, .14), transparent 70%),
    radial-gradient(45% 35% at 100% 40%, rgba(112, 31, 131, .08), transparent 70%);
  background-repeat: no-repeat;
  background-size: 100% 220px, auto, auto;
  background-position: bottom center, 0 0, 0 0;
}
.brandfield .page { padding-bottom: 200px; }
.brandfield .intro { color: var(--ink); }
.brandfield .intro h1 { color: var(--purple); }
.brandfield .lede { color: var(--muted); }
.brandfield .tag { border-radius: 24px; box-shadow: 0 18px 50px rgba(112, 31, 131, .18), 0 0 0 6px rgba(142, 59, 163, .08); }
.brandfield .stub { border-radius: 24px 24px 0 0; }
.brandfield .stub::before, .brandfield .stub::after { background: #F6F1FA; }
.brandfield .next { color: var(--ink); }
.brandfield .next span { color: var(--muted); }
.brandfield .next li {
  background: rgba(255, 255, 255, .75); border-radius: 16px; padding: 10px 56px 10px 12px;
}
.brandfield .next li::before { inset-inline-start: 12px; top: 10px; background: var(--purple); color: var(--white); }
.brandfield .me-link { color: var(--muted); }
.brandfield .me-link a { color: var(--purple); }
