/*
 * Styling for the things this plugin puts on the page.
 *
 * It lives here rather than in a theme on purpose: the gate notices and
 * the contact form are this plugin's output, so they must look right
 * whatever theme is active. Storefront, a child theme, or a replacement
 * theme years from now - none of them should have to know about this.
 */

.dentiquip-gate-notice {
	display: block;
	padding: 0.75em 1em;
	margin: 0 0 1em;
	border-left: 4px solid #1f5f7a;
	background: #f4f8fa;
	color: #23282d;
	font-size: 0.95em;
	line-height: 1.5;
}

.dentiquip-gate-notice a {
	font-weight: 600;
}

/* Contact form ------------------------------------------------------- */

.dentiquip-contact-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.dentiquip-contact-form input[type="text"],
.dentiquip-contact-form input[type="email"],
.dentiquip-contact-form input[type="tel"],
.dentiquip-contact-form textarea {
	width: 100%;
	max-width: 34em;
}

.dentiquip-contact-form .required {
	color: #8a2424;
}

.dentiquip-form-error {
	padding: 0.75em 1em;
	margin: 0 0 1em;
	border-left: 4px solid #8a2424;
	background: #fdf4f4;
}

/* Belt and braces: the field also carries an inline style, so it stays
   hidden even if this file fails to load. */
.dentiquip-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0;
	overflow: hidden;
}

.dentiquip-contact-details {
	list-style: none;
	margin-left: 0;
	padding-left: 0;
}

.dentiquip-contact-details li {
	margin-bottom: 0.35em;
}

/* The front page supplies its own H1, so the theme's page title just
   repeats "Home" above it. */
.home.page .entry-header .entry-title {
	display: none;
}

/* Course enrolment page ---------------------------------------------- */

.dentiquip-course-image img {
	max-width: 100%;
	height: auto;
}

.dentiquip-course-facts {
	list-style: none;
	margin: 1.5em 0;
	padding: 1em 1.25em;
	border-left: 4px solid #1f5f7a;
	background: #f4f8fa;
}

.dentiquip-course-facts li {
	margin: 0 0 0.4em;
}

.dentiquip-course-facts li:last-child {
	margin-bottom: 0;
}

.dentiquip-course-seats {
	font-weight: 600;
	color: #8a6116;
}

.dentiquip-course-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.dentiquip-course-form input[type="text"],
.dentiquip-course-form select {
	width: 100%;
	max-width: 30em;
}

.dentiquip-course-form .required {
	color: #8a2424;
}

.dentiquip-course-note {
	font-size: 0.9em;
	color: #555;
}

/* Lab cases ---------------------------------------------------------- */

.dentiquip-lab-form .dq-field {
	margin: 0 0 1.5em;
}

.dentiquip-lab-form fieldset.dq-field {
	border: 0;
	padding: 0;
	/* A fieldset is otherwise as wide as its content, which pushes the
	   page sideways on a phone. */
	min-width: 0;
}

.dentiquip-lab-form label,
.dentiquip-lab-form legend,
.dentiquip-lab-form .dq-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.dentiquip-lab-form .required {
	color: #8a2424;
}

.dentiquip-lab-form input[type="text"],
.dentiquip-lab-form input[type="number"],
.dentiquip-lab-form input[type="date"],
.dentiquip-lab-form select,
.dentiquip-lab-form textarea {
	width: 100%;
	max-width: 30em;
}

.dentiquip-lab-form input[type="number"] {
	max-width: 7em;
}

.dentiquip-lab-form [hidden] {
	display: none !important;
}

/* Restoration choice: large tap targets on a phone. */
.dq-types {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(10em, 100%), 1fr));
	gap: 0.5em;
	max-width: 36em;
}

.dentiquip-lab-form .dq-type {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0;
	padding: 0.6em 0.8em;
	border: 1px solid #c3cfd6;
	border-radius: 4px;
	font-weight: 400;
	cursor: pointer;
}

.dq-type:has(input:checked) {
	border-color: #1f5f7a;
	background: #f4f8fa;
	font-weight: 600;
}

/* Tooth chart. */
.dq-teeth {
	display: inline-block;
	max-width: 100%;
	overflow-x: auto;
	padding: 0.5em 0;
}

.dq-teeth-row {
	display: flex;
	align-items: center;
	gap: 0.5em;
	white-space: nowrap;
}

.dq-teeth-row + .dq-teeth-row {
	border-top: 2px solid #1f5f7a;
	padding-top: 0.25em;
	margin-top: 0.25em;
}

.dq-teeth-arch {
	width: 3.5em;
	font-size: 0.85em;
	color: #555;
}

.dq-teeth-half {
	display: inline-flex;
	gap: 2px;
}

.dq-teeth-half + .dq-teeth-half {
	border-left: 2px solid #1f5f7a;
	padding-left: 0.4em;
}

/* On a phone each jaw takes two lines: the patient's right, then left. */
@media (max-width: 40em) {
	.dq-teeth-row {
		flex-wrap: wrap;
		white-space: normal;
	}

	.dq-teeth-arch {
		width: 100%;
		font-weight: 600;
	}

	.dq-teeth-half + .dq-teeth-half {
		border-left: 0;
		padding-left: 0;
	}
}

.dentiquip-lab-form .dq-tooth {
	display: inline-block;
	position: relative;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
}

.dq-tooth input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.dq-tooth span {
	display: inline-block;
	min-width: 2.2em;
	padding: 0.35em 0;
	text-align: center;
	border: 1px solid #c3cfd6;
	border-radius: 3px;
	font-size: 0.85em;
}

.dq-tooth input:checked + span {
	background: #1f5f7a;
	border-color: #1f5f7a;
	color: #fff;
	font-weight: 600;
}

.dq-tooth input:focus-visible + span {
	outline: 2px solid #1f5f7a;
	outline-offset: 1px;
}

/* Uploads. */
.dentiquip-lab-form .dq-upload-pick {
	display: inline-block;
	position: relative;
	overflow: hidden;
	font-weight: 600;
}

.dq-upload-pick input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.dq-upload-list {
	list-style: none;
	margin: 0.75em 0 0;
	padding: 0;
	max-width: 36em;
}

.dq-upload-list li {
	position: relative;
	padding: 0.5em 0.75em 0.7em;
	margin-bottom: 0.4em;
	border: 1px solid #c3cfd6;
	border-radius: 3px;
	overflow-wrap: anywhere;
}

.dq-upload-name {
	font-weight: 600;
}

.dq-upload-size,
.dq-upload-state {
	font-size: 0.85em;
	color: #555;
}

.dq-upload-list li.is-done {
	border-color: #00694e;
}

.dq-upload-list li.is-done .dq-upload-state {
	color: #00694e;
	font-weight: 600;
}

.dq-upload-list li.is-error {
	border-color: #8a2424;
	background: #fdf4f4;
}

.dq-upload-list li.is-error .dq-upload-state {
	display: block;
	color: #8a2424;
}

.dq-upload-remove {
	float: right;
	padding: 0 0.4em;
	background: none;
	border: 0;
	color: #8a2424;
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.85em;
}

.dq-upload-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: #eef2f4;
}

.dq-upload-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: #1f5f7a;
	transition: width 0.3s;
}

.dq-upload-list li.is-done .dq-upload-bar,
.dq-upload-list li.is-error .dq-upload-bar {
	display: none;
}

.dq-warn {
	color: #8a2424;
}

.dentiquip-lab-form .dq-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.dentiquip-lab-summary th {
	width: 11em;
}

.dentiquip-lab-files {
	margin: 0;
	padding-left: 1.2em;
}
