/* ============================================
   BinaWeb Profile — Frontend Styles
   Accordion design · compact · mobile-first.
   ============================================ */

/* Hide theme page title / hero on the profile page
   (theme adds `page-{sanitized title}` = page-my-profile). */
.page-profile .page-hero,
.page-profile .page-title,
.page-my-profile .page-hero,
.page-my-profile .page-title {
	display: none;
}

/* --- Theme container overrides (scoped to the profile page only) --- */
body.page-my-profile .site-main,
body.page-profile .site-main {
	padding-top: 0;
}

body.page-my-profile .content-area,
body.page-profile .content-area {
	padding: 112px 24px 64px;
}

/* The theme's off-canvas slide-panel & footer-accent-line overflow the
   viewport on mobile → clip horizontal scroll (scrollX stays 0). */
body.page-my-profile,
body.page-profile {
	overflow-x: clip;
}

:root:has(body.page-my-profile),
:root:has(body.page-profile) {
	overflow-x: clip;
}

/* --- Root --- */
.bw-profile-root {
	max-width: 860px;
	margin: 0 auto;
	padding: 0.5rem 0 2.5rem;
}

/* --- Header card (identity, always visible) --- */
.bw-profile-card {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.bw-profile-header {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.9rem 1.125rem;
	margin-bottom: 0.75rem;
	position: relative;
	overflow: hidden;
}

.bw-profile-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #f97316, #a855f7, #06b6d4);
	opacity: 0.9;
}

.bw-profile-avatar-wrap {
	position: relative;
	flex-shrink: 0;
}

.bw-profile-avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, #f97316, #a855f7);
	border: 2px solid rgba(249, 115, 22, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-size: 1.3rem;
	font-weight: 800;
	color: #fff;
	box-shadow: 0 3px 12px rgba(168, 85, 247, 0.35);
}

.bw-profile-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bw-profile-avatar-edit {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: linear-gradient(135deg, #f97316, #a855f7);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	transition: transform 0.15s ease;
}

.bw-profile-avatar-edit:hover { transform: scale(1.12); }

.bw-profile-header-info { min-width: 0; }

.bw-profile-name {
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #fff;
	margin: 0 0 0.1rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bw-profile-email {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.78rem;
	margin: 0 0 0.4rem;
}

.bw-profile-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.bw-profile-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.14rem 0.5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.65);
	font-size: 0.68rem;
	font-weight: 600;
}

.bw-profile-badge--verified {
	background: rgba(16, 185, 129, 0.16);
	border-color: rgba(16, 185, 129, 0.35);
	color: #34d399;
}

/* --- Accordion --- */
.bw-profile-accordion {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.bw-profile-acc {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	transition: border-color 0.2s ease;
}

.bw-profile-acc--open {
	border-color: rgba(249, 115, 22, 0.35);
}

.bw-profile-acc-head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.8rem 1rem;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
}

.bw-profile-acc-head:hover {
	background: rgba(255, 255, 255, 0.03);
}

.bw-profile-acc-icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	background: linear-gradient(135deg, #f97316, #f43f5e);
	box-shadow: 0 3px 10px rgba(249, 115, 22, 0.3);
}

