/* Shared theme for the registration, staff list and admin pages (General Cleanness Department identity). */

@font-face {
	font-family: "Lusail";
	src: url("../fonts/Lusail-Regular.otf") format("opentype");
	font-weight: 400;
}

@font-face {
	font-family: "Lusail";
	src: url("../fonts/Lusail-Medium.otf") format("opentype");
	font-weight: 500;
}

@font-face {
	font-family: "Lusail";
	src: url("../fonts/Lusail-Bold.otf") format("opentype");
	font-weight: 700;
}

:root {
	--brand: #7d2342;
	--brand-dark: #5f1830;
	--brand-soft: #f7eef1;
	--ink: #1f1f1f;
	--muted: #6b6b6b;
	--line: #d9d9d9;
	--surface: #ffffff;
	--page: #f4f4f4;
	--danger: #c0392b;
	--sea: #7fa9b5;
	--sand: #eadfd0;
}

body {
	font-family: "Lusail", "Segoe UI", Tahoma, Arial, sans-serif;
	background: var(--page);
	color: var(--ink);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

a {
	color: var(--brand);
}

a:hover {
	color: var(--brand-dark);
}

.page {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
	padding: 16px 16px 0;
	flex: 1;
}

.page-wide {
	max-width: 1280px;
}

/* ---------- Header ---------- */

.top-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.lang-switch {
	display: flex;
	gap: 6px;
}

.lang-switch a {
	font-size: 0.85rem;
	padding: 4px 12px;
	border: 1px solid var(--line);
	border-radius: 20px;
	color: var(--ink);
	background: var(--surface);
	text-decoration: none;
}

.lang-switch a.active {
	border-color: var(--brand);
	color: var(--brand);
	font-weight: 700;
}

.staff-nav {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.staff-nav a {
	font-size: 0.9rem;
	padding: 6px 14px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--brand);
	border: 1px solid var(--brand);
	background: var(--surface);
}

.staff-nav a.active {
	background: var(--brand);
	color: #fff;
}

.brand-header {
	text-align: center;
	margin-bottom: 16px;
}

.brand-header img {
	max-width: 100%;
	height: auto;
	max-height: 96px;
}

.title-card {
	background: #ebebeb;
	border-radius: 16px;
	padding: 20px 16px;
	text-align: center;
	margin-bottom: 14px;
}

.title-card h1 {
	color: var(--brand);
	font-weight: 700;
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	margin: 0 0 6px;
}

.title-card p {
	font-size: clamp(1.05rem, 2.6vw, 1.5rem);
	font-weight: 700;
	margin: 0;
	color: var(--ink);
}

.tagline {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 auto 22px;
	max-width: 760px;
	color: var(--ink);
	font-size: 0.95rem;
}

.tagline::before,
.tagline::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--brand);
	opacity: 0.7;
}

.tagline svg {
	color: var(--muted);
}

/* ---------- Section cards ---------- */

.section-card {
	background: var(--surface);
	border: 1px solid var(--brand);
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 18px;
}

.section-card > .section-head {
	background: var(--brand);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 18px;
	font-weight: 700;
	font-size: 1.1rem;
}

.section-card > .section-head svg {
	flex: none;
}

.section-card > .section-body {
	padding: 16px 20px;
}

.field-row {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 8px 20px;
	align-items: center;
	margin-bottom: 12px;
}

.field-row:last-child {
	margin-bottom: 0;
}

.field-row > .field-label {
	font-weight: 700;
	margin: 0;
}

.field-row.align-top {
	align-items: start;
}

.field-row.align-top > .field-label {
	padding-top: 8px;
}

.req {
	color: var(--danger);
	margin-inline-start: 2px;
}

.form-control,
.form-select {
	border-radius: 6px;
	border-color: #cfcfcf;
	font-family: inherit;
}

.form-control:focus,
.form-select:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 0.2rem rgba(125, 35, 66, 0.15);
}

.form-control[readonly] {
	background: #eeeeee;
}

.input-icon {
	position: relative;
}

.input-icon svg {
	position: absolute;
	inset-inline-start: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--muted);
	pointer-events: none;
}

.input-icon .form-control,
.input-icon .form-select {
	padding-inline-start: 42px;
}

.choice-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 40px;
}

