/* =========================================================
   Maple Loop early access form
   Works on its own, or alongside styles.css from the landing page.
   ========================================================= */

.ml-form-section {
  --ml-ink: #06121f;
  --ml-blue: #12a4f0;
  --ml-blue-hover: #0d93db;
  --ml-blue-deep: #0b6aa2;
  --ml-text: #1d1d1f;
  --ml-muted: #5f6b7a;
  --ml-surface: #f4f6f9;
  --ml-line: #d4dbe3;
  --ml-error: #c62828;
  --ml-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;

  padding: clamp(34px, 1.4vw, 100px) clamp(16px, 2vw, 40px);
  padding-bottom: 100px;
  font-family: var(--ml-font);
  color: var(--ml-text);
  -webkit-font-smoothing: antialiased;
}

.ml-form-section *,
.ml-form-section *::before,
.ml-form-section *::after { box-sizing: border-box; }

/* ---------- Card ---------- */

.ml-form {
  max-width: 880px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 28px;
  padding: clamp(10px, 3vw, 48px);
  box-shadow: 0 1px 2px rgba(14, 42, 71, .06), 0 30px 60px -30px rgba(14, 42, 71, .25);
}

.ml-form__head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto clamp(36px, 5vw, 56px);
}
.ml-form__logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 28px;
}
.ml-form__title {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.ml-form__lede {
  margin: 16px 0 0;
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.45;
  color: var(--ml-muted);
}

/* ---------- Fields ---------- */

.ml-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 640px) {
  .ml-form__grid { grid-template-columns: 1fr; }
}

.ml-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ml-field__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ml-text);
}
.ml-field__optional {
  font-weight: 400;
  color: var(--ml-muted);
  margin-left: 4px;
}

.ml-field__input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ml-text);
  background: #ffffff;
  border: 1px solid var(--ml-line);
  border-radius: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ml-field__input:hover { border-color: #aeb9c6; }
.ml-field__input:focus {
  border-color: var(--ml-blue);
  box-shadow: 0 0 0 4px rgba(18, 164, 240, .2);
}

.ml-field--full { grid-column: 1 / -1; }

.ml-field__hint {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ml-muted);
}

.ml-field__textarea {
  height: auto;
  min-height: 132px;
  padding: 14px 16px;
  line-height: 1.45;
  resize: vertical;
}
.ml-field__input::placeholder { color: #98a3b0; }

.ml-field__control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-field__select {
  padding-right: 44px;
  cursor: pointer;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235f6b7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 16px center / 16px no-repeat;
  text-overflow: ellipsis;
}
.ml-field__select:disabled {
  cursor: not-allowed;
  color: #98a3b0;
  background-color: var(--ml-surface);
}

/* ASP.NET validators render as spans; show them as inline messages */
.ml-field__error {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ml-error);
}
.ml-field__error::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%23c62828'/%3E%3Cpath d='M8 4.5v4.2M8 11.2v.1' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Red border on a field while its validator is showing */
.ml-field:has(.ml-field__error:not([style*="none"])) .ml-field__input {
  border-color: var(--ml-error);
}
.ml-field:has(.ml-field__error:not([style*="none"])) .ml-field__input:focus {
  box-shadow: 0 0 0 4px rgba(198, 40, 40, .15);
}

/* ---------- Terms / GDPR consent ---------- */

.ml-consent {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ml-consent__label {
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.ml-consent__text {
	display: inline-block;
  font-size: 14px;
  line-height: 1.5;
	transform: translateY(-4px);
  color: var(--ml-muted);
}
.ml-consent a {
  color: var(--ml-blue-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ml-consent a:hover { color: var(--ml-blue); }

.ml-consent input[type="checkbox"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid #aeb9c6;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.ml-consent input[type="checkbox"]:hover { border-color: var(--ml-blue); }
.ml-consent input[type="checkbox"]:checked {
  border-color: var(--ml-blue);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat, var(--ml-blue);
}
.ml-consent input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(18, 164, 240, .25);
}
.ml-consent .ml-field__error { padding-left: 34px; }
.ml-consent:has(.ml-field__error:not([style*="none"])) input[type="checkbox"] {
  border-color: var(--ml-error);
}

/* ---------- Footer & button ---------- */

.ml-form__footer {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(20px, 2vw, 24px);
  padding-top: 28px;
  border-top: 1px solid #e6ebf0;
}
.ml-form__note {
  margin: 0;
  font-size: 13px;
  color: var(--ml-muted);
  max-width: 40ch;
}

.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--ml-blue);
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .2s ease, transform .2s ease;
}
.ml-btn:hover { background: var(--ml-blue-hover); }
.ml-btn:active { transform: scale(.98); }
/* ImageButton version: the SVG supplies the blue pill and the label */
.ml-btn--image {
  width: 232px;
  height: 52px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: 999px;
  transition: filter .2s ease, transform .2s ease;
}
.ml-btn--image:hover { background: transparent; filter: brightness(.92); }

.ml-btn:focus-visible {
  outline: 3px solid var(--ml-blue);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .ml-form__footer { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .ml-form__note { max-width: none; }
  .ml-btn { width: 100%; }
  .ml-btn--image { width: 232px; align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-field__input, .ml-btn { transition: none; }
}