.bw-profile-acc--projects .bw-profile-acc-icon {
	background: linear-gradient(135deg, #a855f7, #6366f1);
	box-shadow: 0 3px 10px rgba(168, 85, 247, 0.3);
}

.bw-profile-acc--business .bw-profile-acc-icon {
	background: linear-gradient(135deg, #06b6d4, #0ea5e9);
	box-shadow: 0 3px 10px rgba(6, 182, 212, 0.3);
}

.bw-profile-acc--policies .bw-profile-acc-icon {
	background: linear-gradient(135deg, #64748b, #475569);
	box-shadow: 0 3px 10px rgba(100, 116, 139, 0.3);
}

.bw-profile-acc-title {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
	min-width: 0;
}

.bw-profile-acc-label {
	font-size: 0.9rem;
	font-weight: 700;
	color: #fff;
}

.bw-profile-acc-sub {
	font-size: 0.7rem;
	color: rgba(255, 255, 255, 0.45);
}

.bw-profile-acc-count {
	flex-shrink: 0;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: rgba(168, 85, 247, 0.22);
	border: 1px solid rgba(168, 85, 247, 0.45);
	color: #c084fc;
	font-size: 0.68rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bw-profile-acc-chev {
	flex-shrink: 0;
	width: 9px;
	height: 9px;
	border-right: 2px solid rgba(255, 255, 255, 0.5);
	border-bottom: 2px solid rgba(255, 255, 255, 0.5);
	transform: rotate(45deg);
	transition: transform 0.25s ease;
	margin-right: 3px;
}

.bw-profile-acc--open .bw-profile-acc-chev {
	transform: rotate(225deg);
}

/* Smooth open/close — grid-template-rows must use minmax(0, …fr) or a
   sliver of the inner padding shows when closed. */
.bw-profile-acc-body {
	display: grid;
	grid-template-rows: minmax(0, 0fr);
	transition: grid-template-rows 0.3s ease;
}

.bw-profile-acc--open .bw-profile-acc-body {
	grid-template-rows: minmax(0, 1fr);
}

.bw-profile-acc-inner {
	min-height: 0;
	overflow: hidden;
	padding: 0.25rem 1.125rem 1.125rem;
}

@media (prefers-reduced-motion: reduce) {
	.bw-profile-acc-body { transition: none; }
	.bw-profile-acc-chev { transition: none; }
}

/* --- Profile form --- */
.bw-profile-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.55rem 0.75rem;
}

.bw-profile-field--textarea {
	grid-column: 1 / -1;
}

.bw-profile-field label {
	display: block;
	color: rgba(255, 255, 255, 0.62);
	font-size: 0.72rem;
	font-weight: 500;
	margin-bottom: 0.25rem;
	letter-spacing: 0.01em;
}

.bw-req { color: #f97316; }

/* Compact inputs (overrides login.css .bw-form-input). */
.bw-profile-root .bw-form-input {
	padding: 0.5rem 0.7rem;
	font-size: 0.83rem;
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.11);
	color: #fff;
}

.bw-profile-root .bw-form-input:focus {
	border-color: #f97316;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
	background: rgba(255, 255, 255, 0.07);
}

.bw-profile-root .bw-form-input::placeholder {
	color: rgba(255, 255, 255, 0.3);
}

.bw-profile-form-actions {
	margin-top: 0.9rem;
	display: flex;
	justify-content: flex-end;
}

.bw-profile-root .bw-btn-primary {
	padding: 0.55rem 1.25rem;
	font-size: 0.82rem;
	font-weight: 700;
	border-radius: 9px;
	background: linear-gradient(135deg, #f97316, #f43f5e);
	border: none;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bw-profile-root .bw-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(249, 115, 22, 0.45);
}

.bw-profile-message {
	margin-top: 0.6rem;
	font-size: 0.78rem;
}

/* --- Login prompt --- */
.bw-profile-login-prompt {
	text-align: center;
	max-width: 460px;
	margin: 2.5rem auto;
	padding: 2.5rem 1.5rem;
	position: relative;
	overflow: hidden;
}

.bw-profile-login-prompt::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #f97316, #a855f7, #06b6d4);
	opacity: 0.9;
}

.bw-profile-lock {
	font-size: 2.5rem;
	margin-bottom: 0.6rem;
}

.bw-profile-login-prompt h2 {
	font-family: 'Plus Jakarta Sans', sans-serif;
	color: #fff;
	font-size: 1.2rem;
	margin: 0 0 0.4rem;
}

.bw-profile-login-prompt p {
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.85rem;
	margin: 0 0 1.25rem;
}

/* --- Projects --- */
.bw-profile-projects {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.bw-profile-project {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 10px;
	padding: 0.6rem 0.8rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bw-profile-project:hover {
	border-color: rgba(168, 85, 247, 0.35);
	background: rgba(168, 85, 247, 0.05);
}

.bw-profile-project-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.35rem;
}

.bw-profile-project-name {
	font-size: 0.85rem;
	font-weight: 600;
	color: #fff;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Color-coded status badges */
.bw-profile-project-status {
	flex-shrink: 0;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: rgba(148, 163, 184, 0.18);
	border: 1px solid rgba(148, 163, 184, 0.35);
	color: #cbd5e1;
}

.bw-profile-project-status--new         { background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.4); color: #60a5fa; }
.bw-profile-project-status--in_review   { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }
.bw-profile-project-status--in_progress { background: rgba(168, 85, 247, 0.18); border-color: rgba(168, 85, 247, 0.4); color: #c084fc; }
.bw-profile-project-status--completed   { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.bw-profile-project-status--cancelled   { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }

.bw-profile-project-meta,
.bw-profile-project-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.7rem;
}

.bw-profile-project-chip,
.bw-profile-project-date,
.bw-profile-project-dev,
.bw-profile-project-total {
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 0.55);
}

.bw-profile-project-total {
	font-weight: 700;
	color: #fb923c;
	margin-left: auto;
}

.bw-profile-empty {
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.8rem;
}

/* --- Client card --- */
.bw-profile-client-name {
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 0.5rem;
}

.bw-profile-client-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bw-profile-client-list li {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	font-size: 0.75rem;
}

.bw-profile-client-list li:last-child { border-bottom: none; }

.bw-profile-client-list span { color: rgba(255, 255, 255, 0.45); }

.bw-profile-client-list strong {
	color: rgba(255, 255, 255, 0.85);
	font-weight: 600;
	text-align: right;
}

.bw-profile-client-list a {
	color: #22d3ee;
	text-decoration: none;
	word-break: break-all;
	text-align: right;
}

.bw-profile-client-list a:hover { text-decoration: underline; }

/* --- Policies --- */
.bw-profile-policy { margin-bottom: 0.75rem; }
.bw-profile-policy:last-child { margin-bottom: 0; }

.bw-profile-policy h4 {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.78rem;
	margin: 0 0 0.2rem;
}

.bw-profile-policy p {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.72rem;
	line-height: 1.55;
	margin: 0;
}

/* --- Theme isolation (see notes) --- */
.bw-profile-root .bw-profile-name {
	font-size: 1.1rem !important;
	line-height: 1.3 !important;
	margin: 0 0 0.1rem !important;
	color: #fff !important;
}

.bw-profile-root .bw-profile-email {
	font-size: 0.78rem !important;
	line-height: 1.4 !important;
	margin: 0 0 0.4rem !important;
	color: rgba(255, 255, 255, 0.5) !important;
}

.bw-profile-root .bw-profile-acc-label {
	font-size: 0.9rem !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	color: #fff !important;
}

.bw-profile-root .bw-profile-acc-sub {
	font-size: 0.7rem !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	color: rgba(255, 255, 255, 0.45) !important;
}

.bw-profile-root .bw-profile-project-name {
	font-size: 0.85rem !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	color: #fff !important;
}

.bw-profile-root .bw-profile-client-name {
	font-size: 0.95rem !important;
	line-height: 1.3 !important;
	margin: 0 0 0.5rem !important;
	color: #fff !important;
}

.bw-profile-root .bw-profile-policy h4 {
	font-size: 0.78rem !important;
	margin: 0 0 0.2rem !important;
	color: rgba(255, 255, 255, 0.85) !important;
}

.bw-profile-root .bw-profile-policy p {
	font-size: 0.72rem !important;
	line-height: 1.55 !important;
	margin: 0 !important;
	color: rgba(255, 255, 255, 0.5) !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
	/* Header is 72px fixed on phones → tighter top gap. */
	body.page-my-profile .content-area,
	body.page-profile .content-area {
		padding-top: 88px;
	}
}

@media (max-width: 640px) {
	/* Full-bleed edge-to-edge on phones. */
	body.page-my-profile .content-area,
	body.page-profile .content-area {
		padding-left: 0;
		padding-right: 0;
		padding-bottom: 48px;
	}

	.bw-profile-root {
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 0 0 2rem;
	}

	.bw-profile-card,
	.bw-profile-acc {
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.bw-profile-header {
		padding: 0.9rem 1rem;
		margin-bottom: 0.5rem;
	}

	.bw-profile-acc-head {
		padding: 0.75rem 1rem;
	}

	.bw-profile-fields {
		grid-template-columns: 1fr;
	}

	.bw-profile-form-actions {
		justify-content: stretch;
	}

	.bw-profile-root .bw-btn-primary {
		width: 100%;
	}
}

@media (max-width: 400px) {
	.bw-profile-acc-head { padding: 0.7rem 0.875rem; }
	.bw-profile-acc-inner { padding: 0.25rem 0.875rem 0.875rem; }
	.bw-profile-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
}
