/* =========================================================
   MTRS CLUB - Member Portal Stylesheet
   Theme: Clean light UI + sky blue accent (Option C)
   Extends assets/front/css/style.css (design tokens, resets, buttons)
========================================================= */

body.portal-body {
	--accent: #0ea5e9;
	--accent-dark: #0284c7;
	--accent-light: #e0f2fe;
	--accent-muted: #bae6fd;
	--surface: #ffffff;
	--surface-muted: #f8fafc;
	--border: #e2e8f0;
	--text-primary: #0f172a;
	--text-secondary: #64748b;
	--gray-50: #f8fafc;
	--gray-100: #f1f5f9;
	--gray-200: #e2e8f0;
	--gray-300: #cbd5e1;
	--gray-400: #94a3b8;
	--gray-600: #64748b;
	--gray-800: #1e293b;
	--navy-800: #0f172a;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
	--shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
}

body.portal-body h1,
body.portal-body h2,
body.portal-body h3,
body.portal-body h4,
body.portal-body h5 {
	color: var(--text-primary);
}

body.portal-body .logo .logo-icon {
	background: linear-gradient(135deg, var(--accent), var(--accent-dark));
	color: var(--white);
}
body.portal-body .logo .logo-text strong { color: var(--text-primary); }
body.portal-body .logo .logo-text span { color: var(--accent-dark); }

body.portal-body .btn-gold {
	background: var(--accent);
	color: var(--white);
	border-color: transparent;
	box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
body.portal-body .btn-gold:hover {
	background: var(--accent-dark);
	box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

body.portal-body .btn-navy {
	background: var(--text-primary);
	color: var(--white);
}
body.portal-body .btn-navy:hover { background: #1e293b; }

body.portal-body .form-control:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.portal-body { background: var(--surface-muted); min-height: 100vh; display: flex; flex-direction: column; }

/* Portal header */
.portal-header { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.portal-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 16px; flex-wrap: wrap; }
.portal-header-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.portal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.portal-nav-link {
	padding: 8px 14px;
	border-radius: 50px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--gray-600);
}
.portal-nav-link:hover { color: var(--accent-dark); background: var(--accent-light); }
.portal-nav-link.is-active { background: var(--accent-light); color: var(--accent-dark); }
.portal-page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.portal-document-title { font-size: 20px; margin: 0; color: var(--text-primary); }
.dashboard-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.dashboard-card-head h3 { margin-bottom: 0; }
.stat-box-alert { border: 1px solid #f3c4c4; background: #fffafa; }
.stat-box-alert .icon { background: #b93030; color: var(--white); }
.portal-alert-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 18px;
	margin-bottom: 24px;
	background: #fff8e8;
	border: 1px solid #f0d89a;
	border-radius: var(--radius);
}
.portal-alert-banner i { color: #b3791b; font-size: 20px; }
.portal-alert-banner strong { display: block; color: var(--text-primary); }
.portal-alert-banner span { font-size: 13px; color: var(--gray-600); }
.member-policy-card { flex-wrap: wrap; }
.member-policy-card .member-case-card-meta { align-items: center; }

.policy-document-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.policy-document-wrap { margin-bottom: 40px; }
.policy-document-paper {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--gray-100);
	padding: 40px 48px;
	max-width: 900px;
	margin: 0 auto;
}
.policy-document-content { font-size: 14.5px; line-height: 1.7; color: var(--gray-800); }
.policy-document-content h1, .policy-document-content h2, .policy-document-content h3 { color: var(--text-primary); }

@media print {
	.portal-header, .portal-footer, .policy-document-toolbar, .no-print { display: none !important; }
	.portal-body { background: var(--white); }
	.dashboard-section { padding: 0; }
	.policy-document-paper { box-shadow: none; border: none; padding: 0; max-width: none; }
}

@media (max-width: 992px) {
	.portal-header-inner { flex-direction: column; align-items: stretch; }
	.portal-nav { justify-content: center; }
	.portal-header-actions { justify-content: center; }
}

.portal-user { font-weight: 600; color: var(--text-primary); font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.portal-user i { color: var(--accent); font-size: 20px; }

.btn-outline-navy {
	background: transparent;
	border: 2px solid var(--border);
	color: var(--text-primary);
}
.btn-outline-navy:hover { background: var(--text-primary); border-color: var(--text-primary); color: var(--white); }
.btn-sm { padding: 9px 20px; font-size: 13.5px; }

/* Portal footer */
.portal-footer {
	margin-top: auto;
	padding: 22px 0;
	text-align: center;
	font-size: 13px;
	color: var(--gray-600);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}
.portal-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; width: 100%; }

/* =============== AUTH / LOGIN =============== */
.auth-section { flex: 1; display: flex; align-items: center; padding: 70px 0; }
.auth-wrap { display: flex; justify-content: center; }
.auth-card {
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	padding: 44px 40px;
	width: 100%;
	max-width: 650px;
}
.auth-card-head { text-align: center; margin-bottom: 26px; }
.auth-card-head .icon {
	width: 60px; height: 60px;
	background: var(--accent-light);
	color: var(--accent-dark);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 24px;
	margin: 0 auto 16px;
}
.auth-card-head h1 { font-size: 24px; margin-bottom: 8px; }
.auth-card-head p { font-size: 14px; margin-bottom: 0; }
.auth-note { font-size: 13px; text-align: center; margin: 20px 0 0; color: var(--gray-600); }
.auth-note a { color: var(--accent-dark); font-weight: 700; }
.auth-demo {
	margin-top: 18px;
	background: var(--gray-50);
	border: 1px dashed var(--gray-300);
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 12.5px;
	color: var(--gray-600);
	text-align: center;
}
.auth-demo strong { color: var(--text-primary); }

/* =============== DASHBOARD =============== */
.dashboard-section { padding: 50px 0 80px; }
.dashboard-welcome {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 34px;
}
.dashboard-welcome h1 { font-size: 26px; margin-bottom: 6px; }
.dashboard-welcome p { margin-bottom: 0; }
.status-badge {
	padding: 8px 18px;
	border-radius: 50px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.status-badge.status-active { background: #e6f6ec; color: #1c7a3d; }
.status-badge.status-inactive { background: #fdeaea; color: #b93030; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 34px; }
.stat-box {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 24px;
	display: flex;
	align-items: center;
	gap: 16px;
}
.stat-box .icon {
	width: 50px; height: 50px; min-width: 50px;
	background: var(--accent-light);
	color: var(--accent-dark);
	border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	font-size: 20px;
}
.stat-box strong { display: block; color: var(--text-primary); font-size: 16px; }
.stat-box span { font-size: 12.5px; color: var(--gray-600); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dashboard-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 30px;
}
.dashboard-card-wide { grid-column: 1 / -1; }
.dashboard-card h3 { font-size: 17px; margin-bottom: 20px; }
.detail-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.detail-list li span { color: var(--gray-600); }
.detail-list li strong { color: var(--text-primary); }
.note { font-size: 13px; color: var(--gray-600); margin: 16px 0 0; }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.quick-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 22px 12px;
	border-radius: 10px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-primary);
}
.quick-action i { font-size: 22px; color: var(--accent); }
.quick-action:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }
.quick-action:hover i { color: var(--white); }

.member-policy-list { display: flex; flex-direction: column; gap: 12px; }
.member-policy-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	background: var(--gray-50);
	border-radius: 8px;
	border: 1px solid var(--gray-100);
	flex-wrap: wrap;
}
.member-policy-item strong { display: block; color: var(--text-primary); margin-bottom: 4px; }
.member-policy-item span { font-size: 13px; color: var(--gray-600); }
.member-policy-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--gray-600); }

