/*
 * Panos Tours: the booking and contact forms and their pages (page-book.php, page-contact.php, a destination's booking).
 * Quiet: one wine2 surface, square corners, hairline fields, the lamp only on the send button and the focus ring.
 * Fields are 48px tall with 18px text (iOS does not zoom into a field with 16px or more).
 */

:root {
	--alert: #F2ACA4; /* error text and the border of a field with an error: 7.4:1 on wine2 */
}

/* ---------- The booking and contact pages ---------- */
.pt-formpage { padding-block: 72px 24px; }
.pt-formpage__head { margin-bottom: 40px; }
.pt-formpage__title { max-width: 18ch; }
.pt-formpage__head .pt-prose, .pt-formpage__head .pt-lead { margin-top: 18px; color: var(--mute); }
.pt-formpage__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
	gap: 48px 64px;
	align-items: start;
}
.pt-formpage__main { max-width: 760px; }
.pt-formpage__asidetitle { font-size: clamp(24px, 2.4vw, 28px); margin-bottom: 16px; }
.pt-formpage__aside { padding-top: 4px; }
.pt-formpage__aside > p { color: var(--mute); margin-bottom: 16px; max-width: 34ch; }
.pt-formpage__aside .pt-contact { display: grid; gap: 4px; }
.pt-formpage__book { margin-top: 24px; }
.pt-formpage--contact .pt-formpage__main > h2 { margin-bottom: 20px; }

@media (max-width: 899px) {
	.pt-formpage__grid { grid-template-columns: minmax(0, 1fr); }
	.pt-formpage__aside { padding-top: 0; border-top: 1px solid var(--line); padding-block-start: 32px; }
}
@media (max-width: 599px) {
	.pt-formpage { padding-top: 48px; }
}

/* ---------- The form ---------- */
.pt-formbox { max-width: 760px; }

.pt-form {
	padding: 36px 40px 32px;
	background: var(--wine2);
	border: 1px solid var(--line);
}
.pt-form__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.pt-form__group + .pt-form__group { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--line); }
/* float: the legend leaves the fieldset's border, so the rule above the second group runs above its title, not through it. */
.pt-form__legend {
	float: left;
	width: 100%;
	padding: 0;
	margin-bottom: 20px;
	font-family: var(--serif);
	font-size: 24px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--marble);
}
.pt-form__legend + * { clear: both; }
.pt-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }

.pt-field { margin: 0 0 22px; min-width: 0; }
.pt-field > label, .pt-field > legend {
	display: block;
	margin-bottom: 8px;
	padding: 0;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--marble);
}
.pt-field__opt { font-weight: 400; color: var(--mute); }
.pt-field__hint { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: var(--mute); }

.pt-form input[type="text"],
.pt-form input[type="email"],
.pt-form input[type="tel"],
.pt-form input[type="date"],
.pt-form input[type="time"],
.pt-form select,
.pt-form textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	background: var(--wine);
	border: 1px solid var(--line);
	border-radius: 0;
	color: var(--marble);
	font-size: 18px;
	line-height: 1.4;
	transition: border-color .15s var(--ease);
}
.pt-form textarea { min-height: 96px; resize: vertical; }
.pt-form input:hover, .pt-form select:hover, .pt-form textarea:hover { border-color: var(--mute); }
.pt-form input:focus-visible, .pt-form select:focus-visible, .pt-form textarea:focus-visible { outline-offset: 1px; border-color: var(--marble); }
/* Keyboard and mouse alike: a field being typed in always shows where the caret is. */
.pt-form input:focus, .pt-form select:focus, .pt-form textarea:focus { outline: 3px solid var(--lamp); outline-offset: 1px; }
.pt-form ::placeholder { color: var(--mute); opacity: .8; }

