/* ClientVue customer portal. Scoped to .cv-portal so the theme is not affected. */

.cv-portal {
	--cv-ink: #14232e;
	--cv-muted: #5d6b76;
	--cv-line: #dde5e3;
	--cv-wash: #f3f6f5;
	--cv-surface: #ffffff;
	--cv-teal: #0f7d6b;
	--cv-teal-dark: #0b5f52;
	--cv-teal-soft: #e3f1ee;
	--cv-orange: #e2541d;
	--cv-danger: #b42318;
	--cv-radius: 10px;

	color: var(--cv-ink);
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}
.cv-portal *,
.cv-portal *::before,
.cv-portal *::after { box-sizing: inherit; }
.cv-portal a { color: var(--cv-teal); }
.cv-portal h2,
.cv-portal h3,
.cv-portal h4 { color: var(--cv-ink); margin: 0; line-height: 1.25; letter-spacing: normal; text-transform: none; }
.cv-portal p { margin: 0; }
.cv-svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* ---------- Buttons ---------- */
.cv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 22px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.cv-portal .cv-btn--primary { background: var(--cv-ink); color: #fff; }
.cv-portal .cv-btn--primary:hover { background: var(--cv-teal-dark); color: #fff; }
.cv-portal .cv-btn--ghost { background: transparent; color: var(--cv-ink); border-color: var(--cv-line); }
.cv-portal .cv-btn--ghost:hover { border-color: var(--cv-ink); }
.cv-btn--block { width: 100%; }
.cv-btn[disabled] { opacity: .6; cursor: progress; }

.cv-portal a:focus-visible,
.cv-portal button:focus-visible,
.cv-portal input:focus-visible,
.cv-portal summary:focus-visible {
	outline: 3px solid var(--cv-teal);
	outline-offset: 2px;
}

/* ---------- Notices ---------- */
.cv-notice {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-radius: 8px;
	border-left: 4px solid var(--cv-teal);
	background: var(--cv-teal-soft);
	font-size: 15px;
	text-align: left;
}
.cv-notice--error { border-left-color: var(--cv-danger); background: #fdecea; color: #7a1a12; }
.cv-notice--success { border-left-color: var(--cv-teal); background: var(--cv-teal-soft); color: var(--cv-teal-dark); font-weight: 600; }
.cv-dash > .cv-notice { margin-bottom: 18px; }

/* ---------- Sign in / register / messages ---------- */
.cv-auth {
	max-width: 460px;
	margin: 24px auto;
	padding: 40px 36px 32px;
	background: var(--cv-surface);
	border: 1px solid var(--cv-line);
	border-top: 4px solid var(--cv-teal);
	border-radius: var(--cv-radius);
	text-align: center;
}
.cv-auth--wide { max-width: 560px; }
.cv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.cv-auth__icon {
	display: inline-flex;
	width: 56px;
	height: 56px;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
	border-radius: 50%;
	background: var(--cv-teal-soft);
	color: var(--cv-teal);
}
.cv-auth__icon .cv-svg { width: 26px; height: 26px; }
.cv-auth__title { font-size: 26px; font-weight: 600; }
.cv-auth__lead { margin-top: 8px !important; margin-bottom: 26px !important; color: var(--cv-muted); font-size: 15px; }
.cv-auth--message .cv-auth__lead { margin-bottom: 0 !important; }
.cv-auth__links { margin-top: 22px !important; color: var(--cv-muted); font-size: 14px; }

.cv-form { text-align: left; }
.cv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cv-field { margin-bottom: 18px; }
.cv-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.cv-portal .cv-field input {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #c7d2cf;
	border-radius: 8px;
	background: #fff;
	color: var(--cv-ink);
	font: inherit;
	font-size: 16px;
	box-shadow: none;
}
.cv-portal .cv-field input:focus { border-color: var(--cv-teal); }
.cv-hint { margin-top: 6px !important; color: var(--cv-muted); font-size: 13px; }
.cv-hint--center { margin-top: 12px !important; text-align: center; }
.cv-optional { color: var(--cv-muted); font-weight: 400; }

/* Field errors */
.cv-portal .cv-field--error input { border-color: var(--cv-danger); }
.cv-field__error { margin-top: 6px !important; color: var(--cv-danger); font-size: 13px; font-weight: 600; }

/* Password strength + match */
.cv-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 18px; }
.cv-strength__bar { flex: 1; height: 6px; border-radius: 3px; background: var(--cv-line); overflow: hidden; }
.cv-strength__bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--cv-danger); transition: width .2s ease, background-color .2s ease; }
.cv-strength__label { min-width: 70px; font-size: 13px; font-weight: 600; text-align: right; color: var(--cv-muted); }
.cv-strength[data-level="0"] { visibility: hidden; }
.cv-strength[data-level="1"] .cv-strength__bar span { width: 25%; background: var(--cv-danger); }
.cv-strength[data-level="2"] .cv-strength__bar span { width: 50%; background: #c77700; }
.cv-strength[data-level="3"] .cv-strength__bar span { width: 75%; background: #4f8f2f; }
.cv-strength[data-level="4"] .cv-strength__bar span { width: 100%; background: var(--cv-teal); }
.cv-strength[data-level="1"] .cv-strength__label { color: var(--cv-danger); }
.cv-strength[data-level="4"] .cv-strength__label { color: var(--cv-teal); }
.cv-match { margin-top: 6px !important; min-height: 18px; font-size: 13px; font-weight: 600; }
.cv-match.is-ok { color: var(--cv-teal); }
.cv-match.is-bad { color: var(--cv-danger); }

.cv-password { position: relative; }
.cv-portal .cv-password input { padding-right: 50px; }
.cv-password__toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent !important;
	color: var(--cv-muted);
	cursor: pointer;
}
.cv-password__toggle[aria-pressed="true"] { color: var(--cv-teal); }

.cv-form__split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 22px; font-size: 14px; }
.cv-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cv-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--cv-teal); }

