/* Buddy Public Booking · FULL design - Step 8: Authorisation.
 * The signature capture canvas. */

.bb-content > .bb-authorisation-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 0;
}

.bb-authorisation-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--bb-gray-300);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.bb-authorisation-title {
  margin: 0;
  color: var(--bb-text);
  font-family: inherit !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.bb-authorisation-copy {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--bb-gray-100);
  color: var(--bb-text);
  font-size: 16px;
  line-height: 24px;
}

.bb-signature-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bb-signature-label {
  margin: 0;
  color: var(--bb-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.bb-sign-canvas {
  box-sizing: border-box;
  margin-top: 0 !important;
  border: 1px dashed var(--bb-gray-400);
  border-radius: 12px;
  width: 100%;
  height: 168px;
  touch-action: none;
  background: var(--bb-gray-100);
  color: var(--bb-gray-800);
  cursor: crosshair;
  display: block;
  transition: border-color .15s ease, background-color .15s ease;
}
.bb-sign-canvas:hover { border-color: #2f5bea; }
.bb-sign-canvas.is-invalid { border-color: var(--bb-danger); }
.bb-sign-canvas:focus-visible { outline: 3px solid rgba(47, 91, 234, .3); outline-offset: 2px; }

.bb-signature-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}
.bb-signature-help {
  margin: 0;
  color: #747886;
  font-size: 12px;
  line-height: 16px;
}
.bb-signature-tools .bb-authorisation-error { flex: 1; }
.bb-signature-tools .bb-btn { margin-top: 0 !important; margin-left: auto; }
.bb-authorisation-card .bb-btn-sm {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.bb-authorisation-agreement-field { display: flex; flex-direction: column; gap: 6px; }
.bb-authorisation-agreement {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--bb-text);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}
.bb-authorisation-checkbox {
  position: relative;
  display: inline-flex;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.bb-wrap .bb-authorisation-agreement input {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px var(--bb-gray-400) !important;
  cursor: pointer !important;
}
.bb-wrap .bb-authorisation-agreement input:checked {
  background: #2f5bea !important;
  box-shadow: none !important;
}
.bb-wrap .bb-authorisation-agreement input.is-invalid { box-shadow: inset 0 0 0 1px var(--bb-danger) !important; }
.bb-wrap .bb-authorisation-agreement input:focus-visible { outline: 3px solid rgba(47, 91, 234, .3) !important; outline-offset: 2px; }
.bb-authorisation-checkmark {
  position: absolute;
  inset: 0;
  display: none;
  padding: 2px;
  color: #fff;
  pointer-events: none;
}
.bb-authorisation-checkmark svg { display: block; width: 100%; height: 100%; }
.bb-wrap .bb-authorisation-agreement input:checked + .bb-authorisation-checkmark { display: flex !important; }

.bb-authorisation-error {
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--bb-danger);
  font-size: 12px;
  line-height: 16px;
}
.bb-authorisation-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.bb-authorisation-card .bb-server-error { margin: 0; }
.bb-wrap.bb-on-authorisation .bb-footer { margin-top: 24px; }

@media (max-width: 560px) {
  .bb-authorisation-card { padding: 16px; }
  .bb-signature-tools { align-items: flex-start; flex-wrap: wrap; }
  .bb-signature-tools .bb-btn { margin-left: 0; }
}
