/* =====================================================================
 * Account — shared registration + sign-in modal.
 *
 * Loaded site-wide (when any source is registered) by
 * /add-ons/utils/account-styles.php.
 *
 * The same offcanvas hosts two panels — register and signin — toggled
 * via `data-mode` on the modal root. CSS-only show/hide with a small
 * cross-fade keeps the toggle instant and dependency-free.
 * =================================================================== */

.pep-account-modal.offcanvas-end {
	width: min(440px, 100vw);
	background: #fff;
	border: 0;
	/* Bootstrap's `.offcanvas` is already display:flex / flex-direction:column.
	 * We re-declare so it's explicit and doesn't depend on Bootstrap version. */
	display: flex;
	flex-direction: column;
}

/* ---------------------------------------------------------------------
 * Header — primary brand orange gradient (matches the rest of the
 * theme: reserve buttons, masthead accents, compare modal, etc.).
 * Tight type + spacing so the kicker + multi-line title + lede fit
 * comfortably above the fold inside a 440px-wide offcanvas.
 * ------------------------------------------------------------------- */
.pep-account-modal__header {
	position: relative;
	flex: 0 0 auto;       /* never shrink — keeps header pinned at top */
	padding: 1.25rem 1.5rem 1rem;
	background: linear-gradient(135deg, #F26322 0%, #d14d16 100%);
	color: #fff;
	overflow: hidden;
}

.pep-account-modal__close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	z-index: 2;
}

.pep-account-modal__kicker {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.625rem;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: #fff;
	margin-bottom: 0.5rem;
	position: relative;
	z-index: 2;
}

.pep-account-modal__kicker .bi {
	color: #fff;
	opacity: 0.9;
	font-size: 0.7rem;
}

/* Title — sized to fit a 2-line line on a 440px-wide offcanvas. */
.pep-account-modal__title {
	position: relative;
	z-index: 2;
	font-size: clamp(1.05rem, 2.2vw, 1.25rem) !important;
	font-weight: 800 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.012em !important;
	color: #fff !important;
	margin: 0 0 0.3rem !important;
}

.pep-account-modal__title::before {
	display: none;
}

/* Lede — small supporting line, single row. */
.pep-account-modal__lede {
	position: relative;
	z-index: 2;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.74rem;
	line-height: 1.4;
	margin: 0;
	font-weight: 500;
}

/* ---------------------------------------------------------------------
 * Body — scrolls vertically when content exceeds the available height.
 * The flex magic (`flex: 1 1 auto; min-height: 0`) is what lets the
 * inner content overflow into a scroll instead of pushing the header
 * above and the submit below the visible viewport.
 * ------------------------------------------------------------------- */
.pep-account-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 1.25rem 1.25rem 1.5rem;
}

/* Slim, branded scrollbar so it doesn't look stock-WP. */
.pep-account-modal__body::-webkit-scrollbar { width: 6px; }
.pep-account-modal__body::-webkit-scrollbar-thumb {
	background: rgba(242, 99, 34, 0.35);
	border-radius: 3px;
}
.pep-account-modal__body::-webkit-scrollbar-thumb:hover {
	background: rgba(242, 99, 34, 0.55);
}

/* Two-panel toggle — only one panel visible at a time. */
.pep-account-modal__panel {
	display: none;
	animation: pep-account-fade 0.22s ease-out;
}

.pep-account-modal[data-mode="register"] .pep-account-modal__panel--register,
.pep-account-modal[data-mode="signin"]   .pep-account-modal__panel--signin {
	display: block;
}

@keyframes pep-account-fade {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.pep-account-modal__panel { animation: none; }
}

.pep-account-modal__preamble {
	margin-bottom: 1rem;
}

