/* ==========================================================================
   IEP Memberships — front end
   Built for the Invisible Empire Publishing Storefront child theme:
   near-black page (#0a0a0a), white text, Source Sans Pro, gold accent.
   All colours are CSS variables so a theme can re-skin without overrides.
   ========================================================================== */

.iepm {
	--iepm-bg: transparent;
	--iepm-surface: #131313;
	--iepm-surface-2: #1b1b1b;
	--iepm-border: #2a2a2a;
	--iepm-text: #ffffff;
	--iepm-muted: #a3a3a3;
	--iepm-input-bg: #ffffff;
	--iepm-input-text: #111111;
	--iepm-input-border: #d4d4d4;
	--iepm-accent-text: #0a0a0a;
	--iepm-danger: #e5484d;
	--iepm-success: #3fb950;
	--iepm-info: #58a6ff;
	--iepm-radius: 4px;
	color: var(--iepm-text);
	font-family: inherit;
	line-height: 1.55;
	box-sizing: border-box;
}
.iepm *, .iepm *::before, .iepm *::after { box-sizing: inherit; }

/* ---------- layout wrappers ---------- */
.iepm-form-wrap { max-width: var(--iepm-form-max, 450px); margin: 0 auto 2em; }
.iepm-account, .iepm-profile { max-width: var(--iepm-profile-max, 1000px); margin: 0 auto 2em; }
.iepm-center { text-align: center; }
.iepm-muted { color: var(--iepm-muted); }
.iepm-lead { color: var(--iepm-muted); margin: 0 0 1.2em; }

