/* ==========================================================================
   Bayshore Village – Spark Registration Form
   Dark navy styling to match design mockup
   Scoped to #spark-registration-form so it won't leak into the rest of the site
   ========================================================================== */

#spark-registration-form {
  --form-bg:;
  --form-text: #f3f5f8;
  --form-label: rgba(255, 255, 255, 0.8);
  --form-line: rgba(255, 255, 255, 0.25);
  --form-line-focus: #ffffff;
  --form-accent: #4a6d94;
  --form-accent-soft: rgba(255, 255, 255, 0.08);
  --form-radius: 4px;
  --form-input-bg: #2f4257;

  background: var(--form-bg);
  color: var(--form-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 40px;
  border-radius: 10px;
  box-sizing: border-box;
}

#spark-registration-form * {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------
   Two-column grid layout
   .grid and .Agent are "unwrapped" via display:contents so their
   children flow directly into the form-level grid, pairing fields
   two-per-row automatically.
   -------------------------------------------------------------------- */

#spark-registration-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 26px;
  align-items: start;
}

#spark-registration-form > div.grid {
  display: contents;
}

/* Flatten every layout table used purely for structure down to plain blocks */
.grid table,
.grid tbody,
.grid tr,
.grid td,
.answers.row table,
.answers.row tbody,
.answers.row tr,
.answers.row td {
  display: block;
  width: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  border-collapse: collapse;
  background: transparent;
}

/* --------------------------------------------------------------------
   Labels
   -------------------------------------------------------------------- */

#spark-registration-form label {
  display: block;
  font-weight: 400;
  color: var(--form-label);
  margin-bottom: 5px;
  letter-spacing: 0.1px;
}

/* --------------------------------------------------------------------
   Text-like inputs — underline style
   -------------------------------------------------------------------- */

#spark-registration-form input[type="text"],
#spark-registration-form input[type="email"],
#spark-registration-form input[type="tel"],
#spark-registration-form input[type="date"],
#spark-registration-form input[type="number"],
#spark-registration-form input[type="password"] {
  width: 100%;
  background: var(--form-input-bg);
  border: none;
  border-bottom: 1px solid var(--form-line);
  color: var(--form-text);
  font-size: 16px;
  padding: 4px 12px;
  outline: none;
  border-radius: 0;
  transition: border-color 0.15s ease;
}

#spark-registration-form input[type="text"]::placeholder,
#spark-registration-form input[type="email"]::placeholder,
#spark-registration-form input[type="tel"]::placeholder,
#spark-registration-form input[type="number"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

#spark-registration-form input[type="text"]:focus,
#spark-registration-form input[type="email"]:focus,
#spark-registration-form input[type="tel"]:focus,
#spark-registration-form input[type="date"]:focus,
#spark-registration-form input[type="number"]:focus,
#spark-registration-form input[type="password"]:focus {
  border-bottom-color: var(--form-line-focus);
}

/* date input's native calendar icon, tinted for dark background */
#spark-registration-form input[type="date"] {
  color-scheme: dark;
}

/* --------------------------------------------------------------------
   Selects / dropdowns
   -------------------------------------------------------------------- */

#spark-registration-form select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--form-input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFCB61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  border: none;
  border-bottom: 1px solid var(--form-line);
  color: var(--form-text);
  font-size: 16px;
  padding: 4px 12px;
  border-radius: 0;
  cursor: pointer;
  height: 57px;
}

#spark-registration-form select:focus {
  outline: none;
  border-bottom-color: var(--form-line-focus);
}

/* Dark option list where the browser allows styling it */
#spark-registration-form select option {
  background-color: var(--form-bg);
  color: var(--form-text);
}

/* --------------------------------------------------------------------
   Textareas
   -------------------------------------------------------------------- */

#spark-registration-form textarea {
  width: 100%;
  min-height: 160px;
  background: transparent;
  border: 1px solid var(--form-line);
  border-radius: 6px;
  color: var(--form-text);
  font-size: 1rem;
  font-family: inherit;
  padding: 16px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

#spark-registration-form textarea:focus {
  border-color: var(--form-line-focus);
}

