/* Calibration Reports — frontend styles */

.ccr-wrapper {
	max-width: 900px;
	margin: 0 auto;
	font-size: 16px;
}

.ccr-form {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 24px;
}

.ccr-form-title {
	margin: 0 0 18px;
	font-size: 1.35em;
}

.ccr-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 20px;
}

@media (max-width: 640px) {
	.ccr-grid {
		grid-template-columns: 1fr;
	}
}

.ccr-field {
	margin: 0 0 14px;
}

.ccr-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
}

.ccr-req {
	color: #dc2626;
}

.ccr-field input,
.ccr-field select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
	font-size: 15px;
}

.ccr-field input:focus,
.ccr-field select:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
	border-color: #2563eb;
}

/* Honeypot: visually hidden from humans */
.ccr-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 1px;
	overflow: hidden;
}

.ccr-submit {
	margin: 8px 0 0;
}

.ccr-submit button {
	background: #2563eb;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 12px 28px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.ccr-submit button:hover {
	background: #1d4ed8;
}

.ccr-message {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 0 0 16px;
}

.ccr-message-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.ccr-message-warning {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
}

.ccr-results {
	margin-top: 26px;
}

.ccr-results-title {
	margin: 0 0 12px;
}

.ccr-table-scroll {
	overflow-x: auto;
}

.ccr-report-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.ccr-report-table th,
.ccr-report-table td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
	white-space: nowrap;
}

.ccr-report-table thead th {
	background: #1e293b;
	color: #fff;
	font-weight: 600;
}

.ccr-report-table tbody tr:last-child td {
	border-bottom: 0;
}

.ccr-status {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

.ccr-status-ok {
	background: #dcfce7;
	color: #166534;
}

.ccr-status-due {
	background: #fee2e2;
	color: #991b1b;
}

.ccr-download-btn {
	background: #059669;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ccr-download-btn:hover {
	background: #047857;
}

.ccr-no-cert {
	color: #94a3b8;
	font-size: 14px;
}

/* ---------------------------------------------------------------
 * QR modal
 * ------------------------------------------------------------ */

.ccr-modal[hidden] {
	display: none;
}

.ccr-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ccr-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
}

body.ccr-modal-open {
	overflow: hidden;
}

.ccr-modal-box {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 28px 28px 24px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
	max-height: 90vh;
	overflow-y: auto;
}

.ccr-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 4px 8px;
}

.ccr-modal-close:hover {
	color: #0f172a;
}

.ccr-modal-title {
	margin: 0 0 8px;
	font-size: 1.2em;
}

.ccr-modal-help {
	margin: 0 0 18px;
	color: #475569;
	font-size: 14px;
	line-height: 1.5;
}

.ccr-qr-box {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
}

.ccr-qr-box svg {
	max-width: 100%;
	height: auto;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.ccr-modal-note {
	margin: 16px 0 0;
	font-size: 13px;
	color: #64748b;
}

.ccr-modal-note-error {
	color: #991b1b;
	font-weight: 600;
}

.ccr-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: ccr-spin 0.8s linear infinite;
}

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