/* HS Client Portal — base styles */

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

.cp-portal-body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #f5f5f5;
	color: #1a1a1a;
}

/* ── Layout ─────────────────────────────────────────────── */

.cp-login {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

@keyframes cp-modal-in {
	from { opacity: 0; transform: scale(.96) translateY(-8px); }
	to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.cp-login--inline {
	display: flex;
	justify-content: center;
	padding: 2rem 1.5rem;
}

.cp-login__card {
	position: relative;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 40px rgba(0,0,0,.22);
	padding: 2.5rem 2rem;
	width: 100%;
	max-width: 420px;
	animation: cp-modal-in .2s ease-out;
}

.cp-login--inline .cp-login__card {
	box-shadow: 0 4px 24px rgba(0,0,0,.08);
	animation: none;
}

.cp-login__close {
	position: absolute;
	top: .75rem;
	right: .75rem;
	background: none;
	border: none;
	font-size: 1.1rem;
	line-height: 1;
	padding: .3rem .4rem;
	border-radius: 4px;
	cursor: pointer;
	color: #888;
}

.cp-login__close:hover { color: #111; background: #f3f4f6; }

.cp-login__card--sent,
.cp-login__card--center { text-align: center; }

.cp-login__icon { font-size: 2.5rem; margin-bottom: 1rem; }
.cp-login__title { margin: 0 0 .5rem; font-size: 1.6rem; font-weight: 700; }
.cp-login__subtitle { color: #555; margin-bottom: 1.5rem; }

.cp-dashboard {
	max-width: 860px;
	margin: 0 auto;
	padding: 1rem;
}

.cp-dashboard--loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
}

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

.cp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .75rem 0 1rem;
	border-bottom: 2px solid #e5e5e5;
	margin-bottom: 1.25rem;
}

.cp-header__brand { font-weight: 700; font-size: 1.2rem; }
.cp-header__email { font-size: .875rem; color: #555; margin-right: .75rem; }

/* ── Tabs ────────────────────────────────────────────────── */

.cp-tabs {
	display: flex;
	gap: .25rem;
	border-bottom: 2px solid #e5e5e5;
	margin-bottom: 1.5rem;
	overflow-x: auto;
}

.cp-tab {
	background: none;
	border: none;
	padding: .6rem 1rem;
	cursor: pointer;
	font-size: .925rem;
	color: #555;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	white-space: nowrap;
}

.cp-tab:hover { color: #111; }
.cp-tab--active { color: #0073aa; border-bottom-color: #0073aa; font-weight: 600; }

/* ── Cards ───────────────────────────────────────────────── */

.cp-list__heading { font-size: 1.1rem; margin: 0 0 1rem; }

.cp-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: .75rem;
}

.cp-card--paid { opacity: .75; }

.cp-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: .6rem;
}

.cp-card__title { font-weight: 600; }

.cp-card__details {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: .25rem .5rem;
	font-size: .875rem;
	color: #444;
	margin: 0 0 .75rem;
}

.cp-card__details dt { font-weight: 500; color: #888; }

.cp-card__actions { display: flex; gap: .5rem; }

/* ── Badges ──────────────────────────────────────────────── */

.cp-badge {
	display: inline-block;
	padding: .2rem .55rem;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.cp-badge--green  { background: #d1fae5; color: #065f46; }
.cp-badge--blue   { background: #dbeafe; color: #1e40af; }
.cp-badge--yellow { background: #fef3c7; color: #92400e; }
.cp-badge--red    { background: #fee2e2; color: #991b1b; }
.cp-badge--grey   { background: #f3f4f6; color: #374151; }

/* ── Alerts ──────────────────────────────────────────────── */

.cp-alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .75rem 1rem;
	border-radius: 6px;
	margin-bottom: 1rem;
	font-size: .9rem;
}

.cp-alert--success { background: #d1fae5; color: #065f46; }
.cp-alert--error   { background: #fee2e2; color: #991b1b; }

.cp-alert__dismiss {
	background: none;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	color: inherit;
	opacity: .7;
	padding: 0 .25rem;
}

/* ── Forms ───────────────────────────────────────────────── */

.cp-login__form {
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

.cp-label { font-size: .875rem; font-weight: 500; }

.cp-input {
	padding: .6rem .875rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 1rem;
	width: 100%;
}

.cp-input:focus { outline: none; border-color: #0073aa; box-shadow: 0 0 0 3px rgba(0,115,170,.15); }

/* ── Buttons ─────────────────────────────────────────────── */

.cp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	padding: .55rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	font-size: .9rem;
	font-weight: 500;
	text-decoration: none;
}

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

.cp-btn--primary   { background: #0073aa; color: #fff; border-color: #0073aa; }
.cp-btn--primary:hover:not(:disabled)   { background: #005d87; }

.cp-btn--secondary { background: #fff; color: #0073aa; border-color: #0073aa; }
.cp-btn--secondary:hover:not(:disabled) { background: #f0f9ff; }

.cp-btn--ghost     { background: none; border-color: transparent; color: #555; }
.cp-btn--ghost:hover:not(:disabled) { background: #f3f4f6; }

/* ── Spinner ─────────────────────────────────────────────── */

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

.cp-spinner {
	display: inline-block;
	border: 2px solid rgba(0,0,0,.15);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: cp-spin .7s linear infinite;
}

.cp-spinner--md { width: 1.5rem; height: 1.5rem; }
.cp-spinner--sm { width: 1rem; height: 1rem; border-width: 2px; }

/* ── Empty states ────────────────────────────────────────── */

.cp-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #888;
}

/* ── Photos ──────────────────────────────────────────────── */

.cp-photos__group { margin-bottom: 2rem; }

.cp-photos__group-heading {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 .75rem;
	padding-bottom: .4rem;
	border-bottom: 1px solid #e5e5e5;
}

.cp-photos__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1rem;
}

.cp-photo img {
	width: 100%;
	border-radius: 6px;
	display: block;
}

.cp-photo__caption { font-size: .8rem; color: #555; margin: .3rem 0 0; }

/* ── Profile tab ─────────────────────────────────────────── */

.cp-profile-fields {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin: .75rem 0 1.5rem;
}

.cp-field {
	display: flex;
	flex-direction: column;
	gap: .375rem;
}

.cp-field label {
	font-size: .875rem;
	font-weight: 500;
	color: #374151;
}

.cp-field__static {
	margin: 0;
	font-size: .9375rem;
	color: #555;
}

/* ── Error notice ────────────────────────────────────────── */

.cp-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
	border-radius: 6px;
	padding: .65rem .875rem;
	margin-bottom: .75rem;
	font-size: .9rem;
}
