/**
 * Account sign-in v2 and the phone picker (flag `eupepsia_account_v2`, D-360 extended; concept B "Brand panel").
 * Loaded by inc/enqueue-account-phone-v1.php on the logged-out account page, Account details and (Flatsome header
 * only) the header popup. Every rule is scoped to an `eup-acc2` class, so nothing here reaches another surface.
 *
 * Values are design v4's tokens (DESIGN-V4-PORT.md); each `var()` falls back to the same v4 value, so the page
 * looks as approved with or without the design-system preview. Fields on Account details (WooCommerce's own form)
 * fall back to the form's existing look instead.
 *
 * Motion: one reveal on load (panel mark settles, text rises), tab cross-fade, list drop. Transform and opacity
 * only; none at all under reduced motion.
 */

.eup-acc2,
.eup-acc2-popup,
.eup-acc2-phone {
	--eup-acc2-ink: var(--eup3-ink, #1d1848);
	--eup-acc2-soft: var(--eup3-ink-soft, #646582);
	--eup-acc2-teal: var(--eup3-accent, #00cdb8);
	--eup-acc2-teal-text: var(--eup3-accent-text, #008674);
	--eup-acc2-deep: var(--eup3-deep, #0b6862);
	--eup-acc2-line: var(--eup3-line, #d1e0da);
	--eup-acc2-grey: var(--eup3-grey-strong, #eceded);
	--eup-acc2-mint: var(--eup3-mint, #f0fbf9);
	--eup-acc2-error: #cc1818;
	--eup-acc2-radius: var(--eup3-radius, 10px);
	--eup-acc2-focus: var(--eup3-focus, #1d1848);
	--eup-acc2-smooth: var(--eup3-ease-smooth, cubic-bezier(0.3, 1, 0.3, 1));
	--eup-acc2-reveal: var(--eup3-ease-reveal, cubic-bezier(0.16, 1, 0.3, 1));
}

.eup-acc2 [hidden],
.eup-acc2-popup [hidden],
.eup-acc2-phone [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- layout */

.eup-acc2 {
	box-sizing: border-box;
	color: var(--eup-acc2-ink);
	display: grid;
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 300;
	gap: 64px;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	margin: 16px auto 40px;
	max-width: 1180px;
	text-align: left;
}

.eup-acc2 *,
.eup-acc2-popup *,
.eup-acc2-phone * {
	box-sizing: border-box;
}

.eup-acc2-main {
	display: flex;
	flex-direction: column;
	gap: 28px;
	max-width: 520px;
	min-width: 0;
	padding-top: 8px;
	width: 100%;
}

/* ---------------------------------------------------------------- brand panel */

.eup-acc2-panel {
	align-self: start;
	background: var(--eup-acc2-deep);
	border-radius: var(--eup-acc2-radius);
	color: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 40px;
	justify-content: space-between;
	min-height: 560px;
	padding: 56px;
}

.eup-acc2-mark {
	color: #ffffff;
	display: block;
	width: 92px;
}

.eup-acc2-mark svg {
	display: block;
	height: auto;
	width: 100%;
}

.eup-acc2-panel__text {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.eup-acc2 .eup-acc2-panel__title {
	color: #ffffff;
	font-family: inherit;
	font-size: clamp(26px, 2.6vw, 40px);
	font-weight: 300;
	letter-spacing: 0;
	line-height: 1.2;
	margin: 0;
	text-transform: none;
}

.eup-acc2-panel__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.eup-acc2-panel__list li {
	align-items: center;
	display: flex;
	font-size: 18px;
	gap: 14px;
	line-height: 1.4;
	margin: 0;
}

.eup-acc2-icon {
	flex: none;
	height: 22px;
	width: 22px;
}

/* ---------------------------------------------------------------- tabs */

.eup-acc2-tabs {
	background: var(--eup-acc2-grey);
	border-radius: var(--eup-acc2-radius);
	display: grid;
	gap: 4px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 4px;
	position: relative;
}

.eup-acc2 .eup-acc2-tab {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--eup-acc2-ink);
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	justify-content: center;
	min-height: 48px;
	padding: 0 12px;
	position: relative;
	text-decoration: none;
	transition: background-color 0.25s var(--eup-acc2-smooth);
	z-index: 1;
}

.eup-acc2 .eup-acc2-tab.is-active {
	background: var(--eup-acc2-teal);
	font-weight: 500;
}

.eup-acc2 .eup-acc2-tab:hover {
	color: var(--eup-acc2-ink);
}

.eup-acc2-pane {
	animation: eup-acc2-fade 0.25s var(--eup-acc2-smooth) both;
}

/* ---------------------------------------------------------------- notices (WooCommerce prints them here) */

.eup-acc2-notices:empty {
	display: none;
}

.eup-acc2-notices .woocommerce-error,
.eup-acc2-notices .woocommerce-message,
.eup-acc2-notices .woocommerce-info,
.eup-acc2-notices .wc-block-components-notice-banner {
	animation: eup-acc2-drop 0.35s var(--eup-acc2-smooth) both;
	background: #fdf3f3;
	border: 1px solid var(--eup-acc2-error);
	border-radius: var(--eup-acc2-radius);
	color: var(--eup-acc2-ink);
	font-size: 16px;
	line-height: 1.5;
	list-style: none;
	margin: 0;
	padding: 16px 20px;
}

.eup-acc2-notices .woocommerce-message,
.eup-acc2-notices .woocommerce-info {
	background: var(--eup-acc2-mint);
	border-color: var(--eup-acc2-deep);
}

.eup-acc2-notices .woocommerce-error li,
.eup-acc2-notices .woocommerce-message li {
	margin: 0;
	padding: 0;
}

.eup-acc2-notices .woocommerce-error::before,
.eup-acc2-notices .woocommerce-message::before,
.eup-acc2-notices .woocommerce-info::before {
	display: none;
}

.eup-acc2-notices a {
	color: var(--eup-acc2-teal-text);
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* ---------------------------------------------------------------- fields */

.eup-acc2-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0;
}

/* WooCommerce's order-attribution element holds hidden inputs only; it must not take a gap in the column. */
.eup-acc2-form > wc-order-attribution-inputs {
	display: none;
}

/* The old notice styles give each line its own tinted box, red text and an icon gutter. */
body .eup-acc2-notices .woocommerce-error li,
body .eup-acc2-notices .woocommerce-message li,
body .eup-acc2-notices .woocommerce-info li {
	background: none;
	border: 0;
	color: var(--eup-acc2-ink);
	list-style: none;
	margin: 0;
	padding: 0;
}

body .eup-acc2-notices .woocommerce-error {
	color: var(--eup-acc2-ink);
}

body .eup-acc2-notices strong {
	font-weight: 600;
}

.eup-acc2-pair {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eup-acc2-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	min-width: 0;
	position: relative;
}

.eup-acc2 .eup-acc2-label,
.eup-acc2-popup .eup-acc2-label,
.eup-acc2-phone .eup-acc2-label {
	color: var(--eup-acc2-ink);
	display: block;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.3;
	margin: 0;
	text-transform: none;
}

.eup-acc2-label__optional {
	color: var(--eup-acc2-soft);
	font-weight: 300;
}

.eup-acc2 .eup-acc2-input,
.eup-acc2-popup .eup-acc2-input {
	background: #ffffff;
	border: 1px solid var(--eup-acc2-soft);
	border-radius: var(--eup-acc2-radius);
	box-shadow: none;
	color: var(--eup-acc2-ink);
	display: block;
	font-family: inherit;
	font-size: 17px;
	font-weight: 300;
	height: 52px;
	line-height: 1.3;
	margin: 0;
	max-width: 100%;
	padding: 0 16px;
	width: 100%;
}

.eup-acc2 .eup-acc2-input:focus,
.eup-acc2-popup .eup-acc2-input:focus {
	border-color: var(--eup-acc2-ink);
	box-shadow: none;
	outline: 3px solid var(--eup-acc2-focus);
	outline-offset: 2px;
}

.eup-acc2-pw {
	position: relative;
}

.eup-acc2 .eup-acc2-pw .eup-acc2-input,
.eup-acc2-popup .eup-acc2-pw .eup-acc2-input {
	padding-right: 84px;
}

.eup-acc2 .eup-acc2-show,
.eup-acc2-popup .eup-acc2-show {
	background: transparent;
	border: 0;
	border-radius: 8px;
	box-shadow: none;
	color: var(--eup-acc2-teal-text);
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	height: 44px;
	letter-spacing: 0;
	line-height: 1;
	margin: 0;
	min-height: 0;
	min-width: 64px;
	padding: 0 12px;
	position: absolute;
	right: 4px;
	text-decoration: underline;
	text-transform: none;
	text-underline-offset: 4px;
	top: 4px;
}

.eup-acc2 .eup-acc2-show:focus-visible,
.eup-acc2-popup .eup-acc2-show:focus-visible,
.eup-acc2 .eup-acc2-tab:focus-visible,
.eup-acc2 .eup-acc2-link:focus-visible,
.eup-acc2-popup .eup-acc2-link:focus-visible,
.eup-acc2 .eup-acc2-btn:focus-visible,
.eup-acc2-popup .eup-acc2-btn:focus-visible {
	outline: 3px solid var(--eup-acc2-focus);
	outline-offset: 2px;
}

/* "Keep me signed in" and "Forgot password?" */
.eup-acc2-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	justify-content: space-between;
	margin-top: -4px;
}

.eup-acc2 .eup-acc2-check,
.eup-acc2-popup .eup-acc2-check {
	align-items: center;
	color: var(--eup-acc2-ink);
	cursor: pointer;
	display: inline-flex;
	font-size: 16px;
	font-weight: 300;
	gap: 10px;
	margin: 0;
	min-height: 44px;
}

.eup-acc2 .eup-acc2-check input,
.eup-acc2-popup .eup-acc2-check input {
	accent-color: var(--eup-acc2-deep);
	height: 20px;
	margin: 0;
	width: 20px;
}

.eup-acc2 .eup-acc2-link,
.eup-acc2-popup .eup-acc2-link {
	align-items: center;
	color: var(--eup-acc2-teal-text);
	display: inline-flex;
	font-size: 16px;
	font-weight: 400;
	min-height: 44px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.eup-acc2 .eup-acc2-link:hover,
.eup-acc2-popup .eup-acc2-link:hover {
	color: var(--eup-acc2-ink);
}

.eup-acc2-note,
.eup-acc2 .woocommerce-privacy-policy-text,
.eup-acc2 .woocommerce-privacy-policy-text p {
	color: var(--eup-acc2-soft);
	font-size: 14.4px;
	line-height: 1.45;
	margin: 0;
}

/* WooCommerce's privacy text stays visible on Create account (brief and approved concept). Today the Customizer's
   Additional CSS hides it site-wide (`.woocommerce-privacy-policy-text{display:none!important}`) and site-legacy.css
   hides its paragraph on `.register`; shown again here, under the flag only. */
body .eup-acc2 .woocommerce-privacy-policy-text {
	display: block !important;
}

body .eup-acc2 .woocommerce-privacy-policy-text p {
	display: block;
}

.eup-acc2 .woocommerce-privacy-policy-text a {
	color: var(--eup-acc2-teal-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- button */

body .eup-acc2 .eup-acc2-btn,
body .eup-acc2-popup .eup-acc2-btn {
	align-items: center;
	background: var(--eup-acc2-teal);
	border: 0;
	border-radius: var(--eup-acc2-radius);
	box-shadow: none;
	color: var(--eup-acc2-ink);
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 18px;
	font-weight: 400;
	height: 52px;
	justify-content: center;
	letter-spacing: 0;
	line-height: 1;
	margin: 4px 0 0;
	max-width: none;
	padding: 0 24px;
	text-transform: none;
	transition: background-color 0.25s var(--eup-acc2-smooth), color 0.25s var(--eup-acc2-smooth), transform 90ms;
	width: 100%;
}

body .eup-acc2 .eup-acc2-btn:hover,
body .eup-acc2-popup .eup-acc2-btn:hover {
	background: var(--eup-acc2-ink);
	color: var(--eup-acc2-teal);
}

body .eup-acc2 .eup-acc2-btn:active,
body .eup-acc2-popup .eup-acc2-btn:active {
	transform: scale(0.98);
}

body .eup-acc2 .eup-acc2-btn:disabled,
body .eup-acc2 .eup-acc2-btn.disabled {
	background: var(--eup-acc2-grey);
	color: var(--eup-acc2-soft);
	cursor: not-allowed;
	transform: none;
}

/* ---------------------------------------------------------------- WooCommerce's strength meter */

.eup-acc2 .woocommerce-password-strength {
	background: none;
	border: 0;
	color: var(--eup-acc2-ink);
	font-size: 14.4px;
	font-weight: 500;
	margin: 10px 0 0;
	padding: 12px 0 0;
	position: relative;
	text-align: right;
}

.eup-acc2 .woocommerce-password-strength::before,
.eup-acc2 .woocommerce-password-strength::after {
	border-radius: 2px;
	content: "";
	height: 4px;
	left: 0;
	position: absolute;
	top: 0;
}

.eup-acc2 .woocommerce-password-strength::before {
	background: var(--eup-acc2-grey);
	width: 100%;
}

.eup-acc2 .woocommerce-password-strength::after {
	background: var(--eup-acc2-deep);
	transition: width 0.35s var(--eup-acc2-smooth);
	width: 0;
}

.eup-acc2 .woocommerce-password-strength.short::after { background: var(--eup-acc2-error); width: 25%; }
.eup-acc2 .woocommerce-password-strength.bad::after { background: var(--eup-acc2-error); width: 50%; }
.eup-acc2 .woocommerce-password-strength.good::after { width: 75%; }
.eup-acc2 .woocommerce-password-strength.strong::after { width: 100%; }

.eup-acc2 .woocommerce-password-hint {
	color: var(--eup-acc2-soft);
	display: block;
	font-size: 14.4px;
	line-height: 1.45;
	margin-top: 6px;
}

/* ---------------------------------------------------------------- phone field and picker */

.eup-acc2-telbox {
	position: relative;
}

.eup-acc2-tel {
	align-items: stretch;
	background: #ffffff;
	border: 1px solid var(--eup-acc2-soft);
	border-radius: var(--eup-acc2-radius);
	display: flex;
	min-height: 52px;
	position: relative;
}

.eup-acc2-tel:focus-within {
	border-color: var(--eup-acc2-ink);
	outline: 3px solid var(--eup-acc2-focus);
	outline-offset: 2px;
}

.eup-acc2-phone.is-invalid .eup-acc2-tel {
	border-color: var(--eup-acc2-error);
	box-shadow: inset 0 0 0 1px var(--eup-acc2-error);
}

.eup-acc2-phone .eup-acc2-tel .eup-acc2-tel__input,
.eup-acc2-phone .eup-acc2-tel .eup-acc2-tel__input:focus {
	background: transparent;
	border: 0;
	border-radius: 0 var(--eup-acc2-radius) var(--eup-acc2-radius) 0;
	box-shadow: none;
	color: var(--eup-acc2-ink);
	flex: 1;
	font-family: inherit;
	font-size: 17px;
	font-variant-numeric: tabular-nums;
	font-weight: 300;
	height: auto;
	margin: 0;
	min-width: 0;
	outline: 0;
	padding: 0 16px;
}

.eup-acc2-phone .eup-acc2-cc {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: var(--eup-acc2-radius) 0 0 var(--eup-acc2-radius);
	border-right: 1px solid var(--eup-acc2-line);
	box-shadow: none;
	color: var(--eup-acc2-ink);
	cursor: pointer;
	display: flex;
	flex: none;
	font-family: inherit;
	font-size: 17px;
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	gap: 8px;
	letter-spacing: 0;
	line-height: 1;
	margin: 0;
	min-height: 0;
	min-width: 112px;
	padding: 0 12px 0 14px;
	text-transform: none;
}

.eup-acc2-phone .eup-acc2-cc:focus-visible {
	outline: 3px solid var(--eup-acc2-focus);
	outline-offset: -3px;
}

.eup-acc2-flag {
	border-radius: 3px;
	display: block;
	flex: none;
	height: 18px;
	object-fit: cover;
	outline: 1px solid rgba(29, 24, 72, 0.12);
	outline-offset: -1px;
	width: 24px;
}

.eup-acc2-chev {
	color: #0d1922;
	flex: none;
	height: 16px;
	transition: transform 0.25s var(--eup-acc2-smooth);
	width: 16px;
}

.eup-acc2-cc[aria-expanded="true"] .eup-acc2-chev {
	transform: rotate(180deg);
}

.eup-acc2-pop {
	animation: eup-acc2-drop 0.25s var(--eup-acc2-smooth) both;
	background: #ffffff;
	border: 1px solid var(--eup-acc2-soft);
	border-radius: var(--eup-acc2-radius);
	box-shadow: 0 12px 32px rgba(29, 24, 72, 0.1);
	left: 0;
	overflow: hidden;
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 30;
}

.eup-acc2-search {
	align-items: center;
	border-bottom: 1px solid var(--eup-acc2-line);
	display: flex;
	gap: 10px;
	padding: 10px 12px;
}

.eup-acc2-search svg {
	color: var(--eup-acc2-ink);
	flex: none;
	height: 20px;
	width: 20px;
}

.eup-acc2-phone .eup-acc2-search input,
.eup-acc2-phone .eup-acc2-search input:focus {
	background: #ffffff;
	border: 1px solid var(--eup-acc2-soft);
	border-radius: 8px;
	box-shadow: none;
	color: var(--eup-acc2-ink);
	flex: 1;
	font-family: inherit;
	font-size: 16px;
	font-weight: 300;
	height: 44px;
	margin: 0;
	min-width: 0;
	padding: 0 12px;
}

.eup-acc2-phone .eup-acc2-search input:focus {
	border-color: var(--eup-acc2-ink);
	outline: 0;
}

.eup-acc2-list {
	list-style: none;
	margin: 0;
	max-height: 336px;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 0;
}

.eup-acc2-list li {
	align-items: center;
	color: var(--eup-acc2-ink);
	cursor: pointer;
	display: flex;
	font-size: 16px;
	font-weight: 300;
	gap: 12px;
	margin: 0;
	min-height: 48px;
	padding: 0 16px;
}

.eup-acc2-list li.is-active {
	background: var(--eup-acc2-mint);
}

.eup-acc2-list .eup-acc2-opt-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.eup-acc2-list .eup-acc2-opt-dial {
	color: var(--eup-acc2-soft);
	font-variant-numeric: tabular-nums;
	font-weight: 400;
}

.eup-acc2-list .eup-acc2-opt-check {
	color: var(--eup-acc2-deep);
	flex: none;
	height: 18px;
	visibility: hidden;
	width: 18px;
}

.eup-acc2-list li[aria-selected="true"] .eup-acc2-opt-check {
	visibility: visible;
}

.eup-acc2-status {
	color: var(--eup-acc2-soft);
	font-size: 13px;
	margin: 0;
	padding: 8px 16px 12px;
}

.eup-acc2-error {
	align-items: flex-start;
	color: var(--eup-acc2-error);
	display: flex;
	font-size: 14.4px;
	font-weight: 400;
	gap: 8px;
	line-height: 1.45;
	margin: 0;
}

/* Account details (WooCommerce's own form): the field matches the inputs around it. */
.woocommerce-EditAccountForm .eup-acc2-phone {
	gap: 0;
}

.woocommerce-EditAccountForm .eup-acc2-phone .eup-acc2-tel {
	border-color: var(--eup3-ink-soft, #ddd);
	border-radius: var(--eup3-radius-field, 0);
	min-height: 2.507em;
}

/* ---------------------------------------------------------------- header popup (Flatsome header only) */

.eup-acc2-popup {
	color: var(--eup-acc2-ink);
	display: flex;
	flex-direction: column;
	font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 300;
	gap: 20px;
	text-align: left;
}

.eup-acc2-popup .eup-acc2-mark--small {
	color: var(--eup-acc2-teal);
	width: 30px;
}

.eup-acc2-popup .eup-acc2-popup__title {
	color: var(--eup-acc2-ink);
	font-size: 28px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.2;
	margin: 0;
	text-transform: none;
}

.eup-acc2-popup__new {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: 16px;
	gap: 8px;
	margin: 0;
}

/* ---------------------------------------------------------------- motion */

.eup-acc2-mark {
	animation: eup-acc2-settle 1.6s var(--eup-acc2-reveal) both;
}

.eup-acc2-panel__title {
	animation: eup-acc2-rise 1s var(--eup-acc2-reveal) 0.1s both;
}

.eup-acc2-panel__list {
	animation: eup-acc2-rise 1s var(--eup-acc2-reveal) 0.2s both;
}

@keyframes eup-acc2-settle {
	from { opacity: 0; transform: scale(0.94); }
	to { opacity: 1; transform: none; }
}

@keyframes eup-acc2-rise {
	from { opacity: 0; transform: translateY(24px); }
	to { opacity: 1; transform: none; }
}

@keyframes eup-acc2-drop {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

@keyframes eup-acc2-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.eup-acc2 *,
	.eup-acc2-popup *,
	.eup-acc2-phone * {
		animation-delay: 0s !important;
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ---------------------------------------------------------------- narrow screens: the panel becomes a band */

@media (max-width: 1023px) {
	.eup-acc2 {
		gap: 24px;
		grid-template-columns: minmax(0, 1fr);
		margin-top: 0;
		max-width: 560px;
	}

	.eup-acc2-main {
		max-width: none;
		padding-top: 0;
	}

	.eup-acc2-panel {
		align-items: center;
		flex-direction: row;
		gap: 16px;
		justify-content: flex-start;
		min-height: 0;
		padding: 20px;
	}

	.eup-acc2-mark {
		width: 30px;
	}

	.eup-acc2 .eup-acc2-panel__title {
		font-size: 24px;
		line-height: 1.25;
	}

	.eup-acc2-panel__list {
		display: none;
	}
}

@media (max-width: 420px) {
	.eup-acc2-pair {
		grid-template-columns: minmax(0, 1fr);
	}
}
