/*
 * MM DB application forms: layout only. Colours, fonts and field styling come
 * from the site theme (The7), so the forms match the rest of the site.
 * Everything is scoped under .mmdb-apply.
 */

.mmdb-apply {
	--mmdb-accent: #db7223;
	--mmdb-error: #c0392b;
	--mmdb-error-bg: #fdf1ef;
	--mmdb-notice-bg: #fff6e5;
	--mmdb-muted-bg: #f4f4f4;
	max-width: 1170px;
	margin: 0 auto;
}

.mmdb-apply *,
.mmdb-apply *::before,
.mmdb-apply *::after {
	box-sizing: border-box;
}

.mmdb-intro {
	padding: 32px;
	margin-bottom: 32px;
	background: var(--mmdb-muted-bg);
	border-radius: 6px;
}

.mmdb-intro h2 {
	margin-top: 0;
}

.mmdb-intro .mmdb-no-ai {
	padding: 12px 16px;
	border: 2px solid var(--mmdb-error);
	border-radius: 4px;
	background: var(--mmdb-error-bg);
	color: var(--mmdb-error);
	font-size: 1.15em;
}

.mmdb-intro .mmdb-in-game-date {
	margin-bottom: 0;
}

.mmdb-section {
	margin: 40px 0 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(51, 51, 51, 0.11);
}

.mmdb-section small {
	font-size: 60%;
	font-weight: normal;
	opacity: 0.75;
}

/* Two columns: label and help on the left, the input on the right. */
.mmdb-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 8px 32px;
	padding: 16px 0;
	border-bottom: 1px solid rgba(51, 51, 51, 0.06);
}

.mmdb-row--wide {
	grid-template-columns: minmax(0, 1fr);
}

.mmdb-row__input input[type="text"],
.mmdb-row__input input[type="date"],
.mmdb-row__input select,
.mmdb-row__input textarea {
	width: 100%;
	max-width: 100%;
}

.mmdb-row__input textarea {
	min-height: 12em;
	resize: vertical;
}

.mmdb-label {
	display: block;
	margin: 0 0 4px;
	font-weight: 600;
}

.mmdb-help,
.mmdb-help p {
	font-size: 0.95em;
}

.mmdb-help p:first-child {
	margin-top: 0;
}

.mmdb-required {
	color: var(--mmdb-error);
}

.mmdb-check {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.mmdb-check input {
	margin-top: 0.3em;
	flex: none;
}

.mmdb-prompt {
	margin: 0 0 12px;
	padding: 12px 16px;
	border-left: 4px solid var(--mmdb-accent);
	background: var(--mmdb-muted-bg);
	font-style: normal;
}

.mmdb-requirements {
	padding: 8px 12px;
	background: var(--mmdb-notice-bg);
	border-radius: 2px;
}

.mmdb-readout {
	margin: 6px 0 0;
	font-weight: 600;
}

.mmdb-readout.is-error,
.mmdb-error {
	margin: 6px 0 0;
	color: var(--mmdb-error);
	font-weight: 600;
}

.mmdb-notice {
	margin: 6px 0 0;
	padding: 6px 10px;
	background: var(--mmdb-notice-bg);
}

/* Fields with a problem. */
.mmdb-row--invalid input,
.mmdb-row--invalid select,
.mmdb-row--invalid textarea {
	border-color: var(--mmdb-error) !important;
}

.mmdb-error-summary {
	margin: 0 0 24px;
	padding: 16px 20px;
	border: 2px solid var(--mmdb-error);
	background: var(--mmdb-error-bg);
	border-radius: 4px;
}

.mmdb-error-summary ul {
	margin-bottom: 0;
}

/* The theme has no focus style for fields; keyboard users need one. */
.mmdb-apply input:focus-visible,
.mmdb-apply select:focus-visible,
.mmdb-apply textarea:focus-visible,
.mmdb-apply button:focus-visible,
.mmdb-apply a:focus-visible,
.mmdb-error-summary:focus-visible {
	outline: 2px solid var(--mmdb-accent);
	outline-offset: 2px;
}

/* Honeypot: invisible to people, still filled in by bots. */
.mmdb-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Only first years see the sorting hat and wand chooser (set by forms.js). */
.mmdb-first-year-only.is-hidden {
	display: none;
}

.mmdb-dresscode {
	margin: 16px 0;
}

.mmdb-dresscode__thumb {
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.mmdb-dresscode__thumb img {
	display: block;
	max-width: 320px;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.mmdb-dialog {
	max-width: min(1024px, 95vw);
	padding: 0;
	border: 0;
	border-radius: 6px;
}

.mmdb-dialog::backdrop {
	background: rgba(0, 0, 0, 0.7);
}

.mmdb-dialog img {
	display: block;
	max-width: 100%;
	height: auto;
}

.mmdb-dialog__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.mmdb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	margin-top: 32px;
}

.mmdb-submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* Phones: one column. */
@media (max-width: 767px) {
	.mmdb-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.mmdb-intro {
		padding: 20px;
	}
}
