/**
 * math-outreach-core — account & submission form styles.
 * Prefix: .mo-  |  License: GPL-2.0-or-later
 *
 * Mobile-first, accessible. Reuses the front custom properties when the
 * front stylesheet is present, with safe fallbacks otherwise.
 */

.mo-account {
	--mo-a-primary: var(--mo-primary, #14417b);
	--mo-a-primary-dark: var(--mo-primary-dark, #0d2f5c);
	--mo-a-text: var(--mo-text, #1b2430);
	--mo-a-border: #c9d3e0;
	--mo-a-error: #b3261e;
	--mo-a-ok: #1a7f37;
	--mo-a-surface: var(--mo-surface, #ffffff);

	max-width: 46rem;
	margin: 0 auto;
	color: var(--mo-a-text);
	line-height: 1.5;
}

.mo-account h1 {
	margin: 0 0 1rem;
}

/* Notices */
.mo-notice {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	margin: 0 0 1rem;
	border: 1px solid transparent;
}

.mo-notice--ok {
	background: #e7f6ec;
	border-color: var(--mo-a-ok);
	color: #0f5227;
}

.mo-notice--error,
.mo-form-errors {
	background: #fdeceb;
	border: 1px solid var(--mo-a-error);
	color: #7a1a15;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	margin: 0 0 1rem;
}

.mo-form-errors ul {
	margin: 0.25rem 0 0;
	padding-left: 1.25rem;
}

/* Fields */
.mo-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0 0 1rem;
}

.mo-field label,
.mo-fieldset legend {
	font-weight: 600;
}

.mo-field input[type="text"],
.mo-field input[type="email"],
.mo-field input[type="password"],
.mo-field input[type="url"],
.mo-field input[type="date"],
.mo-field select,
.mo-field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--mo-a-border);
	border-radius: 6px;
	font: inherit;
	background: var(--mo-a-surface);
	color: inherit;
}

.mo-field input:focus,
.mo-field select:focus,
.mo-field textarea:focus {
	outline: 2px solid var(--mo-a-primary);
	outline-offset: 1px;
}

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

.mo-field-note {
	font-size: 0.85rem;
	color: #5a6675;
}

.mo-field-error {
	color: var(--mo-a-error);
	font-size: 0.85rem;
}

.mo-req {
	color: var(--mo-a-error);
}

.mo-required-hint {
	font-size: 0.9rem;
	color: #5a6675;
}

/* Fieldsets (radios / checkbox groups) */
.mo-fieldset {
	border: 1px solid var(--mo-a-border);
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin: 0 0 1rem;
}

.mo-fieldset label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 400;
	margin-right: 1rem;
}

.mo-checkboxes label {
	display: block;
	margin: 0.15rem 0;
}

/* Buttons */
.mo-btn {
	display: inline-block;
	padding: 0.55rem 1.1rem;
	border-radius: 6px;
	border: 1px solid var(--mo-a-primary);
	background: transparent;
	color: var(--mo-a-primary);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.mo-btn--primary {
	background: var(--mo-a-primary);
	color: #fff;
}

.mo-btn--primary:hover,
.mo-btn--primary:focus {
	background: var(--mo-a-primary-dark);
	border-color: var(--mo-a-primary-dark);
}

.mo-actions {
	margin: 1.25rem 0;
}

.mo-form-alt {
	margin: 0.5rem 0;
}

/* Honeypot: hide off-screen without display:none (bots skip display:none). */
.mo-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mo-file-name {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.85rem;
	color: #5a6675;
}

/* Dashboard table */
.mo-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
}

.mo-table th,
.mo-table td {
	text-align: left;
	padding: 0.5rem 0.6rem;
	border-bottom: 1px solid var(--mo-a-border);
	vertical-align: top;
}

.mo-table thead th {
	border-bottom: 2px solid var(--mo-a-primary);
}

.mo-modnote {
	display: block;
	font-size: 0.85rem;
	color: #7a1a15;
	margin-top: 0.25rem;
}

/* Pagination */
.mo-pagination {
	margin: 1rem 0;
}

.mo-page {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	border: 1px solid var(--mo-a-border);
	border-radius: 4px;
	text-decoration: none;
	margin-right: 0.25rem;
}

.mo-page.current {
	background: var(--mo-a-primary);
	color: #fff;
	border-color: var(--mo-a-primary);
}

/* Small screens: stack fieldset labels */
@media (max-width: 40rem) {
	.mo-fieldset label {
		display: block;
		margin: 0.15rem 0;
	}

	.mo-table,
	.mo-table thead,
	.mo-table tbody,
	.mo-table tr,
	.mo-table th,
	.mo-table td {
		display: block;
	}

	.mo-table thead {
		display: none;
	}

	.mo-table td {
		border: none;
		padding: 0.15rem 0;
	}

	.mo-table tr {
		border-bottom: 1px solid var(--mo-a-border);
		padding: 0.5rem 0;
	}
}