.cv-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Dashboard ---------- */
.cv-dash { max-width: 1120px; margin: 0 auto; }

.cv-dash__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}
.cv-company { color: var(--cv-muted); font-size: 14px; font-weight: 600; }

.cv-account { position: relative; margin-left: auto; }
.cv-account summary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 12px 6px 6px;
	border: 1px solid var(--cv-line);
	border-radius: 999px;
	background: var(--cv-surface);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}
.cv-account summary::-webkit-details-marker { display: none; }
.cv-account[open] summary .cv-svg { transform: rotate(180deg); }
.cv-avatar {
	display: inline-flex;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--cv-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
}
.cv-account__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 20;
	min-width: 240px;
	padding: 8px;
	background: var(--cv-surface);
	border: 1px solid var(--cv-line);
	border-radius: var(--cv-radius);
	box-shadow: 0 12px 28px rgba(20, 35, 46, .12);
}
.cv-account__email { display: block; padding: 8px 10px 10px; border-bottom: 1px solid var(--cv-line); margin-bottom: 4px; color: var(--cv-muted); font-size: 13px; overflow-wrap: anywhere; }
.cv-account__menu a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 6px;
	color: var(--cv-ink) !important;
	font-size: 14px;
	text-decoration: none;
}
.cv-account__menu a:hover { background: var(--cv-wash); }
.cv-account__menu a.cv-account__out { color: var(--cv-danger) !important; }

.cv-welcome {
	padding: 28px 30px;
	background: var(--cv-surface);
	border: 1px solid var(--cv-line);
	border-left: 5px solid var(--cv-teal);
	border-radius: var(--cv-radius);
}
.cv-welcome h2 { font-size: 28px; font-weight: 700; }
.cv-welcome p { max-width: 68ch; margin-top: 8px; color: var(--cv-muted); }

.cv-products { margin-top: 40px; }
.cv-products__title { font-size: 20px; font-weight: 700; margin-bottom: 14px !important; }

