/* =====================================================
   LOGIN PAGE
   ===================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body.cp-login-page {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	min-height: 100vh;
	display: flex;
}

.cp-login-wrapper {
	min-height: 100vh;
	width: 100%;
	display: flex;
	align-items: stretch;
	position: relative;
}

.cp-login-bg {
	position: fixed;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
	filter: brightness(0.3);
}

.cp-login-bg-pattern {
	position: fixed;
	inset: 0;
	background: linear-gradient(135deg, #1a1f35 0%, #0f1320 50%, #1a1f35 100%);
	z-index: 0;
}

.cp-login-bg-pattern::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 20% 30%, rgba(124, 106, 247, 0.15) 0%, transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(124, 106, 247, 0.1) 0%, transparent 50%);
}

.cp-login-container {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	width: 100%;
	padding: 2rem 1rem;
}

.cp-login-card {
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(20px);
	border-radius: 20px;
	padding: 2.5rem 2.5rem 2rem;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

/* Logo */
.cp-login-logo {
	text-align: center;
	margin-bottom: 1.5rem;
}

.cp-login-logo-img {
	max-height: 48px;
	margin: 0 auto;
	display: block;
}

/* Site icon variant — larger and rounded like an app icon */
.cp-login-logo-img.cp-login-site-icon {
	width: 80px;
	height: 80px;
	max-height: 80px;
	border-radius: 20px;
	object-fit: cover;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cp-login-portal-name {
	display: inline-block;
	font-size: 1.5rem;
	font-weight: 800;
	color: #1a1f35;
	letter-spacing: -0.03em;
}

/* Titles */
.cp-login-title {
	font-size: 1.375rem;
	font-weight: 700;
	color: #1a1d2e;
	margin-bottom: 0.375rem;
	text-align: center;
}

.cp-login-subtitle {
	font-size: 0.875rem;
	color: #9aa0b4;
	margin-bottom: 1.5rem;
	text-align: center;
}

/* Form */
.cp-login-form {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.cp-form-group {
	margin-bottom: 1.25rem;
}

.cp-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: #1a1d2e;
	margin-bottom: 0.375rem;
}

.cp-login-input {
	display: block;
	width: 100%;
	padding: 0.75rem 1rem;
	background: #f5f6fa;
	border: 1.5px solid #e8eaed;
	border-radius: 10px;
	font-size: 0.9375rem;
	color: #1a1d2e;
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
	-webkit-appearance: none;
}

.cp-login-input:focus {
	border-color: #7c6af7;
	box-shadow: 0 0 0 3px rgba(124, 106, 247, 0.15);
	background: #ffffff;
}

.cp-login-input.has-error {
	border-color: #ef4444;
}

/* Password field */
.cp-login-password-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.375rem;
}

.cp-login-forgot {
	font-size: 0.8125rem;
	color: #7c6af7;
	text-decoration: none;
	font-weight: 500;
	transition: color 150ms;
}

.cp-login-forgot:hover { color: #6a59e8; }

.cp-login-password-wrapper {
	position: relative;
}

.cp-login-toggle-pwd {
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: #9aa0b4;
	display: flex;
	align-items: center;
	padding: 0.25rem;
	border-radius: 4px;
	transition: color 150ms;
}

.cp-login-toggle-pwd:hover { color: #1a1d2e; }

/* Remember */
.cp-login-remember {
	margin-bottom: 1.5rem !important;
}

.cp-login-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.875rem;
	color: #4a5568;
	user-select: none;
}

.cp-login-checkbox-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: #7c6af7;
	cursor: pointer;
}

/* Submit */
.cp-login-submit {
	display: block;
	width: 100%;
	padding: 0.875rem;
	background: #7c6af7;
	color: #ffffff !important;
	border: none;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 150ms ease;
	font-family: inherit;
	text-align: center;
	text-decoration: none;
}

.cp-login-submit:hover {
	background: #6a59e8;
	box-shadow: 0 4px 14px rgba(124, 106, 247, 0.45);
	transform: translateY(-1px);
}

.cp-login-submit:active {
	transform: translateY(0);
}