.member-cases-list { display: flex; flex-direction: column; gap: 12px; }
.member-case-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	border: 1px solid var(--gray-100);
	flex-wrap: wrap;
	color: inherit;
}
.member-case-card:hover { border-color: var(--accent-muted); }
.member-case-card strong { display: block; color: var(--text-primary); margin-bottom: 4px; }
.member-case-card span { font-size: 13px; color: var(--gray-600); }
.member-case-card-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.status-badge.fault-pending { background: #fdf3e3; color: #b3791b; }
.status-badge.fault-not_at_fault { background: #e6f6ec; color: #1c7a3d; }
.status-badge.fault-at_fault { background: #fdeaea; color: #b93030; }
.status-badge.fault-disputed { background: #eef0ff; color: #4a5fc1; }
.status-badge.case-open { background: #eef0ff; color: #4a5fc1; }
.status-badge.case-in_progress { background: #fdf3e3; color: #b3791b; }
.status-badge.case-closed { background: #e6f6ec; color: #1c7a3d; }

.status-badge.invoice-draft { background: var(--gray-100); color: var(--gray-600); }
.status-badge.invoice-sent { background: #eef0ff; color: #4a5fc1; }
.status-badge.invoice-partial { background: #fdf3e3; color: #b3791b; }
.status-badge.invoice-paid { background: #e6f6ec; color: #1c7a3d; }
.status-badge.invoice-overdue { background: #fdeaea; color: #b93030; }
.status-badge.invoice-cancelled { background: var(--gray-100); color: var(--gray-600); }

@media (max-width: 768px) {
	.stat-grid { grid-template-columns: 1fr 1fr; }
	.dashboard-grid { grid-template-columns: 1fr; }
	.auth-card { padding: 32px 24px; }
}
