/*
====================================================
 RetroBeing Registration Form — form.css
 Version: 2.1.3.13
 Last Updated: 2025-11-28

 CHANGELOG (v2.1.3.13):
 - Desktop shared min-height reduced from 510px to 500px.
 - First and surname now full-width rows.
 - Form/steps use flex layout so action buttons sit consistently towards the bottom.
 - "How did you hear about us?" field reserves space for the "Please specify"
   input, and the select grows to use that space when "Other" is not selected.
====================================================
*/

/* layout */
.crf-wrapper {
  display: flex;
  gap: 28px;
  align-items: stretch;
  justify-content: center;
  margin: 28px auto;
  max-width: 1100px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* marketing panel */
.crf-marketing {
  flex: 1 1 0;  /* equal-width column with form */
  background: linear-gradient(180deg,#f6f8fb 0%,#ffffff 100%);
  border-radius: 12px;
  padding: 22px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crf-marketing-inner { width: 100%; }

/* form column */
.crf-form-column {
  flex: 1 1 0;  /* equal-width column with marketing */
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* form card as flex column to help place buttons and bottom info */
.crf-form-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15,20,25,0.06);
  padding: 18px 20px 30px 20px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Desktop: equal height using 500px */
@media (min-width: 900px) {
  .crf-marketing,
  .crf-form-card {
    min-height: 500px;
  }
}

/* form inside card fills available vertical space */
.crf-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* intro */
.crf-intro { margin-bottom: 6px; }
.crf-intro.hidden { display: none; }

.crf-title {
  margin: 0 0 5px 0;
  font-size: 20px;
  line-height: 1.2;
}
.crf-sub {
  margin: 0 0 12px 0;
  color: #6b7280;
  font-size: 13px;
}

/* steps fill remaining space, allow actions to sit at bottom */
.crf-step {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  transition: opacity 200ms ease, transform 200ms ease;
}
.crf-step[aria-hidden="true"] {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transform: translateY(8px);
  pointer-events: none;
}
.crf-step[aria-hidden="false"] {
  opacity: 1;
  height: auto;
  transform: translateY(0);
  pointer-events: auto;
}

/* fields */
.crf-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.crf-field {
  margin-bottom: 6px;
  display: inline-block;
  vertical-align: top;
  width: calc(50% - 5px);
  box-sizing: border-box;
}
.crf-field.full { width: 100%; }

.crf-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: #111827;
}

.crf-field input[type="text"],
.crf-field input[type="email"],
.crf-field input[type="password"],
.crf-field input[type="tel"],
.crf-field textarea,
.crf-field select,
#crf_how_found_other {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
}

/* "How did you hear about us?" field:
   - Always reserves space for the "Please specify" box
*/
.crf-field-how-found {
  min-height: 110px;
  display: flex;
  flex-direction: column;
}

/* base spacing */
#crf_how_found { margin-bottom: 6px; }

/* tall mode: when NOT Other, the select uses more vertical space */
#crf_how_found.crf-select-tall {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* "Other" text box:
   - present in layout, but hidden until "Other" is chosen
*/
#crf_how_found_other {
  margin-top: 4px;
}
#crf_how_found_other.crf-hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  margin-top: 0;
}

/* checkbox and waiver */
.crf-checkbox {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  padding-left: 10px; /* keep checkbox aligned with marketing checkbox */
}
.crf-checkbox input { margin-right: 8px; }

/* marketing opt-in */
.crf-marketing-optin {
  margin: 10px 0 18px 0;
  background: #f7fbff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e6f0fa;
}
.crf-marketing-optin-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.crf-marketing-optin-label input {
  margin-top: 3px;
  flex: 0 0 auto;
}
.crf-marketing-optin-label span {
  display: block;
  flex: 1 1 auto;
}

/* buttons: sit towards the bottom of each step via margin-top:auto */
.crf-actions {
  margin-top: auto;
  margin-bottom: 14px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}
.crf-btn {
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.crf-btn.crf-back {
  background: transparent;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 9px 12px;
}

/* bottom info: questions left (left) and step counter (right) */
.crf-bottom-info {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  pointer-events: none;
}
.crf-bottom-info .crf-questions-left { pointer-events: auto; }
.crf-bottom-info .crf-step-counter { pointer-events: auto; }

/* errors & success */
.crf-error-inline {
  color: #b91c1c;
  background: #fff0f0;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
  font-weight: 600;
}

/* responsive adjustments */
@media (max-width: 900px) {
  .crf-wrapper {
    flex-direction: column;
    gap: 14px;
    padding: 12px;
  }
  .crf-marketing {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    order: -1;
  }
  .crf-form-column { width: 100%; }
  .crf-field { width: 100%; }
  .crf-row {
    flex-direction: column;
    gap: 8px;
  }
  .crf-form-card {
    min-height: 0;
    padding-bottom: 80px;
  }
  .crf-bottom-info {
    position: static;
    margin-top: 10px;
    pointer-events: none;
  }
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.04);
  border-color: #d1d5db;
}
