/* ===============================
   Base: Login form + generic inputs
   =============================== */

#user-login-form {
  max-width: 500px;
  margin: 0 auto;
  padding: 50px 0;
}

form input[type="text"],
form input[type="password"],
form input[type="email"] {
  height: 40px;
  padding: 0 10px;
  border: 3px solid var(--purple);
  font: inherit;
  box-sizing: border-box;
}

/* ===============================
   Newsletter (Webform) wrapper
   =============================== */

.webform-submission-form {
  background: var(--purple);
  margin: 0 auto;
  max-width: 700px;
  width: calc(100% - 40px);
  color: #fff;
}

.webform-submission-form h2 {
  text-align: center;
}

.webform-submission-form .js-form-item {
  margin-bottom: 10px;
}

/* Text + Email fields */
.webform-submission-form .js-form-item input[type="text"],
.webform-submission-form .js-form-item input[type="email"] {
  border: 0;
  border-radius: 100px;
  padding: 35px 20px;
  width: 100%;
  display: block;
  box-sizing: border-box;
  font: inherit;
}

/* ===============================
   Newsletter: Checkbox group
   =============================== */

.webform-submission-form .js-form-item.js-form-type-checkbox {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  align-items: flex-start;
}

/* Custom checkbox — scoped to newsletter only */
.webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 35px;
  height: 35px;
  border: 3px solid #fff;
  border-radius: 4px;
  background: var(--purple);
  display: grid;
  place-content: center;
  cursor: pointer;
  vertical-align: middle;
  outline: none;
  transition: box-shadow .15s, background .15s, border-color .15s, transform .15s;
  accent-color: var(--green); /* harmless fallback if native renders */
}

/* Tick mark */
.webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 20px;
  border-right: 4px solid var(--purple);
  border-bottom: 4px solid var(--purple);
  transform: scale(0) rotate(45deg);
  transform-origin: bottom left;
  transition: transform .1s ease;
}

/* Checked state */
.webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

.webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]:checked::before {
  transform: translate(-5px, -12px) scale(1) rotate(45deg);
}

/* Disabled */
.webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* Description next to checkbox */
.webform-submission-form .js-form-item .description {
  font-size: 14px;
  color: #fff;
  width: calc(100% - 70px);
}

.webform-submission-form .js-form-item .description a {
  color: #fff;
  text-decoration: underline;
}

.webform-submission-form .js-form-item .description a:hover {
  color: var(--green);
}

/* ===============================
   Actions / button
   =============================== */

.webform-submission-form .form-actions {
  display: flex;
  justify-content: center;
  margin: 40px auto 0;
  text-align: center;
}

.webform-submission-form .form-actions .button {
  background-color: var(--green);
  border-radius: 100px;
  color: var(--purple);
  border: none;
  padding: 25px;
  width: 100%;
  max-width: 500px;
  font-size: 20px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.webform-submission-form .form-actions .button:hover {
  background-color: #fff;
  color: var(--purple);
}

/* ===============================
   Accessible focus styles (global)
   =============================== */

/* Strong, visible outline */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
a[href]:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* Fallback for browsers without :focus-visible */
input:focus,
textarea:focus,
select:focus,
button:focus,
[role="button"]:focus,
a[href]:focus {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* Optionally highlight a whole field group */
.field:focus-within {
  outline: 3px solid #000;
  outline-offset: 4px;
}

.webform-confirmation__message {
  padding: 20px;
  text-align: center;
}

@media (min-width: 769px) {
  .webform-submission-form .js-form-item.js-form-type-checkbox label {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      border: 0 !important;
  }
}

@media (max-width: 768px) {
  .webform-submission-form .js-form-item.js-form-type-checkbox {
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 30px;
  }
  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"] {
    width: 25px;
    height: 25px;
  }

  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]::before {
    width: 8px;
    height: 13px;
  }

  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]:checked::before {
    transform: translate(-4px, -10px) scale(1) rotate(45deg);
  }

  .webform-submission-form .js-form-item .description {
    width: calc(100% - 0px);
  }
}

/* High-contrast/Windows */
@media (forced-colors: active) {
  :focus,
  :focus-visible {
    outline: 2px solid CanvasText;
  }
  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"] {
    border: 1px solid ButtonText;
    forced-color-adjust: none;
    background: Canvas;
  }
  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]:checked {
    border-color: ButtonText;
    background: Canvas; /* keep system colors */
  }
  .webform-submission-form .js-form-item.js-form-type-checkbox input[type="checkbox"]::before {
    border-right-color: ButtonText;
    border-bottom-color: ButtonText;
  }
}