/* ---------- fields ---------- */
.iepm-field { margin: 0 0 1.1em; }
.iepm-field > label, .iepm-field > .iepm-label {
	display: block; font-weight: 600; font-size: .95em; margin: 0 0 .4em; color: var(--iepm-text);
}
.iepm-req { color: var(--iepm-accent, #c9a84c); }
.iepm input[type=text], .iepm input[type=email], .iepm input[type=password], .iepm input[type=url],
.iepm input[type=tel], .iepm input[type=number], .iepm input[type=date], .iepm input[type=search],
.iepm select, .iepm textarea {
	width: 100%; padding: .7em .85em; font: inherit; font-size: 1em;
	color: var(--iepm-input-text); background: var(--iepm-input-bg);
	border: 1px solid var(--iepm-input-border); border-radius: var(--iepm-radius);
	box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.iepm input:focus, .iepm select:focus, .iepm textarea:focus {
	outline: none; border-color: var(--iepm-accent, #c9a84c);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--iepm-accent, #c9a84c) 35%, transparent);
}
.iepm input[disabled] { background: #d9d9d9; color: #555; cursor: not-allowed; }
.iepm-field--error input, .iepm-field--error select, .iepm-field--error textarea { border-color: var(--iepm-danger); }
.iepm-field-error { color: #ff8589; font-size: .88em; margin: .35em 0 0; }
.iepm-help { color: var(--iepm-muted); font-size: .88em; margin: .35em 0 0; }
.iepm-choices { display: flex; flex-wrap: wrap; gap: .4em 1.2em; }
.iepm-choice { display: inline-flex; align-items: center; gap: .45em; font-weight: 400; cursor: pointer; }
.iepm-choice input { width: auto; margin: 0; accent-color: var(--iepm-accent, #c9a84c); }
.iepm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
@media (max-width: 520px) { .iepm-cols { grid-template-columns: 1fr; } }
.iepm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.iepm-pass { position: relative; }
.iepm-pass input { padding-right: 4.2em; }
.iepm-pass-toggle {
	position: absolute; right: .35em; top: 50%; transform: translateY(-50%);
	background: transparent; border: 0; color: #555; font: inherit; font-size: .85em;
	padding: .35em .5em; cursor: pointer;
}
.iepm-strength { height: 4px; border-radius: 2px; background: var(--iepm-border); margin-top: .45em; overflow: hidden; }
.iepm-strength > span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

.iepm-row { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; margin: 0 0 1.2em; font-size: .95em; }
.iepm-link, .iepm a.iepm-link { color: var(--iepm-accent, #c9a84c); text-decoration: none; }
.iepm-link:hover { text-decoration: underline; }

/* ---------- buttons ---------- */
.iepm-actions { margin: 1.4em 0 0; }
.iepm-actions--split { display: grid; grid-template-columns: 1fr 1fr; gap: .75em; }
.iepm-actions--row { display: flex; flex-wrap: wrap; gap: .6em; }
.iepm-actions--row.iepm-center { justify-content: center; }
.iepm .iepm-btn, .iepm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	padding: .75em 1.4em; font: inherit; font-weight: 700; font-size: .95em; letter-spacing: .02em;
	color: var(--iepm-accent-text, #0a0a0a); background: var(--iepm-accent, #c9a84c);
	border: 1px solid var(--iepm-accent, #c9a84c); border-radius: var(--iepm-radius, 4px);
	text-decoration: none; cursor: pointer; transition: filter .15s, background .15s, color .15s; width: auto;
}
.iepm-actions--split .iepm-btn { width: 100%; }
.iepm .iepm-btn:hover { filter: brightness(1.08); color: var(--iepm-accent-text, #0a0a0a); }
.iepm .iepm-btn--ghost { background: transparent; color: var(--iepm-text, #fff); border-color: #4a4a4a; }
.iepm .iepm-btn--ghost:hover { border-color: var(--iepm-accent, #c9a84c); color: var(--iepm-accent, #c9a84c); filter: none; }
.iepm .iepm-btn--danger { background: var(--iepm-danger); border-color: var(--iepm-danger); color: #fff; }
.iepm-link-btn { background: none; border: 0; padding: 0; color: var(--iepm-accent, #c9a84c); text-decoration: underline; cursor: pointer; font: inherit; }
.iepm-inline-form { margin: -0.5em 0 1em; }

/* ---------- notices ---------- */
.iepm-notice {
	padding: .85em 1em; margin: 0 0 1.2em; border-radius: var(--iepm-radius);
	border-left: 4px solid var(--iepm-info); background: rgba(88, 166, 255, .1); color: var(--iepm-text);
}
.iepm-notice a { color: var(--iepm-accent, #c9a84c); }
.iepm-notice--success { border-color: var(--iepm-success); background: rgba(63, 185, 80, .1); }
.iepm-notice--error { border-color: var(--iepm-danger); background: rgba(229, 72, 77, .12); }

/* ---------- account ---------- */
.iepm-account-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2.2em; align-items: start; }
@media (max-width: 760px) { .iepm-account-grid { grid-template-columns: 1fr; gap: 1.4em; } }
.iepm-account-id { text-align: center; margin-bottom: 1.2em; }
.iepm-account-id .iepm-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto .7em; background: #fff; }
.iepm-account-name { font-weight: 700; font-size: 1.1em; }
.iepm-account-nav { display: flex; flex-direction: column; border: 1px solid var(--iepm-border); border-radius: var(--iepm-radius); overflow: hidden; }
.iepm-account-nav a {
	display: flex; align-items: center; gap: .7em; padding: .75em 1em;
	color: var(--iepm-text); text-decoration: none; background: var(--iepm-surface);
	border-bottom: 1px solid var(--iepm-border); font-size: .95em;
}
.iepm-account-nav a:last-child { border-bottom: 0; }
.iepm-account-nav a:hover { background: var(--iepm-surface-2); }
.iepm-account-nav a.is-active { background: var(--iepm-surface-2); box-shadow: inset 3px 0 0 var(--iepm-accent, #c9a84c); font-weight: 700; }
.iepm-account-nav a svg { color: var(--iepm-muted); flex: none; }
.iepm-account-nav a.is-active svg { color: var(--iepm-accent, #c9a84c); }
.iepm-account-logout { color: var(--iepm-muted) !important; }
.iepm-tab-title { margin: 0 0 1em; font-size: 1.35em; font-weight: 700; padding-bottom: .5em; border-bottom: 1px solid var(--iepm-border); }
.iepm-subhead { margin: 2em 0 .5em; font-size: 1.05em; }
.iepm-account-main .iepm-form { max-width: 560px; }
.iepm-table { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.iepm-table th, .iepm-table td { text-align: left; padding: .6em .75em; border-bottom: 1px solid var(--iepm-border); }
.iepm-table th { color: var(--iepm-muted); font-weight: 600; width: 40%; }
.iepm-table--orders th { width: auto; }
.iepm-table a { color: var(--iepm-accent, #c9a84c); }

/* ---------- profile ---------- */
.iepm-cover {
	position: relative; width: 100%; height: 0; background: #1a1a1a center/cover no-repeat;
	border-radius: var(--iepm-radius); border: 1px solid var(--iepm-border);
}
.iepm-profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.6em; align-items: start; padding: 1.2em 0 1.4em; border-bottom: 1px solid var(--iepm-border); }
.iepm-profile-head.has-cover { margin-top: -70px; padding-left: 1.2em; padding-right: 1.2em; position: relative; }
@media (max-width: 640px) { .iepm-profile-head { grid-template-columns: 1fr; text-align: center; } .iepm-profile-head.has-cover { margin-top: -60px; } }
.iepm-profile-photo { text-align: center; }
.iepm-profile-photo .iepm-avatar { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid #0a0a0a; background: #fff; display: block; margin: 0 auto; }
.iepm-profile-name { margin: 1.6em 0 .2em; font-size: 1.8em; font-weight: 700; line-height: 1.15; }
.iepm-profile-head:not(.has-cover) .iepm-profile-name { margin-top: .3em; }
.iepm-profile-bio { margin: .4em 0; white-space: pre-line; }
.iepm-profile-edit { margin-top: 1.6em; }
.iepm-profile-tabs { display: flex; gap: .2em; border-bottom: 1px solid var(--iepm-border); margin: 0 0 1.4em; overflow-x: auto; }
.iepm-profile-tabs a { padding: .8em 1.1em; color: var(--iepm-muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.iepm-profile-tabs a.is-active { color: var(--iepm-text); border-bottom-color: var(--iepm-accent, #c9a84c); font-weight: 700; }
.iepm-profile-body { padding: 1.4em 0; }
.iepm-profile-field { display: grid; grid-template-columns: 200px 1fr; gap: 1em; padding: .65em 0; border-bottom: 1px solid var(--iepm-border); }
@media (max-width: 520px) { .iepm-profile-field { grid-template-columns: 1fr; gap: .15em; } }
.iepm-profile-label { color: var(--iepm-muted); font-weight: 600; }
.iepm-profile-value a { color: var(--iepm-accent, #c9a84c); }
.iepm-upload {
	display: inline-flex; align-items: center; gap: .35em; margin: .6em .3em 0; padding: .35em .75em;
	font-size: .85em; border: 1px solid #4a4a4a; border-radius: var(--iepm-radius); background: rgba(0,0,0,.65); cursor: pointer;
}
.iepm-upload input[type=file] { width: 12em; font-size: .9em; color: var(--iepm-muted); }
.iepm-upload--cover { position: absolute; right: .8em; top: .8em; margin: 0; }
.iepm-cover .iepm-upload--remove { position: absolute; right: .8em; top: 3.4em; margin: 0; }
.iepm-profile-form .iepm-profile-head.has-cover { margin-top: -40px; }
.iepm-profile-form .iepm-profile-meta { padding-top: 48px; }
@media (max-width: 640px) { .iepm-profile-form .iepm-profile-meta { padding-top: 0; } }
.iepm-badges { display: flex; flex-wrap: wrap; gap: .35em; justify-content: inherit; margin: .3em 0; }
.iepm-badge { font-size: .75em; letter-spacing: .04em; text-transform: uppercase; padding: .2em .6em; border: 1px solid var(--iepm-accent, #c9a84c); color: var(--iepm-accent, #c9a84c); border-radius: 999px; }

/* ---------- directory ---------- */
.iepm-members-filter { display: flex; flex-wrap: wrap; gap: .6em; margin: 0 0 1em; }
.iepm-members-filter input[type=search] { flex: 1 1 240px; width: auto; }
.iepm-members-filter select { flex: 0 1 180px; width: auto; }
.iepm-members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1em; margin: 1em 0; }
.iepm-member-card {
	display: flex; flex-direction: column; align-items: center; gap: .45em; text-align: center; padding: 1.4em 1em;
	background: var(--iepm-surface); border: 1px solid var(--iepm-border); border-radius: var(--iepm-radius);
	color: var(--iepm-text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.iepm-member-card:hover { border-color: var(--iepm-accent, #c9a84c); transform: translateY(-2px); color: var(--iepm-text); }
.iepm-member-card .iepm-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #fff; }
.iepm-member-name { font-weight: 700; }
.iepm-member-field { color: var(--iepm-muted); font-size: .85em; }
.iepm-pagination { display: flex; justify-content: center; gap: .3em; margin-top: 1.4em; }
.iepm-pagination .page-numbers { padding: .45em .8em; border: 1px solid var(--iepm-border); border-radius: var(--iepm-radius); color: var(--iepm-text); text-decoration: none; }
.iepm-pagination .page-numbers.current { background: var(--iepm-accent, #c9a84c); border-color: var(--iepm-accent, #c9a84c); color: #0a0a0a; font-weight: 700; }

/* ---------- restricted ---------- */
.iepm-restricted {
	text-align: center; padding: 2.2em 1.6em; margin: 1.5em 0;
	background: var(--iepm-surface); border: 1px solid var(--iepm-border); border-top: 3px solid var(--iepm-accent, #c9a84c);
	border-radius: var(--iepm-radius);
}
.iepm-restricted-icon { color: var(--iepm-accent, #c9a84c); }
.iepm-restricted-msg { margin: .6em auto 0; max-width: 560px; }
.iepm-restricted-msg p:last-child { margin-bottom: 0; }

/* ---------- member menu ---------- */
.iepm-member-menu { display: inline-flex; align-items: center; gap: .4em; }
.iepm-member-menu img { border-radius: 50%; }

/* ---------- reCAPTCHA ---------- */
.iepm-recaptcha { display: flex; justify-content: center; }
