/* CG_PRIVACY_TERMS_CHECKBOX_CONFLICT_FIX_V2 */

/*
  The theme has broad rules:
  .field.choice > input[type="checkbox"] { position:absolute; clip... }
  .field.choice .label::before { fake checkbox... }

  This override intentionally uses the same fake-checkbox approach, but scoped
  only to the create-account privacy/terms checkbox so it stays next to the terms text.
*/

html body.customer-account-create form#form-validate .privacy-container-customer,
html body.customer-account-create form.form-create-account .privacy-container-customer {
  box-sizing: border-box !important;
  clear: both !important;
  display: block !important;
  float: none !important;
  grid-column: 1 / -1 !important;
  margin: 22px 0 18px !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  position: relative !important;
  transform: none !important;
  width: 100% !important;
}

html body.customer-account-create form#form-validate .privacy-container-customer > .field.choice,
html body.customer-account-create form#form-validate .privacy-container-customer .field.choice,
html body.customer-account-create form.form-create-account .privacy-container-customer > .field.choice,
html body.customer-account-create form.form-create-account .privacy-container-customer .field.choice {
  align-items: start !important;
  background:
    linear-gradient(135deg, rgba(45, 51, 127, .045), rgba(212, 175, 55, .10)) !important;
  border: 1px solid rgba(45, 51, 127, .13) !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 28px rgba(31, 35, 71, .055) !important;
  box-sizing: border-box !important;
  clear: both !important;
  display: grid !important;
  float: none !important;
  gap: 12px !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow: visible !important;
  padding: 16px 18px !important;
  position: relative !important;
  transform: none !important;
  width: 100% !important;
}

/* Keep the real checkbox accessible/clickable, but invisible over the fake box. */
html body.customer-account-create form#form-validate .privacy-container-customer input#account_create_privacy_condition,
html body.customer-account-create form.form-create-account .privacy-container-customer input#account_create_privacy_condition {
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  clip: auto !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
  cursor: pointer !important;
  display: block !important;
  float: none !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  height: 24px !important;
  left: 18px !important;
  margin: 0 !important;
  max-height: 24px !important;
  max-width: 24px !important;
  min-height: 24px !important;
  min-width: 24px !important;
  opacity: 0 !important;
  outline: none !important;
  overflow: visible !important;
  padding: 0 !important;
  pointer-events: auto !important;
  position: absolute !important;
  right: auto !important;
  top: 16px !important;
  transform: none !important;
  visibility: visible !important;
  white-space: normal !important;
  width: 24px !important;
  z-index: 5 !important;
}

/* The label is the visible row. */
html body.customer-account-create form#form-validate .privacy-container-customer label[for="account_create_privacy_condition"],
html body.customer-account-create form.form-create-account .privacy-container-customer label[for="account_create_privacy_condition"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  clear: none !important;
  color: rgba(31, 35, 71, .84) !important;
  cursor: pointer !important;
  display: block !important;
  float: none !important;
  font-family: var(--cg-font, "Inter", "Helvetica Neue", sans-serif) !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  height: auto !important;
  letter-spacing: 0 !important;
  line-height: 1.55 !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  opacity: 1 !important;
  overflow: visible !important;
  padding: 0 !important;
  position: static !important;
  text-align: left !important;
  text-transform: none !important;
  transform: none !important;
  user-select: none !important;
  vertical-align: top !important;
  white-space: normal !important;
  width: 100% !important;
}

/* Override the generic .field.choice .label::before fake checkbox and anchor it inside the terms card. */
html body.customer-account-create form#form-validate .privacy-container-customer label[for="account_create_privacy_condition"]::before,
html body.customer-account-create form.form-create-account .privacy-container-customer label[for="account_create_privacy_condition"]::before {
  background: #fff !important;
  border: 2px solid #2d337f !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05) inset !important;
  box-sizing: border-box !important;
  content: "" !important;
  display: block !important;
  float: none !important;
  height: 22px !important;
  left: 18px !important;
  margin: 0 !important;
  min-height: 22px !important;
  min-width: 22px !important;
  opacity: 1 !important;
  padding: 0 !important;
  position: absolute !important;
  top: 17px !important;
  transform: none !important;
  width: 22px !important;
  z-index: 2 !important;
}