/* Date and time: the browser's own pickers, in their dark scheme; an empty value still shows the field's format. */
.pt-form input[type="date"], .pt-form input[type="time"] { color-scheme: dark; -webkit-appearance: none; appearance: none; }
.pt-form input[type="date"]::-webkit-date-and-time-value, .pt-form input[type="time"]::-webkit-date-and-time-value { text-align: left; }

.pt-form select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23EFE9E4' stroke-width='1.6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}
.pt-form optgroup { font-style: normal; font-weight: 700; color: var(--mute); background: var(--wine); }
.pt-form option { color: var(--marble); background: var(--wine); font-weight: 400; }

/* The route box opens under the select with the own-route panel's lamp edge. */
.pt-field--route { padding-left: 18px; border-left: 3px solid var(--lamp); }

/* Radios and the consent box: big enough to hit with a thumb (44px rows). */
.pt-field--choice { margin: 0 0 22px; padding: 0; border: 0; }
.pt-choices { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.pt-choice, .pt-field--check { display: flex; align-items: flex-start; gap: 12px; }
.pt-choice { min-height: 44px; align-items: center; }
.pt-choice label { padding-block: 8px; cursor: pointer; }
.pt-form input[type="radio"], .pt-form input[type="checkbox"] {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--lamp);
	cursor: pointer;
}
.pt-field--check { flex-wrap: wrap; margin-top: 8px; }
.pt-field--check input[type="checkbox"] { margin-top: 3px; }
.pt-field--check label { flex: 1 1 0; min-width: 0; font-size: 16px; line-height: 1.5; color: var(--marble-soft); cursor: pointer; }
.pt-field--check label a { color: var(--marble); }
.pt-field--check .pt-field__err { flex-basis: 100%; padding-left: 34px; }

/* Errors: the text under the field and the field's border, never colour alone (the text always says what is wrong). */
.pt-field__err { margin-top: 8px; font-size: 16px; line-height: 1.4; color: var(--alert); }
.pt-field.is-invalid input:not([type="radio"]):not([type="checkbox"]),
.pt-field.is-invalid select,
.pt-field.is-invalid textarea { border-color: var(--alert); }

/* The honeypot: off-screen for people, still in the form for bots. */
.pt-hp {
	position: absolute !important;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pt-form__send { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
.pt-form__submit { min-width: 14em; }
.pt-form__submit[aria-disabled="true"] { opacity: .75; cursor: progress; }
.pt-form__note { font-size: 15px; color: var(--mute); max-width: 36ch; }

.pt-form__status [data-pt-status-text]:empty { display: none; }
.pt-form__status [data-pt-status-text] { margin-top: 20px; font-size: 17px; line-height: 1.5; }
.pt-form__status [data-kind="error"] { color: var(--alert); }
.pt-form__status [data-pt-status-call] { margin-top: 14px; }

.pt-form__noscript { margin-bottom: 20px; padding: 14px 18px; border-left: 3px solid var(--lamp); color: var(--marble); }

/* ---------- After sending ---------- */
.pt-done {
	padding: 36px 40px;
	background: var(--wine2);
	border-left: 3px solid var(--lamp);
}
.pt-done:focus { outline: none; }
.pt-done:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
.pt-done__title { font-size: clamp(28px, 3vw, 36px); font-weight: 300; }
.pt-done__text { margin-top: 14px; font-size: 19px; line-height: 1.55; max-width: 56ch; }
.pt-done__more { margin-top: 18px; color: var(--mute); max-width: 56ch; }
.pt-done .pt-contact { margin-top: 14px; display: grid; gap: 4px; }

/* ---------- Phones ---------- */
@media (max-width: 599px) {
	.pt-form { padding: 24px 20px; margin-inline: calc(-1 * var(--gutter)); border-inline: 0; }
	.pt-done { padding: 28px 20px; }
	.pt-form__row { grid-template-columns: minmax(0, 1fr); }
	.pt-form__submit { width: 100%; }
	.pt-choices { flex-direction: column; gap: 0; }
}
