/* Site forms that open a ticket (contact page, cloud office quote): the sheet of paper, fields, chips,
   the sending animation and the stamped "sent" note. js/form.js runs them; landing.css has the tokens. */

/* The form, on a sheet of paper */

.lp .w-letter { --zz: 14px; padding: 32px 32px calc(30px + var(--zz)); }

.lp .w-form { display: grid; gap: 18px; }
.lp .w-form[hidden] { display: none; }
.lp .w-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.lp .w-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lp .w-field label,
.lp .w-field legend { margin-bottom: 0; font-size: 0.9rem; font-weight: 700; }

.lp .w-field input,
.lp .w-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lp .w-field input:focus,
.lp .w-field textarea:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 4px rgba(180, 46, 109, 0.15);
}

/* Phone and email are typed left to right, but sit on the right like the other fields */
.lp .w-field input[dir="ltr"] { text-align: right; }
.lp .w-field textarea { min-height: 130px; resize: vertical; }

/* The department, as a row of chips */
.lp .w-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lp .w-chips label { position: relative; margin: 0; cursor: pointer; }

.lp .w-chips input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lp .w-chips span {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--rule);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
}

.lp .w-chips input:checked + span { background: var(--ink); box-shadow: none; color: #fff; }
.lp .w-chips input:focus-visible + span { outline: 3px solid var(--magenta); outline-offset: 2px; }

.lp .w-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; }
.lp .w-check label { margin: 0; }

.lp .w-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--magenta);
}

.lp .w-check a { font-weight: 700; color: var(--magenta); text-decoration: underline; }

.lp .w-form-error {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdecec;
  font-size: 0.92rem;
  font-weight: 600;
  color: #a12a2a;
}

.lp .w-form-error[hidden] { display: none; }

.lp .w-send { width: 100%; }
.lp .w-send[disabled] { opacity: 0.7; cursor: progress; }

/* Sent: the form gives way to a stamped note */
.lp .w-sent { padding: 40px 10px 20px; text-align: center; }
.lp .w-sent[hidden] { display: none; }
.lp .w-sent:focus { outline: none; }

.lp .w-sent-stamp {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 18px 2px;
  border: 3px solid var(--magenta);
  border-radius: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--magenta);
  transform: rotate(-8deg);
}

.lp .w-sent h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
}

.lp .w-sent p { margin-top: 10px; color: var(--mute); }
.lp .w-sent a { font-weight: 700; color: var(--magenta); }

/* The trap field: out of sight and out of the tab order; people leave it empty */
.lp .w-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lp .w-form-error a { font-weight: 700; color: inherit; text-decoration: underline; }
.lp .w-sent-ticket { margin-top: 6px; font-weight: 600; }
.lp .w-sent-ticket[hidden] { display: none; }

/* Sending: the fields rest, the button gives way to a line the plane crosses and three steps */
.lp .w-form.is-sending .w-field,
.lp .w-form.is-sending .w-form-row,
.lp .w-form.is-sending .w-check,
.lp .w-form.is-sending .cf-turnstile {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lp .w-sending { padding: 6px 0 2px; }
.lp .w-sending[hidden] { display: none; }

.lp .w-sending-track {
  position: relative;
  height: 34px;
}

/* The line: dashed like a torn-off strip, filling in magenta from the right */
.lp .w-sending-track::before,
.lp .w-sending-fill {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 999px;
}

.lp .w-sending-track::before { background: repeating-linear-gradient(90deg, var(--rule) 0 10px, transparent 10px 16px); }

.lp .w-sending-fill {
  background: var(--magenta);
  transform: scaleX(0);
  transform-origin: right;
}

.lp .w-sending-plane {
  position: absolute;
  top: 50%;
  inset-inline-start: 0;
  display: grid;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  place-items: center;
  font-size: 1.05rem;
  color: var(--magenta);
}

/* The plane points the way it travels (right to left), and bobs a little */
.lp .w-sending-plane i { transform: scaleX(-1); animation: w-bob 1.1s ease-in-out infinite; }

@keyframes w-bob {
  50% { translate: 0 -3px; }
}

.lp .w-sending-steps {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.lp .w-sending-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--mute);
  transition: color 0.3s;
}

/* Each step's mark: a dot waiting, a spinning ring while it runs, a check when done */
.lp .w-sending-steps li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--rule);
  border-radius: 50%;
  transition: border-color 0.3s, background-color 0.3s;
}

.lp .w-sending-steps li.is-now { font-weight: 700; color: var(--ink); }

.lp .w-sending-steps li.is-now::before {
  border-color: var(--magenta);
  border-top-color: transparent;
  animation: w-spin 0.8s linear infinite;
}

.lp .w-sending-steps li.is-done { color: var(--ink); }

.lp .w-sending-steps li.is-done::before {
  border-color: var(--magenta);
  background: var(--magenta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

@keyframes w-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lp .w-sending-plane i,
  .lp .w-sending-steps li.is-now::before { animation: none; }
}

@media (max-width: 560px) {
  .lp .w-form-row { grid-template-columns: minmax(0, 1fr); }
  .lp .w-letter { padding: 24px 18px calc(24px + var(--zz)); }
}
