/*
 * BOJ Maintenance Mode — built-in visitor screens.
 *
 * Five designs share one markup:
 *   header.bojmm-brand · main.bojmm-main > (.bojmm-lead: heading) + (.bojmm-body: message, countdown, form) · footer
 * Each design sets colour variables and, where it needs to, its own layout.
 * Poppins is the site's font and is expected to be available already.
 * Text colours meet WCAG AA contrast on their own background.
 */

/* Midnight (default): brand blue, white text, gold frames. */
:root,
.bojmm-theme-midnight {
	--bojmm-bg: #036;
	--bojmm-text: #fff;
	--bojmm-heading: #fff;
	--bojmm-muted: rgba(255, 255, 255, 0.82);
	--bojmm-faint: rgba(255, 255, 255, 0.7); /* 6.9:1 on #036 */
	--bojmm-box-bg: rgba(255, 255, 255, 0.04);
	--bojmm-box-border: #fc3;
	--bojmm-box-border-width: 1.5px;
	--bojmm-box-radius: 16px;
	--bojmm-num: #fff;
	--bojmm-num-weight: 700;
	--bojmm-dot: #fc3;
	--bojmm-input-bg: rgba(255, 255, 255, 0.06);
	--bojmm-input-border: rgba(255, 255, 255, 0.45);
	--bojmm-input-text: #fff;
	--bojmm-button-bg: #fc3;
	--bojmm-button-text: #036;
	--bojmm-focus: #fc3;
	--bojmm-error: #ffb4a8;
	--bojmm-check: #fc3;
	--bojmm-box: clamp(64px, 17vw, 128px);
}

/* Ledger: split layout — brand blue panel with the headline, white panel with the details. */
.bojmm-theme-ledger {
	--bojmm-bg: #fff;
	--bojmm-text: #1d2b3a;
	--bojmm-heading: #fff;
	--bojmm-muted: #3d4f63; /* 8.4:1 on white */
	--bojmm-faint: #55667a; /* 5.9:1 */
	--bojmm-box-bg: #fff;
	--bojmm-box-border: #d5dde8;
	--bojmm-box-border-width: 1px;
	--bojmm-box-radius: 12px;
	--bojmm-num: #036;
	--bojmm-num-weight: 600;
	--bojmm-dot: #9fb2c8;
	--bojmm-input-bg: #fff;
	--bojmm-input-border: #7d8a99;
	--bojmm-input-text: #1d2b3a;
	--bojmm-button-bg: #036;
	--bojmm-button-text: #fff;
	--bojmm-focus: #036;
	--bojmm-error: #b42318;
	--bojmm-check: #036;
	--bojmm-box: clamp(58px, 6.4vw, 96px);
}

/* Paper: editorial — warm paper, left-aligned type, hairline rules, typeset numbers. */
.bojmm-theme-paper {
	--bojmm-bg: #f6f3ee;
	--bojmm-text: #1a1a1a;
	--bojmm-heading: #141414;
	--bojmm-muted: #4a4640;
	--bojmm-faint: #67625a;
	--bojmm-rule: #d9d3c7;
	--bojmm-num: #141414;
	--bojmm-num-weight: 300;
	--bojmm-input-bg: #fffdf9;
	--bojmm-input-border: #8c867b;
	--bojmm-input-text: #1a1a1a;
	--bojmm-button-bg: #1a1a1a;
	--bojmm-button-text: #f6f3ee;
	--bojmm-focus: #2f5d50;
	--bojmm-error: #a3251a;
	--bojmm-check: #2f5d50;
}

/* Graphite: dark, minimal card on a dot grid. */
.bojmm-theme-graphite {
	--bojmm-bg: #0e1013;
	--bojmm-text: #f2f4f7;
	--bojmm-heading: #f7f8fa;
	--bojmm-muted: #b3b9c3;
	--bojmm-faint: #8d94a0;
	--bojmm-box-bg: #15181d;
	--bojmm-box-border: #2a2f37;
	--bojmm-box-border-width: 1px;
	--bojmm-box-radius: 14px;
	--bojmm-num: #f7f8fa;
	--bojmm-num-weight: 500;
	--bojmm-dot: #7aa2ff;
	--bojmm-input-bg: #0b0d10;
	--bojmm-input-border: #4a505b;
	--bojmm-input-text: #f2f4f7;
	--bojmm-button-bg: #f2f4f7;
	--bojmm-button-text: #0e1013;
	--bojmm-focus: #7aa2ff;
	--bojmm-error: #ff9b8f;
	--bojmm-check: #7aa2ff;
	--bojmm-box: clamp(60px, 14vw, 104px);
}

