/* ============================================================
   EM Member Area Styles
   ============================================================ */

/* ── Header Member Button ────────────────────────────────── */

.member-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 16px 7px 10px;
	border-radius: 99px;
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s, opacity .2s;
	vertical-align: middle;
	margin-left: 8px;
	white-space: nowrap;
}

/* Logged out — ghost style */
.member-btn--out {
	background: rgba(255,255,255,.12);
	color: #fff;
	border: 1.5px solid rgba(255,255,255,.5);
}
.member-btn--out:hover {
	background: rgba(255,255,255,.25);
	color: #fff;
}

/* Logged in — teal pill */
.member-btn--in {
	background: #4ac6b9;
	color: #fff;
	border: none;
}
.member-btn--in:hover {
	background: #2ea89b;
	color: #fff;
	opacity: .92;
}

.member-btn__avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255,255,255,.7);
	flex-shrink: 0;
}

.member-btn__initials {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(255,255,255,.25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .75rem;
	font-weight: 700;
	flex-shrink: 0;
}

.member-btn__icon {
	font-size: 1rem;
	line-height: 1;
}

.member-btn__label {
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 576px) {
	.member-btn__label { display: none; }
	.member-btn { padding: 7px 10px; }
}

/* ── Member Dropdown ─────────────────────────────────────── */

.member-dropdown {
	position: relative;
	display: inline-block;
	margin-left: 8px;
	vertical-align: middle;
}

.member-dropdown .member-btn--in {
	border: none;
	cursor: pointer;
	margin-left: 0;
}

.member-btn__caret {
	font-size: .65rem;
	margin-left: 2px;
	transition: transform .2s;
}

.member-dropdown.open .member-btn__caret {
	transform: rotate(180deg);
}

.member-dropdown__menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 180px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,.15);
	padding: 6px 0;
	z-index: 9999;
	animation: em-dropdown-in .15s ease;
}

@keyframes em-dropdown-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.member-dropdown.open .member-dropdown__menu {
	display: block;
}

.member-dropdown__item,
.member-dropdown__menu a.member-dropdown__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: .88rem;
	font-weight: 500;
	color: #1a2332 !important;
	text-decoration: none !important;
	transition: background .15s;
	white-space: nowrap;
}

.member-dropdown__item:hover,
.member-dropdown__menu a.member-dropdown__item:hover {
	background: #f5f8fb;
	color: #1a2332 !important;
}

.member-dropdown__item--logout,
.member-dropdown__menu a.member-dropdown__item--logout {
	color: #ef4444 !important;
}

.member-dropdown__item--logout:hover,
.member-dropdown__menu a.member-dropdown__item--logout:hover {
	background: #fef2f2;
	color: #ef4444 !important;
}

.member-dropdown__divider {
	height: 1px;
	background: #eee;
	margin: 4px 0;
}

:root {
	--em-primary:       #4ac6b9;
	--em-primary-dark:  #2ea89b;
	--em-primary-light: #e8faf8;
	--em-text:          #1a2332;
	--em-text-light:    #6b7a8d;
	--em-border:        #dde3ec;
	--em-bg:            #f5f8fb;
	--em-white:         #ffffff;
	--em-radius:        12px;
	--em-shadow:        0 2px 16px rgba(0,0,0,.08);
	--em-green:         #22c55e;
	--em-yellow:        #f59e0b;
	--em-red:           #ef4444;
}

/* ── Wrapper ─────────────────────────────────────────────── */

.em-member-wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 48px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--em-text);
}

/* ── Auth card (login / register) ────────────────────────── */

.em-member-login-wrap,
.em-member-register-wrap {
	max-width: 480px;
}

.em-member-card {
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 40px 36px 32px;
}

.em-member-card__header {
	text-align: center;
	margin-bottom: 28px;
}

.em-member-logo {
	font-size: 2.4rem;
	margin-bottom: 8px;
}

.em-member-card__header h2 {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--em-text);
}

