/* ---- Fix: Chrome autofill blue tint on inputs ---- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px white inset !important;
  -webkit-text-fill-color: #000 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---- Fix: custom checkbox with checkmark ---- */
input[type="checkbox"].checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid #9ca3af;
  border-radius: 0.25rem;
  background-color: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

input[type="checkbox"].checkbox:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

input[type="checkbox"].checkbox:checked::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.1rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- Fix: Alpine x-cloak flash prevention ---- */
[x-cloak] {
  display: none !important;
}


/* checkbox styling */


.agreement-box {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.agreement-box.has-error {
  border-color: #f87171;
  background-color: #fef2f2;
}

.agreement-label {
  display: flex;
  align-items: center;   /* was flex-start */
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.82rem;    /* smaller, fits narrow form better */
  line-height: 1.35;
  user-select: none;
}

/* Hide the real checkbox but keep it accessible */
.agreement-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.agreement-checkmark {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0;         /* remove offset now that we're center-aligned */
  border: 2px solid #9ca3af;
  border-radius: 0.3rem;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.agreement-checkbox:checked + .agreement-checkmark {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

/* Draw checkmark with CSS only, animated */
.agreement-checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.agreement-checkbox:checked + .agreement-checkmark::after {
  transform: rotate(45deg) scale(1);
}

.agreement-checkbox:focus-visible + .agreement-checkmark {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.agreement-checkbox:active + .agreement-checkmark {
  transform: scale(0.9);
}

.agreement-text a {
  color: #1d4ed8;
  text-decoration: none;
}
.agreement-text a:hover {
  text-decoration: underline;
}

/* Smooth height animation without JS measuring anything */
.agreement-error {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.agreement-error > p {
  overflow: hidden;
  min-height: 0;
  color: #dc2626;
  font-size: 0.8rem;
  margin: 0;
  padding-top: 0;
}
.agreement-box.has-error .agreement-error {
  grid-template-rows: 1fr;
}
.agreement-box.has-error .agreement-error > p {
  padding-top: 0.4rem;
}

/* little shake when they try to submit without checking */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.agreement-box.shake {
  animation: shake 0.4s ease;
}