/* Horizon: light and calm, line icon and a soft landscape. */
.bojmm-theme-horizon {
	--bojmm-bg: #e9f1fa;
	--bojmm-text: #0f2a4a;
	--bojmm-heading: #0f2a4a;
	--bojmm-muted: #3b5372;
	--bojmm-faint: #4b627e;
	--bojmm-box-bg: #fff;
	--bojmm-box-border: #dbe6f2;
	--bojmm-box-border-width: 1px;
	--bojmm-box-radius: 16px;
	--bojmm-num: #0f2a4a;
	--bojmm-num-weight: 600;
	--bojmm-dot: #7ea6d6;
	--bojmm-input-bg: #fff;
	--bojmm-input-border: #8197b2;
	--bojmm-input-text: #0f2a4a;
	--bojmm-button-bg: #0f2a4a;
	--bojmm-button-text: #fff;
	--bojmm-focus: #2f6db5;
	--bojmm-error: #b42318;
	--bojmm-check: #2f6db5;
	--bojmm-box: clamp(60px, 15vw, 112px);
}

/* ------------------------------------------------------------------------
 * Shared layout (centred column)
 * --------------------------------------------------------------------- */

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

html,
body {
	margin: 0;
}

body {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 32px 16px 24px;
	background: var(--bojmm-bg);
	color: var(--bojmm-text);
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	text-align: center;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

body > * {
	position: relative;
	z-index: 1;
}

a {
	color: inherit;
}

.bojmm-brand {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--bojmm-heading);
}

.bojmm-brand a {
	text-decoration: none;
}

.bojmm-brand img {
	display: block;
	max-width: 200px;
	max-height: 56px;
	width: auto;
	height: auto;
}

/* Dark designs: a dark logo would vanish, so show it as a white silhouette
   (Page Access → Settings → Logo on the built-in screen). */
.bojmm-brand--white img {
	filter: brightness(0) invert(1);
}

.bojmm-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 760px;
	padding: 48px 0;
}

.bojmm-lead,
.bojmm-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.bojmm-heading {
	margin: 0 0 16px;
	font-size: clamp(36px, 7vw, 68px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--bojmm-heading);
	text-wrap: balance;
}

.bojmm-message {
	max-width: 520px;
	color: var(--bojmm-muted);
	font-size: clamp(15px, 2.2vw, 17px);
	text-wrap: pretty;
}

.bojmm-message p {
	margin: 0 0 1em;
}

.bojmm-message > :last-child {
	margin-bottom: 0;
}

/* Countdown */

.bojmm-countdown {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: clamp(6px, 2vw, 16px);
	margin: clamp(32px, 6vw, 56px) 0 0;
}

.bojmm-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.bojmm-box {
	display: grid;
	place-items: center;
	width: var(--bojmm-box);
	height: calc(var(--bojmm-box) * 1.08);
	border: var(--bojmm-box-border-width) solid var(--bojmm-box-border);
	border-radius: var(--bojmm-box-radius);
	background: var(--bojmm-box-bg);
}

.bojmm-num {
	font-size: calc(var(--bojmm-box) * 0.5);
	font-weight: var(--bojmm-num-weight);
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--bojmm-num);
}

.bojmm-unit-label {
	font-size: clamp(10px, 1.6vw, 12px);
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--bojmm-faint);
}

.bojmm-sep {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	height: calc(var(--bojmm-box) * 1.08);
}

.bojmm-sep::before,
.bojmm-sep::after {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--bojmm-dot);
	opacity: 0.85;
}

.bojmm-until {
	margin: 24px 0 0;
	font-size: 14px;
	color: var(--bojmm-faint);
}

/* Password form */

.bojmm-form {
	width: 100%;
	max-width: 440px;
	margin: 36px 0 0;
	text-align: start;
}

.bojmm-form label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 500;
}

.bojmm-field {
	display: flex;
	gap: 10px;
}

.bojmm-field input {
	flex: 1;
	min-width: 0;
	padding: 13px 16px;
	font: inherit;
	color: var(--bojmm-input-text);
	background: var(--bojmm-input-bg);
	border: 1px solid var(--bojmm-input-border);
	border-radius: 10px;
}

.bojmm-field input:focus {
	outline: 2px solid var(--bojmm-focus);
	outline-offset: 2px;
	border-color: transparent;
}

.bojmm-field input[aria-invalid="true"] {
	border-color: var(--bojmm-error);
}

.bojmm-field button {
	padding: 13px 24px;
	font: inherit;
	font-weight: 600;
	color: var(--bojmm-button-text);
	background: var(--bojmm-button-bg);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.bojmm-field button:hover {
	filter: brightness(1.08);
}

.bojmm-field button:focus-visible {
	outline: 2px solid var(--bojmm-focus);
	outline-offset: 2px;
}

.bojmm-error {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--bojmm-error);
}

