/* ---------------------------------------------------------------
   Mobile signature modal — Gravity Forms form 11 / field 37
   2026-07-28

   Background: the Signature Add-On uses signature_pad and manages
   canvas.width itself on the window 'resize' event:

     canvas.width = containerWidth (capped at the field Box Width)
     signaturePad.fromData(signaturePad.toData())   // replays strokes

   So the canvas must never get a CSS width or height. A CSS size that
   disagrees with the width attribute makes signature_pad map touch
   coordinates into the wrong space and the ink lands offset from the
   finger. Set the container width, then dispatch 'resize'.
   --------------------------------------------------------------- */

#field_11_37 .gfield_signature_container {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	display: flex;
	justify-content: center;
	overflow: hidden;
	/* The container itself must carry NO padding and NO border: the add-on
	   does canvas.width = parseInt(getComputedStyle(container).width), and
	   that returns the BORDER-BOX width, so any padding/border here would
	   make the canvas wider than the space it has. Room for the canvas' own
	   2px border is made on the parent instead (see below). */
}

/* Makes room for the 2px dashed border the canvas draws around itself, so
   canvas + border lands exactly on the available width instead of 4px over. */
#field_11_37 .gfield_signature_ui_container {
	padding: 0 2px;
	box-sizing: border-box;
}

#field_11_37 .gfield_signature_container canvas {
	width: auto !important;
	height: auto !important;
	max-width: none !important;
	display: block;
	/* signature_pad sets this itself; restated so a stray theme rule
	   cannot re-enable panning on the drawing surface. */
	touch-action: none;
}

#field_11_37 [id$="_toolbar"] {
	width: 100% !important;
	max-width: 100% !important;
}

/* Host that stays in the form while the field is on loan to the modal */
#field_11_37 .znd-sig-inline {
	position: relative;
}

/* Transparent tap target over the inline canvas, so the opening tap
   never becomes a stray dot on the signature. Mobile only. */
#field_11_37 .znd-sig-open {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

#field_11_37 .znd-sig-open:focus-visible {
	/* !important is required: the theme sets button { outline: none !important } */
	outline: 2px solid #cf2a2a !important;
	outline-offset: 2px;
}

/* ---------------------------- modal ---------------------------- */

#znd-sig-modal-11-37 {
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	/* No scroll surface anywhere in the modal: nothing can pan under the
	   finger, and a second touch cannot start a scroll while drawing. */
	overflow: hidden;
	touch-action: none;
	overscroll-behavior: none;
}

#znd-sig-modal-11-37::backdrop {
	background: rgba(10, 51, 98, 0.6);
}

#znd-sig-modal-11-37 .znd-sig-modal__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1rem;
	box-sizing: border-box;
	gap: 1rem;
	overflow: hidden;
	touch-action: none;
}

#znd-sig-modal-11-37 .znd-sig-modal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex: 0 0 auto;
}

#znd-sig-modal-11-37 .znd-sig-modal__title {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.3;
	color: #0a3362;
}

/* Mirrors the site's .btn-form: navy pill, white label, 16px/400.
   min-height stays 44px for the touch-target minimum, which .btn-form itself
   does not reach. */
#znd-sig-modal-11-37 .znd-sig-modal__close {
	flex: 0 0 auto;
	min-width: 44px;
	min-height: 44px;
	padding: 10px 28px;
	border: none;
	border-radius: 100px;
	background-color: #0a3362;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: normal;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
}

#znd-sig-modal-11-37 .znd-sig-modal__close:hover {
	background-color: #cf2a2a;
}

#znd-sig-modal-11-37 .znd-sig-modal__close:focus-visible {
	/* !important is required: the theme sets button { outline: none !important }.
	   Brand red reads against both the navy button and the white panel. */
	outline: 2px solid #cf2a2a !important;
	outline-offset: 3px;
}

#znd-sig-modal-11-37 .znd-sig-modal__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
}

#znd-sig-modal-11-37 .znd-sig-modal__hint {
	flex: 0 0 auto;
	margin: 0;
	font-size: 0.875rem;
	color: rgba(10, 51, 98, 0.7);
}

/* -------------------------- page lock -------------------------- */

html.znd-sig-locked {
	overflow: hidden;
	overscroll-behavior: none;
}

/* position:fixed halts any in-flight iOS momentum scroll. `top` is set
   inline to -scrollY so the page stays visually put. The dialog is in the
   top layer, so it is positioned against the viewport regardless. */
body.znd-sig-locked {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}

/* Desktop: the modal must never engage. */
@media (min-width: 783px) and (pointer: fine) {
	#field_11_37 .znd-sig-open {
		display: none !important;
	}
}