html body.customer-account-create form#form-validate .privacy-container-customer input#account_create_privacy_condition:checked + label[for="account_create_privacy_condition"]::before,
html body.customer-account-create form.form-create-account .privacy-container-customer input#account_create_privacy_condition:checked + label[for="account_create_privacy_condition"]::before {
  background:
    #b89b65
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 10.5 8 14.5 16 6'/%3E%3C/svg%3E")
    center / 72% 72%
    no-repeat !important;
  border-color: #b89b65 !important;
}

html body.customer-account-create form#form-validate .privacy-container-customer input#account_create_privacy_condition:focus-visible + label[for="account_create_privacy_condition"]::before,
html body.customer-account-create form.form-create-account .privacy-container-customer input#account_create_privacy_condition:focus-visible + label[for="account_create_privacy_condition"]::before {
  box-shadow:
    0 0 0 4px rgba(212, 175, 55, .25),
    0 1px 3px rgba(0, 0, 0, .05) inset !important;
}

/* Kill any generic after-checkmark from older CSS. */
html body.customer-account-create form#form-validate .privacy-container-customer label[for="account_create_privacy_condition"]::after,
html body.customer-account-create form.form-create-account .privacy-container-customer label[for="account_create_privacy_condition"]::after {
  content: none !important;
  display: none !important;
}

html body.customer-account-create form#form-validate .privacy-container-customer .mb-tooltip,
html body.customer-account-create form.form-create-account .privacy-container-customer .mb-tooltip,
html body.customer-account-create form#form-validate .privacy-container-customer .cg-terms-prefix,
html body.customer-account-create form.form-create-account .privacy-container-customer .cg-terms-prefix {
  color: rgba(31, 35, 71, .84) !important;
  display: inline !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  line-height: 1.55 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  white-space: normal !important;
}

html body.customer-account-create form#form-validate .privacy-container-customer a,
html body.customer-account-create form.form-create-account .privacy-container-customer a {
  color: #2d337f !important;
  display: inline !important;
  font-weight: 950 !important;
  position: static !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* Keep privacy validation attached to the terms row. */
html body.customer-account-create form#form-validate .privacy-container-customer .mage-error,
html body.customer-account-create form#form-validate .privacy-container-customer .field-error,
html body.customer-account-create form.form-create-account .privacy-container-customer .mage-error,
html body.customer-account-create form.form-create-account .privacy-container-customer .field-error {
  color: #b3261e !important;
  display: block !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  grid-column: 2 !important;
  line-height: 1.45 !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  position: static !important;
  white-space: normal !important;
}

/* Explicitly prevent any checkbox/pseudo-box from appearing in password fields. */
html body.customer-account-create form#form-validate .field.password input[type="checkbox"],
html body.customer-account-create form#form-validate .field.confirmation input[type="checkbox"],
html body.customer-account-create form.form-create-account .field.password input[type="checkbox"],
html body.customer-account-create form.form-create-account .field.confirmation input[type="checkbox"] {
  display: none !important;
  visibility: hidden !important;
}

html body.customer-account-create form#form-validate .field.password .label::before,
html body.customer-account-create form#form-validate .field.password .label::after,
html body.customer-account-create form#form-validate .field.confirmation .label::before,
html body.customer-account-create form#form-validate .field.confirmation .label::after,
html body.customer-account-create form.form-create-account .field.password .label::before,
html body.customer-account-create form.form-create-account .field.password .label::after,
html body.customer-account-create form.form-create-account .field.confirmation .label::before,
html body.customer-account-create form.form-create-account .field.confirmation .label::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 600px) {
  html body.customer-account-create form#form-validate .privacy-container-customer .field.choice,
  html body.customer-account-create form.form-create-account .privacy-container-customer .field.choice {
    border-radius: 16px !important;
    padding: 14px 15px !important;
  }

  html body.customer-account-create form#form-validate .privacy-container-customer label[for="account_create_privacy_condition"]::before,
  html body.customer-account-create form.form-create-account .privacy-container-customer label[for="account_create_privacy_condition"]::before {
    left: 15px !important;
    top: 15px !important;
  }

  html body.customer-account-create form#form-validate .privacy-container-customer input#account_create_privacy_condition,
  html body.customer-account-create form.form-create-account .privacy-container-customer input#account_create_privacy_condition {
    left: 15px !important;
    top: 14px !important;
  }
}