.choice-group label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	margin: 0;
}

.choice-group input[type="radio"],
.choice-group input[type="checkbox"],
.declaration input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--brand);
	flex: none;
}

.count-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	max-width: 420px;
}

.count-row .unit {
	color: var(--ink);
	min-width: 90px;
}

.field-error {
	color: var(--danger);
	font-size: 0.85rem;
	margin-top: 4px;
}

.is-invalid,
.form-control.is-invalid {
	border-color: var(--danger);
}

/* Bootstrap's invalid icon would sit on top of the phone/e-mail icons; the red border + message are enough */
.form-control.is-invalid {
	background-image: none;
}

.hint {
	color: var(--muted);
	font-size: 0.85rem;
	margin-top: 4px;
}

.declaration {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0;
	cursor: pointer;
}

.alert-brand {
	background: var(--brand-soft);
	border: 1px solid rgba(125, 35, 66, 0.35);
	color: var(--brand-dark);
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
}

.alert-error {
	background: #fdecea;
	border: 1px solid #f5c2bd;
	color: #8a1f14;
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
}

/* ---------- Buttons ---------- */

.btn-brand {
	background: var(--brand);
	border: 1px solid var(--brand);
	color: #fff;
	border-radius: 10px;
	padding: 10px 22px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-decoration: none;
}

.btn-brand:hover,
.btn-brand:focus {
	background: var(--brand-dark);
	border-color: var(--brand-dark);
	color: #fff;
}

.btn-outline-brand {
	background: var(--surface);
	border: 1px solid var(--brand);
	color: var(--brand);
	border-radius: 10px;
	padding: 8px 18px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.btn-outline-brand:hover {
	background: var(--brand-soft);
	color: var(--brand-dark);
}

.btn-submit {
	min-width: min(340px, 100%);
	font-size: 1.1rem;
	padding: 14px 28px;
	border-radius: 14px;
}

.btn-sm-brand {
	padding: 4px 10px;
	font-size: 0.85rem;
	border-radius: 8px;
	font-weight: 500;
}

.actions {
	text-align: center;
	margin: 8px 0 12px;
}

/* ---------- Choice / day cards ---------- */

.choice-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 18px;
	margin-bottom: 24px;
}

.choice-card {
	background: var(--surface);
	border: 1px solid var(--brand);
	border-radius: 16px;
	padding: 28px 22px;
	text-align: center;
	text-decoration: none;
	color: var(--ink);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.choice-card:hover,
.choice-card:focus {
	box-shadow: 0 8px 24px rgba(125, 35, 66, 0.18);
	transform: translateY(-2px);
	color: var(--ink);
}

.choice-card .icon-circle {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--brand-soft);
	color: var(--brand);
	display: flex;
	align-items: center;
	justify-content: center;
}

.choice-card h2 {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--brand);
	margin: 0;
}

.choice-card p {
	margin: 0;
	color: var(--muted);
}

.choice-card .go {
	margin-top: 6px;
}

.day-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 14px;
}

.day-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--ink);
	position: relative;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.day-card:hover,
.day-card:hover,
.day-card.selected {
	border-color: var(--brand);
	box-shadow: 0 4px 14px rgba(125, 35, 66, 0.15);
	color: var(--ink);
}

.day-card .day-date {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--brand);
}

.day-card .day-weekday {
	color: var(--muted);
	font-size: 0.9rem;
}

.day-card .day-place {
	font-weight: 700;
}

.day-card .day-period {
	font-size: 0.85rem;
	color: var(--muted);
}

.day-card input[type="checkbox"] {
	position: absolute;
	inset-inline-end: 12px;
	top: 12px;
	width: 20px;
	height: 20px;
	accent-color: var(--brand);
}

.empty-state {
	text-align: center;
	color: var(--muted);
	padding: 30px 10px;
}

/* ---------- Tables (staff pages) ---------- */

.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-end;
	margin-bottom: 14px;
}

.toolbar .grow {
	flex: 1 1 240px;
}

.toolbar label {
	font-size: 0.85rem;
	color: var(--muted);
	margin-bottom: 2px;
	display: block;
}

.tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid var(--brand);
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.tabs a {
	padding: 8px 18px;
	border-radius: 10px 10px 0 0;
	text-decoration: none;
	color: var(--brand);
	font-weight: 700;
	background: var(--surface);
	border: 1px solid var(--line);
	border-bottom: none;
}