.cv-product {
	margin-bottom: 18px;
	background: var(--cv-surface);
	border: 1px solid var(--cv-line);
	border-radius: var(--cv-radius);
	overflow: hidden;
}
.cv-product__head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	background: var(--cv-wash);
	border-bottom: 1px solid var(--cv-line);
}
.cv-product__icon {
	display: inline-flex;
	width: 38px;
	height: 38px;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: var(--cv-teal);
	color: #fff;
}
.cv-product__name { flex: 1; font-size: 19px; font-weight: 700; }
.cv-product__count { color: var(--cv-muted); font-size: 13px; white-space: nowrap; }
.cv-product__desc { padding: 14px 20px 0; color: var(--cv-muted); font-size: 15px; }
.cv-product__none { padding: 18px 20px; color: var(--cv-muted); font-size: 15px; }

.cv-docs { list-style: none; margin: 0; padding: 8px 12px 12px; }
.cv-doc {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 12px 8px;
	border-bottom: 1px solid var(--cv-line);
}
.cv-doc:last-child { border-bottom: 0; }
.cv-doc__type {
	display: inline-flex;
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: var(--cv-wash);
	border: 1px solid var(--cv-line);
	color: var(--cv-muted);
	font-size: 11px;
	font-weight: 700;
}
.cv-doc__type--pdf { background: #fdeee8; border-color: #f6cdbd; color: var(--cv-orange); }
.cv-doc__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cv-doc__title { font-weight: 600; overflow-wrap: anywhere; }
.cv-doc__sub { color: var(--cv-muted); font-size: 13px; }
.cv-doc__actions { display: flex; gap: 8px; }
.cv-icon-btn {
	display: inline-flex;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--cv-line);
	border-radius: 8px;
	background: var(--cv-surface);
	color: var(--cv-ink) !important;
	text-decoration: none;
}
.cv-icon-btn:hover { border-color: var(--cv-ink); }
.cv-icon-btn--solid { background: var(--cv-ink); border-color: var(--cv-ink); color: #fff !important; }
.cv-icon-btn--solid:hover { background: var(--cv-teal-dark); border-color: var(--cv-teal-dark); }

.cv-empty {
	padding: 26px;
	border: 1px dashed #c7d2cf;
	border-radius: var(--cv-radius);
	background: var(--cv-surface);
	color: var(--cv-muted);
}
.cv-empty p + p { margin-top: 6px; }
.cv-empty strong { color: var(--cv-ink); }

.cv-support {
	margin-top: 40px;
	padding: 34px 30px;
	background: var(--cv-surface);
	border: 1px solid var(--cv-line);
	border-radius: var(--cv-radius);
	text-align: center;
}
.cv-support h3 { font-size: 22px; font-weight: 700; }
.cv-support p { max-width: 62ch; margin: 10px auto 22px; color: var(--cv-muted); }
.cv-support .cv-support__address { margin: 12px auto 0; font-size: 14px; }

.cv-dash__foot { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--cv-line); text-align: center; }

.cv-preview-bar {
	margin: 0 auto 20px;
	max-width: 1120px;
	padding: 12px 16px;
	border-radius: 8px;
	background: #fff6e0;
	border: 1px solid #f0d58a;
	font-size: 14px;
}
.cv-preview-bar a { margin-right: 10px; font-weight: 600; }
.cv-preview-bar a[aria-current="true"] { color: var(--cv-ink); text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
	.cv-auth { padding: 30px 20px 24px; border-left: 0; border-right: 0; border-radius: 0; }
	.cv-row { grid-template-columns: 1fr; gap: 0; }
	.cv-welcome { padding: 22px 20px; }
	.cv-welcome h2 { font-size: 23px; }
	.cv-product__head { padding: 14px 16px; flex-wrap: wrap; }
	.cv-product__count { width: 100%; padding-left: 52px; margin-top: -8px; }
	.cv-doc { flex-wrap: wrap; }
	.cv-doc__actions { width: 100%; padding-left: 60px; }
	.cv-account__name { display: none; }
	.cv-support { padding: 26px 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.cv-portal * { transition: none !important; }
}
.cv-btn.is-busy { opacity: .7; cursor: progress; }
.cv-field__links { margin-top: 6px !important; font-size: 14px; font-weight: 600; display: flex; gap: 8px; }
.cv-actions--form { justify-content: flex-start; margin-top: 8px; }