.bojmm-remember {
	display: flex !important;
	gap: 10px;
	align-items: center;
	margin: 16px 0 0 !important;
	font-weight: 400 !important;
	cursor: pointer;
}

.bojmm-remember input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--bojmm-check);
}

.bojmm-cookie-note {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--bojmm-faint);
}

.bojmm-cookie-note a {
	color: var(--bojmm-text);
}

.bojmm-footer {
	font-size: 13px;
	color: var(--bojmm-faint);
}

/* Room for the real/visitor switch when previewing (the switch adds its own spacer). */
body.has-flip {
	padding-bottom: 16px;
}

/* ------------------------------------------------------------------------
 * Ledger — split screen
 * --------------------------------------------------------------------- */

.bojmm-theme-ledger .bojmm-heading::after {
	content: "";
	display: block;
	width: 64px;
	height: 4px;
	margin-top: 28px;
	border-radius: 2px;
	background: #fc3;
}

.bojmm-theme-ledger .bojmm-box {
	box-shadow: inset 0 -3px 0 #fc3, 0 1px 2px rgba(0, 51, 102, 0.06);
}

@media (min-width: 900px) {
	body.bojmm-theme-ledger {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: auto 1fr auto;
		align-items: stretch;
		padding: 0;
		background: linear-gradient(90deg, #036 50%, #fff 50%);
		text-align: left;
	}

	.bojmm-theme-ledger .bojmm-main {
		display: contents;
	}

	.bojmm-theme-ledger .bojmm-brand {
		grid-column: 1;
		grid-row: 1;
		padding: 40px clamp(32px, 5vw, 72px) 0;
		color: #fff;
	}

	.bojmm-theme-ledger .bojmm-lead {
		grid-column: 1;
		grid-row: 2;
		align-self: center;
		align-items: flex-start;
		width: auto;
		padding: 0 clamp(32px, 5vw, 72px);
	}

	.bojmm-theme-ledger .bojmm-heading {
		margin: 0;
		font-size: clamp(40px, 4.4vw, 72px);
		text-align: left;
	}

	.bojmm-theme-ledger .bojmm-body {
		grid-column: 2;
		grid-row: 1 / span 3;
		align-self: center;
		align-items: flex-start;
		width: auto;
		max-width: 640px;
		padding: 56px clamp(32px, 5vw, 72px);
		text-align: left;
	}

	.bojmm-theme-ledger .bojmm-message {
		font-size: 18px;
	}

	.bojmm-theme-ledger .bojmm-countdown {
		justify-content: flex-start;
		margin-top: 40px;
	}

	.bojmm-theme-ledger .bojmm-footer {
		grid-column: 1;
		grid-row: 3;
		padding: 0 clamp(32px, 5vw, 72px) 36px;
		color: rgba(255, 255, 255, 0.72);
	}
}

@media (max-width: 899px) {
	body.bojmm-theme-ledger {
		padding: 0 0 24px;
	}

	.bojmm-theme-ledger .bojmm-brand,
	.bojmm-theme-ledger .bojmm-lead {
		width: 100%;
		background: #036;
		color: #fff;
	}

	.bojmm-theme-ledger .bojmm-brand {
		padding: 28px 20px 0;
	}

	.bojmm-theme-ledger .bojmm-main {
		justify-content: flex-start;
		max-width: none;
		padding: 0 0 40px;
	}

	.bojmm-theme-ledger .bojmm-lead {
		padding: 40px 20px 44px;
	}

	.bojmm-theme-ledger .bojmm-heading {
		margin: 0;
	}

	.bojmm-theme-ledger .bojmm-heading::after {
		margin: 22px auto 0;
	}

	.bojmm-theme-ledger .bojmm-body {
		padding: 36px 20px 0;
	}
}

/* ------------------------------------------------------------------------
 * Paper — editorial
 * --------------------------------------------------------------------- */

body.bojmm-theme-paper {
	align-items: stretch;
	padding: 36px clamp(20px, 8vw, 120px) 28px;
	text-align: left;
}

.bojmm-theme-paper .bojmm-brand {
	padding-bottom: 18px;
	border-bottom: 1px solid var(--bojmm-rule);
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bojmm-theme-paper .bojmm-main {
	align-items: flex-start;
	max-width: 820px;
	padding: clamp(56px, 12vh, 140px) 0 56px;
}

.bojmm-theme-paper .bojmm-lead,
.bojmm-theme-paper .bojmm-body {
	align-items: flex-start;
}

.bojmm-theme-paper .bojmm-heading {
	margin-bottom: 24px;
	font-size: clamp(42px, 7vw, 84px);
	font-weight: 600;
	line-height: 1.02;
	letter-spacing: -0.035em;
}

.bojmm-theme-paper .bojmm-message {
	max-width: 560px;
	font-size: clamp(16px, 2.2vw, 19px);
}

.bojmm-theme-paper .bojmm-countdown {
	justify-content: flex-start;
	gap: 0;
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--bojmm-rule);
}

.bojmm-theme-paper .bojmm-unit {
	align-items: flex-start;
	gap: 6px;
	margin-right: clamp(18px, 4vw, 40px);
	padding-right: clamp(18px, 4vw, 40px);
	border-right: 1px solid var(--bojmm-rule);
}

.bojmm-theme-paper .bojmm-unit:last-child {
	margin-right: 0;
	padding-right: 0;
	border-right: 0;
}

.bojmm-theme-paper .bojmm-box {
	display: block;
	width: auto;
	height: auto;
	border: 0;
	background: none;
}

.bojmm-theme-paper .bojmm-num {
	font-size: clamp(40px, 7vw, 80px);
	letter-spacing: -0.04em;
}

.bojmm-theme-paper .bojmm-unit-label {
	letter-spacing: 0.14em;
}

.bojmm-theme-paper .bojmm-sep {
	display: none;
}

.bojmm-theme-paper .bojmm-until {
	margin-top: 18px;
}

.bojmm-theme-paper .bojmm-field input,
.bojmm-theme-paper .bojmm-field button {
	border-radius: 4px;
}

.bojmm-theme-paper .bojmm-footer {
	padding-top: 18px;
	border-top: 1px solid var(--bojmm-rule);
}

/* ------------------------------------------------------------------------
 * Graphite — card on a dot grid
 * --------------------------------------------------------------------- */

body.bojmm-theme-graphite {
	background:
		radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0) 0 0 / 24px 24px,
		radial-gradient(60% 50% at 50% 0%, rgba(122, 162, 255, 0.12), transparent 70%),
		#0e1013;
}

