/* =====================================================================
   PIN Gate modal — internal element styling only.
   The modal shell (border-radius, header chrome, close button, body
   padding) is provided by the polished modal layer in
   /add-ons/theme-polish/theme-polish.css. Everything below styles the
   PIN-specific bits inside the body: instructions block, the big PIN
   input, error / success messages, and the submit button.
===================================================================== */

.pep-pin-modal .modal-dialog {
	max-width: 460px;
}

/* Instructions block — soft tinted card matching the polished feel. */
.pep-pin-modal__instructions {
	font-size: 0.95rem;
	line-height: 1.55;
	color: var( --ui-ink );
	background: var( --ui-surface-sunken );
	border: 1px solid var( --ui-border );
	border-radius: var( --ui-radius-sm );
	padding: 0.9rem 1rem;
	margin-bottom: 1.25rem;
}

.pep-pin-modal__instructions p { margin: 0 0 0.5rem; }
.pep-pin-modal__instructions p:last-child { margin-bottom: 0; }
.pep-pin-modal__instructions strong { color: var( --ui-ink ); font-weight: 700; }

.pep-pin-modal__phone-link {
	color: var( --ui-primary );
	font-weight: 700;
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
}

.pep-pin-modal__phone-link:hover,
.pep-pin-modal__phone-link:focus {
	color: var( --ui-primary );
	opacity: 0.85;
}

.pep-pin-modal__form {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

/* The big centered PIN input — letter-spaced for a "code field" feel. */
.pep-pin-modal__input {
	width: 100%;
	padding: 0.9rem 1rem;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0.5em;
	text-align: center;
	color: var( --ui-ink );
	border: 2px solid var( --ui-border );
	border-radius: var( --ui-radius-sm );
	background: var( --ui-surface-sunken );
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pep-pin-modal__input:focus {
	outline: none;
	border-color: var( --ui-primary );
	background: var( --ui-surface );
	box-shadow: 0 0 0 3px rgba( 242, 99, 34, 0.15 );
}

.pep-pin-modal__input::placeholder {
	font-weight: 400;
	letter-spacing: 0.3em;
	color: var( --ui-ink-faint );
}

/* Inline error / success — collapse to zero height when empty so the
   form doesn't shift when the message swaps in. */
.pep-pin-modal__error,
.pep-pin-modal__success {
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0;
	min-height: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.2s ease, padding 0.2s ease;
}

.pep-pin-modal__error.is-visible {
	max-height: 5rem;
	padding: 0.625rem 0.875rem;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var( --ui-radius-sm );
}

.pep-pin-modal__success.is-visible {
	max-height: 5rem;
	padding: 0.625rem 0.875rem;
	color: #15803d;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: var( --ui-radius-sm );
}

/* Submit button — extends Bootstrap btn-primary with a gradient + spinner. */
.pep-pin-modal__submit {
	--bs-btn-padding-y: 0.85rem;
	--bs-btn-padding-x: 1.25rem;
	--bs-btn-font-size: 1rem;
	--bs-btn-font-weight: 700;
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	border-radius: var( --ui-radius-sm );
	background: linear-gradient( 135deg, var( --ui-primary ) 0%, #d14d16 100% );
	border-color: transparent;
	box-shadow: 0 4px 14px rgba( 242, 99, 34, 0.25 );
	transition: opacity 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.pep-pin-modal__submit:hover,
.pep-pin-modal__submit:focus {
	background: linear-gradient( 135deg, #d14d16 0%, #b8410f 100% );
	border-color: transparent;
	box-shadow: 0 6px 18px rgba( 242, 99, 34, 0.35 );
}

.pep-pin-modal__submit:active {
	transform: translateY( 1px );
}

.pep-pin-modal__submit:disabled,
.pep-pin-modal__submit.is-loading {
	opacity: 0.7;
	cursor: wait;
}

/* Spinner — hidden by default, revealed when the button has .is-loading. */
.pep-pin-modal__spinner {
	display: none;
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba( 255, 255, 255, 0.45 );
	border-top-color: #fff;
	border-radius: 50%;
	animation: pep-pin-spin 0.7s linear infinite;
}

.pep-pin-modal__submit.is-loading .pep-pin-modal__spinner { display: inline-block; }
.pep-pin-modal__submit.is-loading .pep-pin-modal__submit-label { opacity: 0.6; }

@keyframes pep-pin-spin {
	to { transform: rotate( 360deg ); }
}