/* --------------------------------------------------------------------
   Checkbox / radio "pill" groups
   (Tax ID checkboxes, Non-Resident / Canadian Resident / Foreign Entity
   radios, "Type of home" and "Reason for purchase" checkbox groups)
   -------------------------------------------------------------------- */

.checkbox-radio-table,
.checkbox-radio-table tbody {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.checkbox-radio-container,
.checkbox-radio-table tr {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-radio-cell,
.checkbox-radio-table td {
  display: block;
  width: 48%;
}
.foreign-entity .checkbox-radio-cell {
    width:100%;
}

.multi-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-radio-cell .checkbox,
.answer.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--form-line);
  border-radius: 999px;
}

.checkbox-radio-cell input[type="checkbox"],
.checkbox-radio-cell input[type="radio"],
.answer.checkbox input[type="checkbox"],
#spark-registration-form .multi-wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 0;
  border: 1px solid var(--form-line);
  border-radius: 3px;
  background: transparent;
  display: inline-block;
  position: relative;
  cursor: pointer;
  float: left;
  margin-right:7px;
}

.checkbox-radio-cell input[type="radio"] {
  border-radius: 50%;
}

.checkbox-radio-cell input[type="checkbox"]:checked,
.checkbox-radio-cell input[type="radio"]:checked,
.answer.checkbox input[type="checkbox"]:checked,
#spark-registration-form .multi-wrapper input[type="checkbox"]:checked {
  background: var(--form-accent);
  border-color: var(--form-accent);
}

.checkbox-radio-cell input[type="checkbox"]:checked::after,
.answer.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-radio-cell input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* Inline labels that sit beside a checkbox/radio (not a field label) */
.checkbox-radio-cell label,
.answer.checkbox label,
#spark-registration-form .multi-wrapper label {
  display: inline;
  font-size: 0.9rem;
  color: var(--form-text);
  margin: 0;
  cursor: pointer;
}

.answer-other {
  margin-top: 10px;
}

.answer-other label {
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------
   Custom field widget wrapper cleanup (Tax ID, ID fields, residency, etc.)
   -------------------------------------------------------------------- */

.custom-field-widget {
  width: 100%;
}

.label-text {
  display: block;
  font-size: 0.85rem;
  color: var(--form-label);
  margin-bottom: 8px;
}

.consent, .small-text {
    grid-column: 1 / -1;
}
.consent .dropdown-wrapper { max-width: 90px; }
.small-text { 
    width:100%; 
    font-size:12px; 
    display:block; 
    line-height: 1.2; 
    margin-bottom: 0;
}

/* --------------------------------------------------------------------
   Full-width rows: textareas, checkbox groups, the extra comments field
   -------------------------------------------------------------------- */

.answers.row:has(textarea),
.answers.row:has(.multi-wrapper),
#spark-registration-form > div.form-item:has(#contact_comments) {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------
   For Bedroom selection Pill design
   -------------------------------------------------------------------- */

.pill-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill-input {
  /* visually hide the radio but keep it accessible */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-option {
  cursor: pointer;
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-option:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.pill-input:checked + .pill-option {
  background: #dbeafe;
  border-color: #dbeafe;
  color: #0f1f38!important;
}

.pill-input:focus-visible + .pill-option {
  outline: 2px solid #dbeafe;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------
   Submit button
   -------------------------------------------------------------------- */

#spark-registration-form button.submit {
  grid-column: 1 / -1;
  width: 100%;
  background: transparent;
  border: 1px solid #4092AA;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 16px 24px;
  border-radius: var(--form-radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 8px;
}

#spark-registration-form button.submit:hover {
  background: rgba(255,255,255,0.1);
  color: var(--form-bg);
}

/* --------------------------------------------------------------------
   Hide honeypot / non-visual helper fields
   -------------------------------------------------------------------- */

#spark-registration-form input[name="are_you_simulated"] {
  display: none;
}

/* --------------------------------------------------------------------
   Responsive: single column on small screens
   -------------------------------------------------------------------- */

@media (max-width: 640px) {
  #spark-registration-form {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }

  #spark-registration-form > div.form-item,
  .answers.row,
  #spark-registration-form > div.Agent {
    grid-column: 1 / -1;
  }

  .Agent {
    flex-direction: column;
    gap: 20px;
  }
}