/*
 * MOP Core — minimal default styles.
 *
 * Everything reads theme tokens with fallbacks so the `mop` theme can restyle
 * by defining: --mop-primary, --mop-primary-contrast, --mop-surface,
 * --mop-surface-alt, --mop-text, --mop-muted, --mop-border, --mop-danger,
 * --mop-success, --mop-radius, --mop-font, --mop-font-mono.
 * Selectors are intentionally low-specificity (single class).
 */

/* ---------- Age gate ---------- */
html.mop-agegate-open,
body.mop-agegate-open {
	overflow: hidden;
}

.mop-agegate {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--mop-overlay, rgba(10, 24, 28, 0.72));
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.mop-agegate__panel {
	box-sizing: border-box;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: clamp(20px, 5vw, 36px);
	border-radius: var(--mop-radius, 12px);
	background: var(--mop-surface, #ffffff);
	color: var(--mop-text, #14262b);
	font-family: var(--mop-font, inherit);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.mop-agegate__panel:focus {
	outline: none;
}

.mop-agegate__title {
	margin: 0 0 12px;
	font-size: 1.5rem;
	line-height: 1.25;
	color: inherit;
}

.mop-agegate__body {
	margin: 0 0 20px;
	line-height: 1.6;
}

.mop-agegate__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.mop-agegate__note {
	margin: 16px 0 0;
	font-size: 0.875rem;
	color: var(--mop-muted, #5a6b70);
}

/* ---------- Buttons (fallback; theme owns .mop-btn) ---------- */
.mop-agegate .mop-btn,
.mop-form .mop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid var(--mop-primary, #376B79);
	border-radius: var(--mop-radius-button, 999px);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.mop-agegate .mop-btn--primary,
.mop-form .mop-btn--primary {
	background: var(--mop-primary, #376B79);
	color: var(--mop-primary-contrast, #ffffff);
}

.mop-agegate .mop-btn--ghost {
	background: transparent;
	color: var(--mop-primary, #376B79);
}

.mop-agegate .mop-btn:focus-visible,
.mop-form .mop-btn:focus-visible,
.mop-interac__copy:focus-visible {
	outline: 3px solid var(--mop-focus, #f0b429);
	outline-offset: 2px;
}

/* ---------- Interac instructions ---------- */
.mop-interac {
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var(--mop-border, #d9e3e6);
	border-radius: var(--mop-radius, 12px);
	background: var(--mop-surface-alt, #f5f9fa);
}

.mop-interac__title {
	margin: 0 0 8px;
}

.mop-interac__rows {
	margin: 16px 0;
}

.mop-interac__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 10px 0;
	border-top: 1px solid var(--mop-border, #d9e3e6);
}

.mop-interac__label {
	font-weight: 600;
}

.mop-interac__value {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.mop-interac__value code {
	font-family: var(--mop-font-mono, ui-monospace, Menlo, Consolas, monospace);
	font-size: 1.05em;
	letter-spacing: 0.04em;
	background: transparent;
}

.mop-interac__copy {
	min-height: 32px;
	padding: 4px 12px;
	border: 1px solid var(--mop-primary, #376B79);
	border-radius: 999px;
	background: transparent;
	color: var(--mop-primary, #376B79);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
}

.mop-interac__copy.is-copied {
	background: var(--mop-primary, #376B79);
	color: var(--mop-primary-contrast, #ffffff);
}

.mop-interac__note {
	margin: 8px 0 0;
	font-size: 0.9375rem;
}

/* ---------- RUO checkbox ---------- */
.mop-ruo-field {
	margin: 0 0 16px;
	line-height: 1.5;
}

.mop-ruo-field input[type="checkbox"] {
	margin-right: 6px;
}

/* ---------- Forms ---------- */
.mop-form {
	display: grid;
	gap: 16px;
}

.mop-field {
	display: grid;
	gap: 6px;
}

.mop-field__label {
	font-weight: 600;
}

.mop-field__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--mop-border, #c3d0d4);
	border-radius: var(--mop-radius-input, 8px);
	background: var(--mop-surface, #ffffff);
	color: var(--mop-text, #14262b);
	font: inherit;
}

.mop-field__input:focus {
	outline: 2px solid var(--mop-primary, #376B79);
	outline-offset: 1px;
}

.mop-field--error .mop-field__input {
	border-color: var(--mop-danger, #b32d2e);
}

.mop-field__error {
	margin: 0;
	font-size: 0.875rem;
	color: var(--mop-danger, #b32d2e);
}

.mop-field--hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mop-form__notice {
	padding: 12px 16px;
	border-radius: var(--mop-radius-input, 8px);
	border: 1px solid var(--mop-border, #d9e3e6);
}

.mop-form__notice--success {
	border-color: var(--mop-success, #1a7f37);
	background: var(--mop-success-bg, #eaf6ee);
}

.mop-form__notice--error {
	border-color: var(--mop-danger, #b32d2e);
	background: var(--mop-danger-bg, #fcefef);
}

.mop-form__submit {
	justify-self: start;
}

.mop-form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}