.em-member-card__header p {
	color: var(--em-text-light);
	font-size: .9rem;
	margin: 0;
}

.em-member-footer {
	text-align: center;
	margin-top: 20px;
	font-size: .87rem;
	color: var(--em-text-light);
}

.em-member-footer a {
	color: var(--em-primary-dark);
	font-weight: 600;
	text-decoration: none;
}

.em-member-footer a:hover { text-decoration: underline; }

/* ── Password toggle ─────────────────────────────────────── */

.em-pass-wrap {
	position: relative;
}

.em-pass-wrap .em-input {
	padding-right: 40px;
}

.em-pass-toggle {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	font-size: 1rem;
	line-height: 1;
	color: var(--em-text-light);
}

/* ── Password strength ───────────────────────────────────── */

.em-password-strength {
	margin-top: 6px;
	font-size: .78rem;
	font-weight: 600;
	min-height: 18px;
}

.em-password-strength.weak   { color: var(--em-red); }
.em-password-strength.medium { color: var(--em-yellow); }
.em-password-strength.strong { color: var(--em-green); }

/* ── Remember row ────────────────────────────────────────── */

.em-remember-row {
	margin-bottom: 8px;
}

.em-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .88rem;
	cursor: pointer;
	color: var(--em-text-light);
}

/* ── Member buttons ──────────────────────────────────────── */

.em-btn--member {
	width: 100%;
	padding: 13px;
	font-size: 1rem;
	font-weight: 600;
	background: var(--em-primary);
	color: var(--em-white);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background .2s;
	margin-top: 8px;
}

.em-btn--member:hover { background: var(--em-primary-dark); }
.em-btn--member:disabled { opacity: .6; cursor: not-allowed; }

.em-btn--outline-sm {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--em-primary-dark);
	border: 1.5px solid var(--em-primary);
	border-radius: 8px;
	background: transparent;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s;
}

.em-btn--outline-sm:hover { background: var(--em-primary-light); }

.em-btn--ghost-sm {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: .85rem;
	color: var(--em-text-light);
	background: transparent;
	border: 1.5px solid var(--em-border);
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s;
}

.em-btn--ghost-sm:hover { background: var(--em-bg); }

/* ── Dashboard hero ──────────────────────────────────────── */

.em-dashboard-hero {
	display: flex;
	align-items: center;
	gap: 20px;
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 24px 28px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.em-avatar-wrap {
	flex-shrink: 0;
}

.em-avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid var(--em-primary);
}

.em-avatar--lg {
	width: 100px;
	height: 100px;
}

.em-avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--em-primary), var(--em-primary-dark));
	color: var(--em-white);
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: .05em;
}

.em-avatar--lg.em-avatar--initials { font-size: 2rem; }

.em-dashboard-hero__info {
	flex: 1;
	min-width: 0;
}

.em-dashboard-hero__info h2 {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 4px;
}

.em-dashboard-email,
.em-dashboard-location {
	margin: 0 0 2px;
	font-size: .87rem;
	color: var(--em-text-light);
}

.em-dashboard-hero__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ── Stats ───────────────────────────────────────────────── */

.em-stats-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

.em-stat-card {
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 20px 16px;
	text-align: center;
}

.em-stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
.em-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--em-primary-dark); }
.em-stat-label { font-size: .78rem; color: var(--em-text-light); margin-top: 2px; }

/* ── Quick links ─────────────────────────────────────────── */

.em-quicklinks {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 24px;
}

.em-quicklink-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px 12px;
	background: var(--em-primary-light);
	border: 1.5px solid rgba(74,198,185,.3);
	border-radius: var(--em-radius);
	text-decoration: none;
	color: var(--em-primary-dark);
	font-weight: 600;
	font-size: .88rem;
	transition: background .2s, border-color .2s;
}

.em-quicklink-card:hover {
	background: #d0f5f1;
	border-color: var(--em-primary);
}

.em-quicklink-icon { font-size: 1.6rem; }

