/* =============================================
   FORMS — Bestel & Contact formulieren
   Full-page split-screen layout
   ============================================= */

/* ─── Form page mark highlight (teal tint) ─── */
.form-page {
  --mark-color: #c7e1e7;
}

/* ─── Honeypot (anti-spam, hidden from real users) ─── */
.form-hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
  opacity: 0;
}

/* ─── Section wrapper (full-page split) ─── */
.form-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding-top: var(--header-height, 72px);
}

/* ─── Left panel (light & open, centered) ─── */
.form-info {
  flex: 0 0 48%;
  background: transparent;
  color: var(--color-text, #1a1a1a);
  padding: clamp(2.5rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-lg, 2.5rem);
}

.form-info__heading {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: var(--fw-bold, 700);
  line-height: 1.3;
  margin: 0;
}

.form-info__heading em {
  font-style: normal;
  color: inherit;
}

/* Mark highlight inside info heading — starts hidden, animates in */
.form-info__heading mark {
  background: none;
  color: #1a1a1a;
  position: relative;
  display: inline;
  padding: 2px 6px;
  background-image: linear-gradient(var(--mark-color, #c7e1e7), var(--mark-color, #c7e1e7));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.form-info__heading mark.is-highlighted {
  background-size: 100% 100%;
  transition: background-size 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.form-info__sub {
  font-size: 0.95rem;
  color: var(--color-text-light, #555);
  font-style: normal;
  margin: 1.2rem auto 0;
  max-width: 360px;
  text-align: center;
}

/* Contact items */
.form-info__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1.5rem);
  align-items: center;
}

.form-info__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--color-text-light, #555);
  text-decoration: none;
  transition: color 0.2s var(--ease-out, ease);
}

a.form-info__item:hover {
  color: var(--color-primary, #03788d);
}

.form-info__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0.1em;
  color: var(--color-primary, #03788d);
  opacity: 1;
}

/* Social links */
.form-info__social {
  display: flex;
  gap: var(--space-sm, 1rem);
  margin-top: var(--space-sm, 1rem);
}

.form-info__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  color: var(--color-text-light, #555);
  transition: border-color 0.2s, color 0.2s;
}

.form-info__social a:hover {
  border-color: var(--color-primary, #03788d);
  color: var(--color-primary, #03788d);
}

.form-info__social svg {
  width: 16px;
  height: 16px;
}

/* ─── Right panel (form fields, teal tint edge-to-edge) ─── */
.form-fields {
  flex: 1;
  background: rgba(199, 225, 231, 0.55);
  padding: clamp(2rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-fields form,
.form-fields .form-success {
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--space-lg, 2.5rem);
  border-radius: var(--card-border-radius, 20px);
}

/* ─── Pill selector ─── */
.form-pills__label {
  font-size: 0.85rem;
  font-weight: var(--fw-semibold, 600);
  color: #0a2540;
  margin-bottom: 0.6rem;
}

.form-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs, 0.5rem);
  margin-bottom: var(--space-md, 1.5rem);
}

.form-pill {
  display: inline-block;
  padding: 0.4rem 1.15rem;
  border: 2px solid var(--color-primary, #03788d);
  border-radius: 50px;
  background: transparent;
  color: var(--color-primary, #03788d);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: var(--fw-semibold, 600);
  cursor: pointer;
  transition: background 0.2s var(--ease-out, ease), color 0.2s var(--ease-out, ease), transform 0.15s var(--ease-out, ease);
  -webkit-user-select: none;
  user-select: none;
}

.form-pill:hover {
  background: rgba(3, 120, 141, 0.08);
  transform: translateY(-1px);
}

.form-pill.is-active {
  background: var(--color-primary, #03788d);
  color: #ffffff;
}

/* ─── Form rows ─── */
.form-row {
  display: flex;
  gap: var(--space-md, 1.5rem);
}

.form-row > .form-group {
  flex: 1;
}

/* ─── Form group (label + input) ─── */
.form-group {
  margin-bottom: var(--space-sm, 1.2rem);
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-primary, #03788d);
  margin-bottom: 0.3rem;
}

.form-label--optional::after {
  content: ' (optioneel)';
  font-weight: var(--fw-regular, 400);
  opacity: 0.6;
  font-size: 0.78rem;
}

/* ─── Inputs & textarea (underline style) ─── */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid #e0e0e0;
  padding: 0.55rem 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  color: var(--color-text, #1a1a1a);
  background: transparent;
  outline: none;
  transition: border-color 0.25s var(--ease-out, ease);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #aaa;
  font-size: 0.88rem;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-bottom-color: var(--color-primary, #03788d);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.2rem;
}

/* ─── Validation error state ─── */
.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
  border-bottom-color: #d32f2f;
}

.form-group.has-error .form-label {
  color: #d32f2f;
}

.form-error {
  display: none;
  font-size: 0.75rem;
  color: #d32f2f;
  margin-top: 0.25rem;
}

.form-group.has-error .form-error {
  display: block;
}

/* ─── Submit button ─── */
.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 2rem;
  margin-top: var(--space-xs, 0.8rem);
  border: none;
  border-radius: 50px;
  background: #0a2540;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: var(--fw-semibold, 600);
  cursor: pointer;
  transition: background 0.25s var(--ease-out, ease), transform 0.2s var(--ease-out, ease), box-shadow 0.2s var(--ease-out, ease);
}

.form-submit:hover {
  background: var(--color-primary, #03788d);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(3, 120, 141, 0.25);
}

.form-submit:active {
  transform: translateY(0);
}

.form-submit svg {
  width: 18px;
  height: 18px;
}

.form-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Submit spinner ─── */
.form-submit__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: form-spin 0.6s linear infinite;
}

@keyframes form-spin {
  to { transform: rotate(360deg); }
}

/* ─── Global form error (server-side) ─── */
.form-error--global {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

/* ─── Success feedback ─── */
.form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg, 3rem) var(--space-md, 2rem);
  flex: 1;
}

.form-success.is-visible {
  display: flex;
}

.form-success__icon {
  width: 64px;
  height: 64px;
  color: var(--color-primary, #03788d);
  margin-bottom: var(--space-sm, 1.2rem);
}

.form-success__title {
  font-size: 1.5rem;
  font-weight: var(--fw-bold, 700);
  color: #0a2540;
  margin: 0 0 0.5rem;
}

.form-success__text {
  font-size: 0.95rem;
  color: var(--color-text-light, #555);
  margin: 0 0 var(--space-md, 1.5rem);
  max-width: 360px;
  line-height: 1.5;
}

.form-success__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-primary, #03788d);
  text-decoration: none;
  transition: opacity 0.2s;
}

.form-success__link:hover {
  opacity: 0.7;
}

/* ─── Pill error state ─── */
.form-pills.has-error {
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(211, 47, 47, 0.04);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.form-pills__error {
  display: none;
  font-size: 0.75rem;
  color: #d32f2f;
  margin-top: 0.25rem;
}

.form-pills.has-error + .form-pills__error {
  display: block;
}

/* ─── Order sections container ─── */
.order-sections {
  margin-bottom: 0;
}

/* ─── Individual order section (hidden by default) ─── */
.order-section {
  display: none;
  border-left: 3px solid var(--color-primary, #03788d);
  background: rgba(199, 225, 231, 0.18);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.2rem;
  margin-bottom: var(--space-sm, 1rem);
  animation: fadeSlideIn 0.25s ease both;
}

.order-section.is-visible {
  display: block;
}

.order-section.has-error {
  border-left-color: #d32f2f;
  background: rgba(211, 47, 47, 0.04);
}

.order-section__title {
  font-size: 0.85rem;
  font-weight: var(--fw-bold, 700);
  color: var(--color-primary, #03788d);
  margin: 0 0 0.6rem;
  text-transform: capitalize;
}

.order-section.has-error .order-section__title {
  color: #d32f2f;
}

/* ─── Leerjaar checkboxes ─── */
.order-section__leerjaren {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.order-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-text, #1a1a1a);
  padding: 0.3rem 0.9rem 0.3rem 0.6rem;
  border: 2px solid #d0d0d0;
  border-radius: 50px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.order-checkbox:has(input:checked) {
  border-color: var(--color-primary, #03788d);
  background: rgba(3, 120, 141, 0.06);
}

.order-checkbox input[type="checkbox"] {
  accent-color: var(--color-primary, #03788d);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Order line (hidden by default, shown when leerjaar checked) ─── */
.order-line {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  animation: fadeSlideIn 0.2s ease both;
}

.order-line.is-visible {
  display: flex;
  flex-wrap: wrap;
}

/* ─── Leerjaar group (wraps variant checks + order lines) ─── */
.order-leerjaar-group {
  display: none;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  animation: fadeSlideIn 0.2s ease both;
}

.order-leerjaar-group.is-visible {
  display: block;
}

.order-leerjaar-group__title {
  font-size: 0.8rem;
  font-weight: var(--fw-bold, 700);
  color: var(--color-text, #1a1a1a);
  margin: 0 0 0.4rem;
}

.order-leerjaar-group.has-error {
  background: rgba(211, 47, 47, 0.04);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
}

/* ─── Variant checkboxes (NL / TTO) ─── */
.order-variant-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.order-variant-checks .order-checkbox {
  font-size: 0.78rem;
  padding: 0.2rem 0.7rem 0.2rem 0.5rem;
  border-width: 1.5px;
}

.order-variant-checks .order-checkbox input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

.order-line__label {
  font-size: 0.8rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-text-light, #555);
  min-width: 70px;
  flex-shrink: 0;
}

.order-line__count {
  width: 90px !important;
  flex: 0 0 90px;
  font-size: 0.85rem !important;
}

.order-line__radios {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.order-line__radios .form-radio {
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem 0.25rem 0.55rem;
}

.order-line__radios .form-radio input[type="radio"] {
  width: 13px;
  height: 13px;
}

/* Error within an order line */
.order-line.has-error .order-line__count {
  border-bottom-color: #d32f2f;
}

.order-line .form-error {
  width: 100%;
  display: none;
}

.order-line.has-error .form-error {
  display: block;
}

/* ─── Definitief / Indicatief status group (hidden by default) ─── */
.order-status-group {
  display: none;
  margin-top: var(--space-xs, 0.5rem);
  margin-bottom: var(--space-md, 1.5rem);
  animation: fadeSlideIn 0.25s ease both;
}

.order-status-group.is-visible {
  display: block;
}

/* ─── Training format radio group ─── */
.form-training-format {
  display: none;
  margin-bottom: var(--space-md, 1.5rem);
}

.form-training-format.is-visible {
  display: block;
  animation: fadeSlideIn 0.2s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-text, #1a1a1a);
  padding: 0.35rem 1rem 0.35rem 0.75rem;
  border: 2px solid transparent;
  border-radius: 50px;
  transition: border-color 0.2s, background 0.2s;
}

.form-radio:has(input:checked) {
  border-color: var(--color-primary, #03788d);
  background: rgba(3, 120, 141, 0.06);
}

.form-radio input[type="radio"] {
  accent-color: var(--color-primary, #03788d);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 768px) {
  .form-section {
    flex-direction: column;
    min-height: auto;
  }

  .form-info {
    flex: none;
    padding: calc(var(--header-height, 60px) + var(--space-md, 1.5rem)) var(--space-md, 1.5rem) var(--space-md, 1.5rem);
    gap: var(--space-sm, 1rem);
  }

  .form-info__heading {
    font-size: 1.5rem;
  }

  .form-info__contact {
    margin-top: var(--space-xs, 0.5rem);
  }

  .form-info__social {
    margin-top: 0;
  }

  .form-fields {
    padding: var(--space-md, 1.5rem);
  }

  .form-fields form,
  .form-fields .form-success {
    padding: var(--space-md, 1.5rem);
    border-radius: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .order-line.is-visible {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .order-line__count {
    width: 100% !important;
    flex: 1 1 100%;
  }

  .order-line__radios {
    width: 100%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .form-info {
    padding: calc(var(--header-height, 60px) + var(--space-sm, 1rem)) var(--space-sm, 1rem) var(--space-sm, 1rem);
  }

  .form-info__heading {
    font-size: 1.3rem;
  }

  .form-fields {
    padding: var(--space-sm, 1rem);
  }

  .form-fields form,
  .form-fields .form-success {
    padding: var(--space-sm, 1rem);
    border-radius: 12px;
  }

  .form-pill {
    font-size: 0.76rem;
    padding: 0.35rem 0.9rem;
  }

  .form-submit {
    font-size: 0.88rem;
    padding: 0.8rem 1.5rem;
  }

  .form-success {
    padding: var(--space-md, 2rem) var(--space-sm, 1rem);
  }
}