.tabs a.active {
	background: var(--brand);
	color: #fff;
	border-color: var(--brand);
}

.table-wrap {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow-x: auto;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.data-table th {
	background: var(--brand-soft);
	color: var(--brand-dark);
	font-weight: 700;
	padding: 10px 12px;
	white-space: nowrap;
	text-align: start;
	border-bottom: 1px solid var(--line);
}

.data-table td {
	padding: 9px 12px;
	border-bottom: 1px solid #eeeeee;
	vertical-align: top;
	text-align: start;
}

.data-table tr:last-child td {
	border-bottom: none;
}

.data-table .nowrap {
	white-space: nowrap;
}

.data-table .num {
	font-variant-numeric: tabular-nums;
}

.badge-type {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 700;
	background: #eef3f5;
	color: #2d5c6a;
}

.badge-type.school {
	background: var(--brand-soft);
	color: var(--brand);
}

.badge-state {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 0.8rem;
	background: #e8f5ec;
	color: #1e6b37;
}

.badge-state.off {
	background: #eeeeee;
	color: #666666;
}

.muted {
	color: var(--muted);
}

.pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin: 12px 0 20px;
	font-size: 0.9rem;
}

.pager .pages {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.pager .pages a,
.pager .pages span {
	min-width: 34px;
	padding: 5px 10px;
	text-align: center;
	border: 1px solid var(--line);
	border-radius: 8px;
	text-decoration: none;
	background: var(--surface);
	color: var(--ink);
}

.pager .pages .current {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

.pager .pages .disabled {
	color: #b5b5b5;
}

/* ---------- Document viewer ---------- */

.document-modal {
	display: none;
	position: fixed;
	z-index: 9999;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.85);
}

.document-modal.show {
	display: block;
}

.document-modal-content {
	position: relative;
	margin: 3vh auto 0;
	width: 95%;
	height: 92vh;
	max-width: 1400px;
}

.document-close {
	position: absolute;
	top: -8px;
	inset-inline-end: -8px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: var(--ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	z-index: 10000;
}

.document-iframe {
	width: 100%;
	height: 100%;
	border: none;
	background: white;
	border-radius: 8px;
}

.document-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	font-size: 18px;
	text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
	margin-top: 26px;
	position: relative;
}

.site-footer .slogan {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	color: var(--brand);
	font-size: 1.1rem;
	font-weight: 500;
	padding: 0 16px 8px;
}

.site-footer .shore {
	display: block;
	width: 100%;
	height: 70px;
}

@media (max-width: 720px) {
	.field-row {
		grid-template-columns: 1fr;
	}

	.field-row.align-top > .field-label {
		padding-top: 0;
	}

	.section-card > .section-body {
		padding: 14px;
	}

	.choice-group {
		gap: 10px 24px;
	}

	.count-row {
		max-width: none;
	}
}

/* Documents / actions column of the staff list: one action per line */
.data-table td.docs > * {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin-bottom: 4px;
}

.data-table td.docs > button {
	display: inline-flex;
}

/* ---------- Loading overlay (fragments/layout :: loadingOverlay) ---------- */

.loading-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 20000;
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(2px);
	align-items: center;
	justify-content: center;
	padding: 16px;
	cursor: wait;
}

.loading-overlay.show {
	display: flex;
}

.loading-overlay:focus {
	outline: none;
}

body.is-loading {
	overflow: hidden;
}

.loading-box {
	background: var(--surface);
	border: 1px solid var(--brand);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(125, 35, 66, 0.2);
	padding: 28px 32px;
	text-align: center;
	max-width: 360px;
	width: 100%;
}

.loading-spinner {
	width: 52px;
	height: 52px;
	margin: 0 auto 16px;
	border-radius: 50%;
	border: 5px solid var(--brand-soft);
	border-top-color: var(--brand);
	animation: loading-spin 0.9s linear infinite;
}

.loading-text {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--brand);
}

.loading-hint {
	margin-top: 6px;
	font-size: 0.85rem;
	color: var(--muted);
}

@keyframes loading-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.loading-spinner {
		animation-duration: 2.5s;
	}
}