/* Notices */
.cp-notice {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	border-radius: 10px;
	border: 1px solid;
	margin-bottom: 1.25rem;
}

.cp-notice-error {
	background: #fee2e2;
	border-color: #ef4444;
	color: #991b1b;
}

.cp-notice-content p {
	font-size: 0.875rem;
	margin: 0;
}

/* Footer */
.cp-login-footer-text {
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.8125rem;
	margin-top: 1.5rem;
	text-align: center;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 480px) {
	.cp-login-card {
		padding: 2rem 1.5rem;
		border-radius: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp-login-submit { transition: background 150ms; }
	.cp-login-submit:hover { transform: none; }
}

/* =====================================================
   SIGNUP — "New client? Create an account" link
   ===================================================== */

.cp-signup-prompt {
	text-align: center;
	margin-top: 1.125rem;
	font-size: 0.875rem;
	color: #6b7280;
}

.cp-signup-link {
	color: #1bb8b5;
	text-decoration: none;
	font-weight: 500;
	transition: color 150ms;
}

.cp-signup-link:hover { color: #17a3a0; }

/* =====================================================
   SIGNUP CARD
   ===================================================== */

:root {
	--cp-su-accent:       #1bb8b5;
	--cp-su-accent-hover: #17a3a0;
	--cp-su-accent-light: #e0f7f7;
}

.cp-signup-card {
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(20px);
	border-radius: 20px;
	padding: 2rem 2.25rem 1.75rem;
	width: 100%;
	max-width: 520px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
	max-height: 92vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.cp-signup-card::-webkit-scrollbar { width: 4px; }
.cp-signup-card::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Progress bar ── */
.cp-signup-progress-wrap {
	margin-bottom: 1.25rem;
}

.cp-signup-progress-track {
	height: 6px;
	background: #e8eaed;
	border-radius: 99px;
	overflow: hidden;
	margin-bottom: 0.4rem;
}

.cp-signup-progress-fill {
	height: 100%;
	background: var(--cp-su-accent);
	border-radius: 99px;
	transition: width 0.4s ease;
	width: 0%;
}

.cp-signup-progress-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
	color: #9aa0b4;
}

/* ── Step title ── */
.cp-signup-step-title {
	font-size: 1.375rem;
	font-weight: 700;
	color: #1a1d2e;
	margin-bottom: 1.25rem;
	text-align: center;
}

/* ── Two-column row ── */
.cp-signup-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

/* ── Sub-labels (First / Last) ── */
.cp-signup-field-label {
	display: block;
	font-size: 0.75rem;
	color: #9aa0b4;
	margin-top: 0.25rem;
}

/* ── Required asterisk ── */
.cp-required { color: #ef4444; }

/* ── Inputs ── */
.cp-signup-input {
	display: block;
	width: 100%;
	padding: 0.65rem 0.9rem;
	background: #f5f6fa;
	border: 1.5px solid #e8eaed;
	border-radius: 10px;
	font-size: 0.9rem;
	font-family: inherit;
	color: #1a1d2e;
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
	-webkit-appearance: none;
}

.cp-signup-input:focus {
	border-color: var(--cp-su-accent);
	box-shadow: 0 0 0 3px rgba(27, 184, 181, 0.15);
	background: #fff;
}

.cp-signup-textarea {
	resize: vertical;
	min-height: 100px;
	line-height: 1.5;
}

/* ── Service category selector ── */
.cp-service-category-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .75rem;
}
.cp-service-cat-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .5rem;
	padding: 1rem .75rem;
	border: 2px solid var(--cp-border, #e5e7eb);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
	background: var(--cp-bg-card, #fff);
	text-align: center;
	user-select: none;
}
.cp-service-cat-option:hover {
	border-color: var(--cp-accent, #7c6af7);
	background: var(--cp-accent-light, #ede9fe);
}
.cp-service-cat-option.is-selected {
	border-color: var(--cp-accent, #7c6af7);
	background: var(--cp-accent-light, #ede9fe);
	box-shadow: 0 0 0 3px rgba(124,106,247,.15);
}
.cp-service-cat-icon {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: var(--cp-bg-hover, #f3f4f6);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cp-text-secondary, #6b7280);
	transition: background .2s, color .2s;
}
.cp-service-cat-option.is-selected .cp-service-cat-icon {
	background: var(--cp-accent, #7c6af7);
	color: #fff;
}
.cp-service-cat-label {
	font-size: .82rem;
	font-weight: 600;
	color: var(--cp-text-secondary, #6b7280);
	transition: color .2s;
}
.cp-service-cat-option.is-selected .cp-service-cat-label {
	color: var(--cp-accent, #7c6af7);
}

/* ── Password field with toggle ── */
.cp-signup-pwd-wrap {
	position: relative;
}

.cp-signup-pwd-wrap .cp-signup-input {
	padding-right: 2.5rem;
}

.cp-pwd-toggle {
	position: absolute;
	right: 0.6rem;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: #9aa0b4;
	display: flex;
	align-items: center;
	padding: 0.25rem;
	border-radius: 4px;
	transition: color 150ms;
}

.cp-pwd-toggle:hover { color: #1a1d2e; }

/* ── Invoice dropzone ── */
.cp-invoice-dropzone {
	border: 2px dashed #d1d5db;
	border-radius: 10px;
	padding: 1.5rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 150ms, background 150ms;
	background: #fafafa;
}

.cp-invoice-dropzone:hover,
.cp-invoice-dropzone.is-dragover {
	border-color: var(--cp-su-accent);
	background: var(--cp-su-accent-light);
}

.cp-invoice-dropzone-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	color: #9aa0b4;
}

.cp-invoice-hint {
	font-size: 0.8125rem;
	margin: 0;
}

.cp-invoice-filename {
	font-size: 0.875rem;
	font-weight: 500;
	color: #1a1d2e;
	margin: 0;
	word-break: break-all;
}

/* ── Contract box ── */
.cp-contract-box {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 0;
	margin-bottom: 1.25rem;
	font-size: 0.8rem;
	line-height: 1.65;
	color: #374151;
}

.cp-contract-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.875rem 1.25rem 0;
	gap: 0.75rem;
}

.cp-contract-heading {
	font-size: 0.9375rem;
	font-weight: 700;
	color: #1a1d2e;
	margin: 0;
}

.cp-contract-fullscreen-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.75rem;
	font-weight: 600;
	color: #7c6af7;
	background: #ede9fe;
	border: none;
	border-radius: 6px;
	padding: 5px 10px;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s;
	font-family: inherit;
}

.cp-contract-fullscreen-btn:hover {
	background: #ddd6fe;
	color: #5b21b6;
}

.cp-contract-body {
	padding: 0.875rem 1.25rem 1.125rem;
	max-height: 160px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.cp-contract-box::-webkit-scrollbar,
.cp-contract-body::-webkit-scrollbar { width: 4px; }
.cp-contract-box::-webkit-scrollbar-thumb,
.cp-contract-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.cp-contract-body p { margin-bottom: 0.5rem; }

.cp-contract-body ul {
	padding-left: 1.25rem;
	margin-bottom: 0.5rem;
	list-style: disc;
}

.cp-contract-body li { margin-bottom: 0.2rem; }

.cp-contract-summary {
	margin-top: 0.875rem;
	padding-top: 0.625rem;
	border-top: 1px solid #e5e7eb;
}

.cp-contract-summary p { margin-bottom: 0.15rem; }

/* ── Contract fullscreen modal ── */
.cp-contract-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(10, 10, 30, 0.7);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	animation: cp-modal-fadein 0.2s ease;
}

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

@keyframes cp-modal-fadein {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.cp-contract-modal-inner {
	background: #ffffff;
	border-radius: 16px;
	width: 100%;
	max-width: 720px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 32px 80px rgba(0,0,0,0.35);
	animation: cp-modal-slidein 0.22s ease;
	overflow: hidden;
}

@keyframes cp-modal-slidein {
	from { transform: translateY(16px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.cp-contract-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #e5e7eb;
	flex-shrink: 0;
}

.cp-contract-modal-header h2 {
	font-size: 1.0625rem;
	font-weight: 700;
	color: #1a1d2e;
	margin: 0;
}

.cp-contract-modal-close {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	border: none;
	background: #f3f4f6;
	color: #374151;
	cursor: pointer;
	transition: background 0.15s;
	flex-shrink: 0;
}

.cp-contract-modal-close:hover {
	background: #fee2e2;
	color: #ef4444;
}

.cp-contract-modal-body {
	padding: 1.5rem;
	overflow-y: auto;
	font-size: 0.875rem;
	line-height: 1.7;
	color: #374151;
	flex: 1;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.cp-contract-modal-body p { margin-bottom: 0.6rem; }
.cp-contract-modal-body ul { padding-left: 1.5rem; margin-bottom: 0.6rem; list-style: disc; }
.cp-contract-modal-body li { margin-bottom: 0.3rem; }
.cp-contract-modal-body h2,
.cp-contract-modal-body h3 { margin: 1rem 0 0.4rem; color: #1a1d2e; }


/* ── Signature canvas ── */
.cp-signature-wrap {
	position: relative;
	border: 1.5px solid #bfdbfe;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fbff;
}

.cp-signature-canvas {
	display: block;
	width: 100%;
	cursor: crosshair;
	touch-action: none;
}

.cp-sig-clear-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.25rem 0.625rem;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-size: 0.75rem;
	color: #6b7280;
	cursor: pointer;
	transition: all 150ms;
}

.cp-sig-clear-btn:hover {
	background: #e5e7eb;
	color: #1a1d2e;
}

.cp-sig-smoothing-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.5rem;
	padding: 0 0.25rem;
}

.cp-sig-smoothing-label {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.72rem;
	color: #6b7280;
	white-space: nowrap;
	flex-shrink: 0;
}

.cp-sig-smoothing-slider {
	flex: 1;
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, #1a56db var(--val, 60%), #e5e7eb var(--val, 60%));
	outline: none;
	cursor: pointer;
}
.cp-sig-smoothing-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #1a56db;
	box-shadow: 0 1px 4px rgba(26,86,219,0.4);
	cursor: pointer;
	transition: transform 0.15s;
}
.cp-sig-smoothing-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.cp-sig-smoothing-slider::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #1a56db;
	border: none;
	box-shadow: 0 1px 4px rgba(26,86,219,0.4);
	cursor: pointer;
}

.cp-sig-smoothing-val {
	font-size: 0.7rem;
	color: #1a56db;
	font-weight: 600;
	min-width: 2.5rem;
	text-align: right;
	flex-shrink: 0;
}

/* ── Error box ── */
.cp-signup-error-box {
	background: #fee2e2;
	border: 1px solid #ef4444;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	color: #991b1b;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

/* ── Navigation ── */
.cp-signup-nav {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	justify-content: center;
	margin-top: 1.25rem;
	flex-wrap: wrap;
}

.cp-signup-btn {
	padding: 0.575rem 1.625rem;
	background: var(--cp-su-accent);
	color: #fff;
	border: none;
	border-radius: 99px;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 150ms, box-shadow 150ms;
	min-width: 96px;
}

.cp-signup-btn:hover:not(:disabled) {
	background: var(--cp-su-accent-hover);
	box-shadow: 0 4px 14px rgba(27, 184, 181, 0.4);
}

.cp-signup-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.cp-signup-btn-outline {
	background: transparent;
	color: var(--cp-su-accent);
	border: 2px solid var(--cp-su-accent);
}

.cp-signup-btn-outline:hover:not(:disabled) {
	background: var(--cp-su-accent-light);
	box-shadow: none;
}

.cp-signup-restart {
	font-size: 0.875rem;
	color: #ef4444;
	text-decoration: none;
	font-weight: 500;
	transition: color 150ms;
}

.cp-signup-restart:hover { color: #dc2626; }

/* ── Responsive ── */
@media (max-width: 560px) {
	.cp-signup-card {
		padding: 1.5rem 1.25rem;
		border-radius: 16px;
		max-height: 95vh;
	}

	.cp-signup-row {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}

	.cp-signup-step-title { font-size: 1.2rem; }
}