.bojmm-theme-graphite .bojmm-main {
	flex: 0 1 auto;
	max-width: 680px;
	margin: auto 0;
	padding: clamp(40px, 6vw, 64px) clamp(22px, 5vw, 56px);
	border: 1px solid #262a31;
	border-radius: 22px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)), #111317;
	box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bojmm-theme-graphite .bojmm-heading {
	font-size: clamp(32px, 5.4vw, 54px);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.bojmm-theme-graphite .bojmm-countdown {
	margin-top: 40px;
}

.bojmm-theme-graphite .bojmm-box {
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bojmm-theme-graphite .bojmm-unit-label {
	letter-spacing: 0.16em;
}

/* ------------------------------------------------------------------------
 * Horizon — light, line icon, landscape
 * --------------------------------------------------------------------- */

body.bojmm-theme-horizon {
	padding-bottom: clamp(80px, 14vw, 180px);
	background: linear-gradient(180deg, #e9f1fa 0%, #f5f8fc 55%, #fff 100%);
}

body > .bojmm-landscape {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	width: 100%;
	height: clamp(90px, 16vw, 220px);
	pointer-events: none;
}

.bojmm-theme-horizon .bojmm-art {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	margin-bottom: 28px;
	border-radius: 50%;
	background: #fff;
	color: #2f6db5;
	box-shadow: 0 10px 30px -12px rgba(15, 42, 74, 0.35), inset 0 0 0 1px #dbe6f2;
}

.bojmm-theme-horizon .bojmm-art svg {
	width: 34px;
	height: 34px;
}

.bojmm-theme-horizon .bojmm-heading {
	font-weight: 600;
	letter-spacing: -0.025em;
}

.bojmm-theme-horizon .bojmm-box {
	box-shadow: 0 1px 2px rgba(15, 42, 74, 0.05), 0 12px 28px -16px rgba(15, 42, 74, 0.35);
}

.bojmm-theme-horizon .bojmm-footer {
	color: #2c4560; /* Readable over the landscape. */
}

/* ------------------------------------------------------------------------
 * Small screens and motion
 * --------------------------------------------------------------------- */

@media (max-width: 480px) {
	.bojmm-main {
		padding: 32px 0;
	}

	.bojmm-field {
		flex-direction: column;
	}

	.bojmm-unit {
		gap: 10px;
	}

	.bojmm-unit-label {
		letter-spacing: 0.12em;
	}

	.bojmm-sep {
		gap: 6px;
	}

	.bojmm-sep::before,
	.bojmm-sep::after {
		width: 4px;
		height: 4px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.bojmm-lead,
	.bojmm-body {
		animation: bojmm-rise 0.5s ease both;
	}

	.bojmm-body {
		animation-delay: 0.08s;
	}

	/* Movement only — never opacity — so content is fully visible even where
	   animations don't run (background tabs, link-preview bots, screenshot tools). */
	@keyframes bojmm-rise {
		from {
			transform: translateY(8px);
		}
	}
}
