/*
 * Request dialog.
 *
 * The window itself and the fields inside it. The form is the one the
 * catalogue plugin receives, so the field names are its own; the look is the
 * one the layout draws.
 */

.ukrp-modal {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-items: center;
	padding: 20px;
}

.ukrp-modal[hidden] {
	display: none;
}

/* The layout shows the dialog over a darkened page. The site palette turns
   the system's dim token into a light tint, which leaves nothing to read
   against, so the veil is taken from the ink of the palette instead. */
.ukrp-modal .modal__veil {
	position: absolute;
	inset: 0;
	background: rgba(7, 27, 56, .55);
}

.ukrp-modal .dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: min(460px, 100%);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 11px;
	border-radius: var(--radius-md);
	background: var(--color-surface);
	box-shadow: var(--shadow-lg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 15px;
}

.ukrp-modal .dialog__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.ukrp-modal .dialog__subject {
	margin-bottom: 6px;
}

.ukrp-modal .dialog__subject[hidden] {
	display: none;
}

.ukrp-modal .dialog__title {
	margin: 0;
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: var(--weight-heading);
	line-height: 1.12;
	letter-spacing: -.015em;
}

.ukrp-modal .dialog__form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

.ukrp-modal .field {
	margin: 0;
}

.ukrp-modal .field > label {
	display: block;
	margin-bottom: 5px;
	color: var(--color-muted);
	font-size: 12px;
}

/* Inputs keep a light ground on any background: the typed text has to stay
   readable whatever the strip behind the dialog is. */
.ukrp-modal .input {
	width: 100%;
	min-height: 36px;
	padding: 6px 10px;
	border: 1px solid var(--color-divider);
	border-radius: var(--radius-md);
	background: #ffffff;
	color: #071b38;
	font: inherit;
	font-size: 14px;
	caret-color: var(--color-lime-hover);
}

.ukrp-modal .input::placeholder {
	color: #6b7683;
	opacity: 1;
}

.ukrp-modal .input:hover {
	border-color: rgba(7, 27, 56, .45);
}

.ukrp-modal textarea.input {
	resize: vertical;
}

.ukrp-modal .dialog__message {
	min-height: 70px;
}

.ukrp-modal .dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 6px;
}

/* The answer of the form. The catalogue script writes the text and marks it
   as a success or a failure; until it does, the line takes no room. */
.ukrp-modal .upc-form__note {
	margin: 0;
	font-size: 13px;
}

.ukrp-modal .upc-form__note:empty {
	display: none;
}

.ukrp-modal .upc-form__note.is-ok {
	color: #13612e;
}

.ukrp-modal .upc-form__note.is-error {
	color: #b82105;
}

/* The honeypot is for machines, nobody else is meant to see it. */
.ukrp-modal .upc-form__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* The page behind the dialog stays where it is while the dialog is open. */
html.ukrp-modal-open {
	overflow: hidden;
}
