/**
 * SHRC Repair Check-in — same blue & orange palette as the register,
 * sized for iPad / large-touch volunteer desks.
 */
:root {
	--shrc-blue: #0693e3;
	--shrc-blue-dark: #007cba;
	--shrc-blue-deep: #005a87;
	--shrc-blue-light: #e8f6fd;
	--shrc-blue-muted: #8ed1fc;
	--shrc-orange: #ff6900;
	--shrc-orange-dark: #e55d00;
	--shrc-amber: #fcb900;
	--shrc-base: #ffffff;
	--shrc-contrast: #111111;
	--shrc-muted: #5a6772;
	--shrc-border: #c5e4f7;
	--shrc-shadow: rgba(6, 147, 227, 0.14);
	--shrc-shadow-lg: rgba(0, 90, 135, 0.18);
	--shrc-error: #cf2e2e;
	--shrc-success: #00875a;
	--shrc-radius: 10px;
	--shrc-radius-lg: 14px;
	--shrc-touch: 3.25rem;
	--shrc-font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.shrc-checkin {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

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

.shrc-checkin__hero {
	margin-bottom: 1.25rem;
}

.shrc-checkin__login {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	font-size: 1.05rem;
}

.shrc-checkin__form-panel,
.shrc-checkin__recent-panel {
	padding: 1.25rem 1.35rem 1.4rem;
}

.shrc-checkin__visit-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.shrc-checkin__field {
	font-size: 1rem;
}

.shrc-checkin__visitor-wrap {
	min-width: 0;
}

.shrc-checkin__visitor-hint {
	margin-top: 0.35rem;
}

.shrc-checkin__item-row {
	display: grid;
	grid-template-columns: 7.25rem minmax(0, 1fr);
	gap: 0.75rem;
	align-items: end;
	margin-bottom: 0.25rem;
}

.shrc-checkin__field--ticket {
	min-width: 0;
}

.shrc-checkin__field--ticket input {
	min-height: var(--shrc-touch);
	width: 100%;
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-align: center;
	padding: 0.65rem 0.4rem;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__field--item {
	min-width: 0;
}

.shrc-checkin__field input,
.shrc-checkin .shrc-register__field input,
.shrc-checkin .shrc-register__field select {
	min-height: var(--shrc-touch);
	font-size: 1.125rem;
	padding: 0.75rem 0.9rem;
	border-radius: 12px;
}

.shrc-checkin__field.is-invalid input,
.shrc-checkin__categories.is-invalid .shrc-checkin__category-grid {
	border-color: var(--shrc-error);
	box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.15);
}

.shrc-checkin__count {
	margin: 0 0 1.35rem;
	padding: 0;
	border: 0;
}

.shrc-checkin__count legend {
	padding: 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__count-options {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.55rem;
	margin-top: 0.65rem;
}

.shrc-checkin__count-option {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 3.75rem;
	margin: 0;
	padding: 0.75rem;
	font-size: 1.75rem;
	font-weight: 800;
	color: var(--shrc-blue-deep);
	background: var(--shrc-base);
	border: 2px solid var(--shrc-border);
	border-radius: 14px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.shrc-checkin__count-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.shrc-checkin__count-option.is-selected,
.shrc-checkin__count-option:has(input:checked) {
	color: #fff;
	background: linear-gradient(135deg, var(--shrc-orange) 0%, var(--shrc-orange-dark) 100%);
	border-color: var(--shrc-orange-dark);
	box-shadow: 0 6px 16px rgba(255, 105, 0, 0.28);
}

.shrc-checkin__count-option.is-disabled,
.shrc-checkin__count-option:has(input:disabled) {
	color: #8a949c;
	background: #eef2f5;
	border-color: #d5dde3;
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.55;
}

.shrc-checkin__visit-category {
	margin: 0 0 1.25rem;
}

.shrc-checkin__categories.is-invalid .shrc-checkin__category-grid {
	box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.15);
}

.shrc-checkin__item-panel {
	margin-bottom: 1rem;
	padding: 1.1rem 1.15rem 1.2rem;
	border: 1.5px solid var(--shrc-border);
	border-radius: var(--shrc-radius-lg);
	background: linear-gradient(180deg, #fff 0%, #f7fbfe 100%);
}

.shrc-checkin__item-panel[hidden] {
	display: none;
}

.shrc-checkin__item-title {
	margin: 0 0 0.85rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__categories {
	margin: 1rem 0 0;
	padding: 0;
	border: 0;
}

.shrc-checkin__categories legend {
	padding: 0;
	margin-bottom: 0.65rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__category-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.65rem;
	padding: 0.15rem;
	border-radius: 12px;
}

.shrc-checkin__category-chip {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 3.15rem;
	margin: 0;
	padding: 0.65rem 0.55rem;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--shrc-blue-deep);
	background: var(--shrc-base);
	border: 2px solid var(--shrc-border);
	border-radius: 12px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.shrc-checkin__category-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.shrc-checkin__category-chip.is-selected,
.shrc-checkin__category-chip:has(input:checked) {
	color: #fff;
	background: linear-gradient(135deg, var(--shrc-blue) 0%, var(--shrc-blue-dark) 100%);
	border-color: var(--shrc-blue-dark);
	box-shadow: 0 4px 12px var(--shrc-shadow);
}

.shrc-checkin__actions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1.35rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--shrc-border);
	position: sticky;
	bottom: env(safe-area-inset-bottom);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, #fff 28%);
	z-index: 2;
}

.shrc-checkin__submit,
.shrc-checkin__clear,
.shrc-checkin .shrc-checkin__login .shrc-btn {
	min-height: 3.5rem;
	width: 100%;
	font-size: 1.15rem;
	border-radius: 12px;
	touch-action: manipulation;
}

.shrc-checkin__recent {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.shrc-checkin__recent-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas:
		"tickets name edit"
		"tickets items edit";
	gap: 0.15rem 0.85rem;
	align-items: center;
	padding: 0.85rem 1rem;
	background: var(--shrc-blue-light);
	border: 1px solid var(--shrc-border);
	border-radius: 12px;
}

.shrc-checkin__recent-item.is-new {
	outline: 2px solid var(--shrc-orange);
	background: #fff7f0;
}

.shrc-checkin__recent-visit {
	grid-area: tickets;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.35rem;
}

.shrc-checkin__recent-ticket {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3.15rem;
	min-height: 2.35rem;
	padding: 0.35rem 0.7rem;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--shrc-blue-deep);
	background: #fff;
	border: 1.5px solid var(--shrc-border);
	border-radius: 999px;
}

.shrc-checkin__recent-name {
	grid-area: name;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__recent-items {
	grid-area: items;
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--shrc-blue-deep);
}

.shrc-checkin__recent-edit-btn {
	grid-area: edit;
	min-height: 2.75rem;
	min-width: 5.75rem;
	padding: 0.45rem 1.15rem;
	font-size: 0.95rem;
	border-radius: 999px;
	touch-action: manipulation;
}

#shrc-checkin-validation-modal {
	z-index: 100001;
}

.shrc-checkin__edit-panel {
	width: min(720px, 100%);
}

.shrc-checkin__edit-items {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.shrc-checkin__empty {
	margin: 0;
	padding: 0.75rem 0;
	color: var(--shrc-muted);
	font-weight: 600;
}

.shrc-checkin__success-text {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--shrc-success);
	line-height: 1.4;
}

.shrc-checkin.is-busy {
	cursor: wait;
}

.shrc-checkin.is-busy .shrc-checkin__submit,
.shrc-checkin.is-busy .shrc-checkin__clear,
.shrc-checkin.is-busy .shrc-checkin__recent-edit-btn,
.shrc-checkin.is-busy #shrc-checkin-edit-save,
.shrc-checkin.is-busy input,
.shrc-checkin.is-busy .shrc-checkin__count-option,
.shrc-checkin.is-busy .shrc-checkin__category-chip {
	pointer-events: none;
	opacity: 0.72;
}

@media (max-width: 520px) {
	.shrc-checkin__count-options {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.shrc-checkin__visit-row {
		grid-template-columns: 10.5rem 1fr;
		align-items: end;
	}

	.shrc-checkin__category-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.shrc-checkin__actions {
		flex-direction: row;
		position: static;
	}

	.shrc-checkin__submit {
		flex: 2 1 auto;
	}

	.shrc-checkin__clear {
		flex: 1 1 auto;
		width: auto;
	}
}

@media (min-width: 1024px) {
	.shrc-checkin__category-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.shrc-checkin__form-panel,
	.shrc-checkin__recent-panel {
		max-width: 58rem;
	}

	.shrc-checkin__recent-visit {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (hover: hover) and (pointer: fine) {
	.shrc-checkin__count-option:hover,
	.shrc-checkin__category-chip:hover {
		border-color: var(--shrc-blue);
		background: var(--shrc-blue-light);
	}

	.shrc-checkin__count-option.is-selected:hover,
	.shrc-checkin__count-option:has(input:checked):hover {
		background: linear-gradient(135deg, #ff7a1a 0%, var(--shrc-orange) 100%);
	}

	.shrc-checkin__category-chip.is-selected:hover,
	.shrc-checkin__category-chip:has(input:checked):hover {
		background: linear-gradient(135deg, var(--shrc-blue-dark) 0%, var(--shrc-blue-deep) 100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.shrc-checkin__count-option,
	.shrc-checkin__category-chip,
	.shrc-checkin .shrc-btn {
		transition: none;
	}
}