/* ── Dashboard sections ──────────────────────────────────── */

.em-dashboard-section {
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 24px 28px;
	margin-bottom: 20px;
}

.em-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.em-section-header h3 {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0;
}

.em-section-meta {
	font-size: .8rem;
	color: var(--em-text-light);
}

/* ── History list ────────────────────────────────────────── */

.em-history-list { display: flex; flex-direction: column; gap: 10px; }

.em-history-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	background: var(--em-bg);
	border-radius: 8px;
	border: 1px solid var(--em-border);
}

.em-history-item__icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--em-primary-light);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
}

.em-history-item__icon--don { background: #fef2f2; }

.em-history-item__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.em-history-item__body strong { font-size: .92rem; }

.em-history-meta {
	font-size: .78rem;
	color: var(--em-text-light);
}

.em-history-message {
	font-size: .78rem;
	color: var(--em-text-light);
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.em-history-item__status { flex-shrink: 0; }

/* ── Status badges ───────────────────────────────────────── */

.em-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 99px;
	font-size: .72rem;
	font-weight: 600;
}

.em-badge--paid    { background: #dcfce7; color: #16a34a; }
.em-badge--pending { background: #fef9c3; color: #b45309; }
.em-badge--qris    { background: #e0f2fe; color: #0369a1; }
.em-badge--failed  { background: #fee2e2; color: #dc2626; }

/* ── Empty state ─────────────────────────────────────────── */

.em-empty-state {
	text-align: center;
	padding: 32px 16px;
	color: var(--em-text-light);
}

.em-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.em-empty-state p { margin: 0 0 14px; font-size: .9rem; }

/* ── Edit profile layout ─────────────────────────────────── */

.em-edit-header {
	margin-bottom: 20px;
}

.em-edit-header h2 {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 4px 0 0;
}

.em-back-link {
	font-size: .85rem;
	color: var(--em-primary-dark);
	text-decoration: none;
	font-weight: 600;
}

.em-back-link:hover { text-decoration: underline; }

.em-edit-layout {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 20px;
	align-items: start;
}

/* ── Photo card ──────────────────────────────────────────── */

.em-photo-card {
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 28px 20px;
	text-align: center;
}

.em-photo-wrap {
	position: relative;
	display: inline-block;
	margin-bottom: 12px;
}

.em-photo-edit-btn {
	position: absolute;
	bottom: 4px;
	right: 4px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--em-primary);
	color: #fff;
	border: 2px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: .9rem;
	transition: background .2s;
}

.em-photo-edit-btn:hover { background: var(--em-primary-dark); }

.em-photo-hint {
	font-size: .75rem;
	color: var(--em-text-light);
	line-height: 1.5;
	margin: 0;
}

/* ── Profile form card ───────────────────────────────────── */

.em-profile-form-card {
	background: var(--em-white);
	border-radius: var(--em-radius);
	box-shadow: var(--em-shadow);
	padding: 28px 32px;
}

.em-input--readonly {
	background: var(--em-bg);
	color: var(--em-text-light);
	border: 1.5px solid var(--em-border);
	border-radius: 8px;
	padding: 10px 14px;
	font-size: .92rem;
}

.em-readonly-note {
	font-weight: 400;
	font-size: .75rem;
	color: var(--em-text-light);
	margin-left: 4px;
}

.em-profile-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 24px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
	.em-stats-row    { grid-template-columns: repeat(3, 1fr); }
	.em-quicklinks   { grid-template-columns: repeat(3, 1fr); }
	.em-edit-layout  { grid-template-columns: 1fr; }
	.em-dashboard-hero { padding: 20px 16px; }
	.em-member-card  { padding: 28px 20px; }
}

@media (max-width: 480px) {
	.em-stats-row    { grid-template-columns: 1fr; }
	.em-quicklinks   { grid-template-columns: 1fr; }
	.em-dashboard-hero__actions { width: 100%; }
}
