/**
 * CPM Patient Registration Styles
 *
 * Mobile-first, card-based registration form.
 *
 * @since 1.5.0
 */

/* ── Wrap ──────────────────────────────────────────── */

.cpm-reg-wrap {
	display: flex;
	justify-content: center;
	padding: 24px 16px 48px;
}

.cpm-reg-card {
	width: 100%;
	max-width: 560px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
	padding: 32px 24px;
}

/* ── Header ────────────────────────────────────────── */

.cpm-reg-header {
	text-align: center;
	margin-bottom: 24px;
}

.cpm-reg-header h2 {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 600;
	color: #1d2327;
}

.cpm-reg-subtitle {
	margin: 0;
	font-size: 14px;
	color: #646970;
}

/* ── Errors ────────────────────────────────────────── */

.cpm-reg-errors {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
	padding: 12px 16px;
	margin-bottom: 20px;
	border-radius: 0 4px 4px 0;
}

.cpm-reg-errors p {
	margin: 4px 0;
	font-size: 13px;
	color: #8a1116;
}

/* ── Sections & Fields ─────────────────────────────── */

.cpm-reg-section {
	border: none;
	padding: 0;
	margin: 0 0 20px;
}

.cpm-reg-section legend {
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 12px;
	padding: 0;
}

.cpm-reg-field {
	margin-bottom: 14px;
}

.cpm-reg-field label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	margin-bottom: 4px;
}

.cpm-reg-req {
	color: #d63638;
}

.cpm-reg-field input[type="text"],
.cpm-reg-field input[type="email"],
.cpm-reg-field input[type="password"] {
	display: block;
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
	color: #1d2327;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.cpm-reg-field input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.cpm-reg-hint {
	display: block;
	font-size: 12px;
	color: #646970;
	margin-top: 4px;
}

/* ── Row layout (half-width fields) ────────────────── */

.cpm-reg-row--half {
	display: flex;
	gap: 12px;
}

.cpm-reg-row--half > .cpm-reg-field {
	flex: 1;
}

@media (max-width: 480px) {
	.cpm-reg-row--half {
		flex-direction: column;
		gap: 0;
	}
}

/* ── Password strength bar ─────────────────────────── */

.cpm-reg-strength {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	height: 18px;
}

.cpm-reg-strength__bar {
	flex: 1;
	height: 4px;
	background: #dcdcde;
	border-radius: 2px;
	overflow: hidden;
}

.cpm-reg-strength__bar::after {
	content: '';
	display: block;
	height: 100%;
	width: 0;
	border-radius: 2px;
	transition: width 0.3s, background 0.3s;
}

.cpm-reg-strength--weak::after   { background: #d63638; width: 25%; }
.cpm-reg-strength--fair::after   { background: #dba617; width: 50%; }
.cpm-reg-strength--good::after   { background: #00a32a; width: 75%; }
.cpm-reg-strength--strong::after { background: #007017; width: 100%; }

.cpm-reg-strength__text {
	font-size: 12px;
	color: #646970;
	white-space: nowrap;
}

/* ── Password match indicator ──────────────────────── */

.cpm-reg-match {
	display: block;
	font-size: 12px;
	margin-top: 4px;
	min-height: 16px;
}

.cpm-reg-match--ok  { color: #00a32a; }
.cpm-reg-match--err { color: #d63638; }

/* ── File upload area ──────────────────────────────── */

.cpm-reg-upload {
	position: relative;
	border: 2px dashed #c3c4c7;
	border-radius: 6px;
	padding: 24px 16px;
	text-align: center;
	transition: border-color 0.2s, background 0.2s;
	cursor: pointer;
}

.cpm-reg-upload:hover,
.cpm-reg-upload--dragover {
	border-color: #2271b1;
	background: #f0f6fc;
}

.cpm-reg-upload input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.cpm-reg-upload__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	pointer-events: none;
}

.cpm-reg-upload__icon {
	font-size: 32px;
	line-height: 1;
}

.cpm-reg-upload__text {
	font-size: 14px;
	color: #1d2327;
	font-weight: 500;
}

.cpm-reg-upload__hint {
	font-size: 12px;
	color: #646970;
}

/* ── File preview ──────────────────────────────────── */

.cpm-reg-upload__preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.cpm-reg-upload__thumb {
	max-width: 200px;
	max-height: 140px;
	border-radius: 4px;
	object-fit: contain;
}

.cpm-reg-upload__pdf-icon {
	font-size: 48px;
	line-height: 1;
}

.cpm-reg-upload__fname {
	font-size: 12px;
	color: #646970;
	word-break: break-all;
}

.cpm-reg-upload__error {
	display: block;
	font-size: 13px;
	color: #d63638;
	margin-top: 8px;
}

/* ── Submit button ─────────────────────────────────── */

.cpm-reg-submit {
	display: block;
	width: 100%;
	padding: 12px;
	border: none;
	border-radius: 4px;
	background: #2271b1;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.cpm-reg-submit:hover {
	background: #135e96;
}

.cpm-reg-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ── Footer link ───────────────────────────────────── */

.cpm-reg-footer {
	text-align: center;
	margin-top: 16px;
	font-size: 13px;
	color: #646970;
}

.cpm-reg-footer a {
	color: #2271b1;
	text-decoration: none;
}

.cpm-reg-footer a:hover {
	text-decoration: underline;
}

/* ── Logged-in message ─────────────────────────────── */

.cpm-reg-logged-in {
	text-align: center;
	padding: 48px 16px;
}

.cpm-reg-logged-in p {
	font-size: 15px;
	color: #646970;
	margin-bottom: 16px;
}

.cpm-reg-logged-in .cpm-reg-btn {
	display: inline-block;
	padding: 10px 24px;
	background: #2271b1;
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
}

.cpm-reg-logged-in .cpm-reg-btn:hover {
	background: #135e96;
}

/* ── Honeypot (hidden from humans) ─────────────────── */

.cpm-reg-hp {
	position: absolute;
	left: -9999px;
	height: 0;
	width: 0;
	overflow: hidden;
}