.pep-account-modal__benefits {
	list-style: none;
	padding: 0;
	margin: 0 0 1.15rem;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.pep-account-modal__benefits li {
	display: flex;
	gap: 0.625rem;
	align-items: flex-start;
}

.pep-account-modal__benefit-icon {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #fff7f3, #ffeadd);
	color: #F26322;
	border-radius: 8px;
	font-size: 0.9rem;
	box-shadow: 0 1px 4px rgba(242, 99, 34, 0.12);
}

.pep-account-modal__benefits li > div {
	flex: 1;
	min-width: 0;
	line-height: 1.35;
	font-size: 0.82rem;
}

.pep-account-modal__benefits li strong {
	display: block;
	color: #111;
	font-weight: 700;
	margin-bottom: 0.05rem;
	font-size: 0.85rem;
}

.pep-account-modal__benefits li span {
	color: #6b7280;
	font-size: 0.78rem;
}

/* ---------------------------------------------------------------------
 * Form (shared between register + signin panels)
 * ------------------------------------------------------------------- */
.pep-account-modal__form {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.pep-account-modal__field {
	display: flex;
	flex-direction: column;
	gap: 0.275rem;
}

.pep-account-modal__field label {
	font-size: 0.7rem;
	font-weight: 700;
	color: #4b5563;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pep-account-modal__optional {
	color: #9ca3af;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 0.66rem;
	margin-left: 0.15rem;
}

.pep-account-modal__field input {
	padding: 0.55rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	font-size: 0.95rem;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-height: 40px;
}

.pep-account-modal__field input:focus {
	outline: none;
	border-color: #F26322;
	box-shadow: 0 0 0 3px rgba(242, 99, 34, 0.18);
}

/* Checkbox-style fields (marketing opt-in, terms, etc.) sit inline
 * with the label, no uppercase eyebrow, smaller body type. */
.pep-account-modal__field--checkbox {
	flex-direction: row;
	gap: 0;
	margin-top: 0.15rem;
	padding: 0.5rem 0.65rem;
	background: #fdf4ee;
	border: 1px solid rgba(242, 99, 34, 0.18);
	border-radius: 0.5rem;
}

.pep-account-modal__field--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	cursor: pointer;
	font-size: 0.72rem;
	font-weight: 500;
	color: #4b5563;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.4;
	margin: 0;
}

.pep-account-modal__field--checkbox input[type="checkbox"] {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	min-height: 16px;
	margin: 1px 0 0;
	padding: 0;
	accent-color: #F26322;
	cursor: pointer;
}

.pep-account-modal__field--checkbox span {
	flex: 1;
	min-width: 0;
}

.pep-account-modal__submit-wrap {
	margin-top: 0.35rem;
}

.pep-account-modal__submit {
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.25rem;
	background: linear-gradient(135deg, #F26322 0%, #d14d16 100%);
	color: #fff;
	border: 0;
	border-radius: 0.5rem;
	font-weight: 800;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	min-height: 46px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	position: relative;
}

.pep-account-modal__submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(242, 99, 34, 0.35);
}

.pep-account-modal__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.pep-account-modal__submit-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pep-account-spin 0.6s linear infinite;
}

.pep-account-modal__submit.is-loading .pep-account-modal__submit-spinner {
	display: inline-block;
}

.pep-account-modal__submit.is-loading .pep-account-modal__submit-label {
	opacity: 0.65;
}

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

.pep-account-modal__status {
	font-size: 0.9rem;
	padding: 0.75rem 0.875rem;
	border-radius: 0.5rem;
	margin: 0;
	line-height: 1.4;
}

.pep-account-modal__status.is-error {
	background: #fee2e2;
	color: #991b1b;
	border-left: 3px solid #dc2626;
}

.pep-account-modal__status.is-success {
	background: #f0fdf4;
	color: #166534;
	border-left: 3px solid #16a34a;
}

.pep-account-modal__consent {
	font-size: 0.7rem;
	color: #9ca3af;
	line-height: 1.4;
	margin: 0.2rem 0 0;
}

/* Forgot-password link inside the signin panel. */
.pep-account-modal__forgot {
	margin: 0;
	text-align: center;
	font-size: 0.85rem;
}

.pep-account-modal__forgot a {
	color: #6b7280;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 500;
}

.pep-account-modal__forgot a:hover {
	color: #F26322;
}

/* Footer toggle ("Already a member? Sign in →" / "New here? Create…") */
.pep-account-modal__footnote {
	text-align: center;
	font-size: 0.78rem;
	color: #6b7280;
	margin: 0.85rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid #f3f4f6;
}

.pep-account-modal__footnote a,
.pep-account-modal__toggle {
	color: #F26322;
	text-decoration: none;
	font-weight: 700;
	cursor: pointer;
}

.pep-account-modal__footnote a:hover,
.pep-account-modal__toggle:hover {
	color: #d14d16;
	text-decoration: underline;
}

/* ---------------------------------------------------------------------
 * Default styling for pep_account_signin_link() rendered buttons.
 * Templates can layer on additional classes via the helper's $attrs
 * argument when they want a fancier treatment.
 * ------------------------------------------------------------------- */
.pep-account-signin-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	background: #fff;
	color: #F26322;
	border: 1px solid #F26322;
	border-radius: 0.5rem;
	font-weight: 700;
	font-size: 0.875rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pep-account-signin-link:hover {
	background: #F26322;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(242, 99, 34, 0.25);
}

.pep-account-signin-link .bi {
	font-size: 1rem;
}
