/**
 * DKM Price Alert
 *
 * A sign-up box under the price. The button's look is the element's Elementor
 * base style - the Style tab starts from it and wins over it - so this keeps
 * only the layout, the fields, the messages and the hover.
 */

.wcg-pa {
	/* Diilikaubamaja Design System v2. The field's edge is Ink 500 because it
	   is what shows where to type: WCAG 1.4.11 asks 3:1 of a control's parts,
	   and the grey it replaced was 1.5:1 on white. */
	--wcg-pa-accent: var(--text-success);
	--wcg-pa-error: var(--text-danger);
	--wcg-pa-muted: var(--text-tertiary);
	--wcg-pa-border: var(--input-border);
	--wcg-pa-focus: var(--border-focus);

	display: block;
	min-width: 0;
}

.wcg-pa__title {
	margin: 0 0 6px;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.35;
}

.wcg-pa__description,
.wcg-pa__closed {
	margin: 0 0 12px;
	color: var(--wcg-pa-muted);
	line-height: 1.5;
}

.wcg-pa__closed {
	margin: 0;
}

.wcg-pa__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.wcg-pa__field {
	display: block;
	margin: 0;
}

.wcg-pa .wcg-pa__email {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--control-md);
	margin: 0;
	padding: 10px 12px;
	border: var(--border-hairline) solid var(--wcg-pa-border);
	border-radius: var(--input-radius);
	background: var(--input-bg);
	color: var(--input-text);
	font: inherit;
	font-size: 16px; /* Below 16px a phone zooms the page in on focus. */
}

.wcg-pa .wcg-pa__email::placeholder {
	color: var(--wcg-pa-muted);
	opacity: 1;
}

.wcg-pa .wcg-pa__email:focus {
	background-color: var(--input-focus-bg);
	border-color: var(--wcg-pa-focus);
	outline: 2px solid var(--wcg-pa-focus);
	outline-offset: 1px;
}

.wcg-pa__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-size: 0.92em;
	line-height: 1.45;
	cursor: pointer;
}

.wcg-pa__check {
	flex: none;
	margin: 3px 0 0;
	accent-color: var(--wcg-pa-focus);
}

/* Out of sight, not out of the form: a bot fills it in, a person never sees it. */
.wcg-pa__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Size and behaviour only; colour, border, corners and padding are the base
   style, so the Style tab can change them. */
:where(.wcg-pa) .wcg-pa__button {
	box-sizing: border-box;
	width: 100%;
	min-height: var(--control-md);
	margin: 0;
	font-family: inherit;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: var(--motion-control);
}

/* A shade over whatever background the button has, so a background set in
   the Style tab keeps its hover. :is(button) and :not(p) only add weight:
   above a theme's `button:hover`, below the Style tab's own hover. */
:where(.wcg-pa) .wcg-pa__button:is(button):hover:not(p),
:where(.wcg-pa) .wcg-pa__button:is(button):focus-visible:not(p) {
	background-image: linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12));
}

.wcg-pa .wcg-pa__button:focus-visible {
	outline: 2px solid var(--border-focus);
	outline-offset: 2px;
}

.wcg-pa .wcg-pa__button[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
	background-image: none;
}

.wcg-pa__hint {
	margin: 0;
	color: var(--wcg-pa-muted);
	font-size: 0.9em;
}

.wcg-pa__message {
	margin: 8px 0 0;
	color: var(--wcg-pa-accent);
	font-size: 0.92em;
}

.wcg-pa__message:empty {
	display: none;
}

.wcg-pa__message.is-error {
	color: var(--wcg-pa-error);
}

/* The folded layout: one quiet row, the form under it once opened.
   DS v3.4: the row only reveals the form, so it is a tertiary button - no
   frame, the tertiary text colour, a grey fill under the pointer. Saving the
   alert is the form's own button. */
.wcg-pa__fold {
	display: block;
}

.wcg-pa .wcg-pa__summary {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	min-height: var(--control-md);
	padding: 0 12px;
	border: 0;
	border-radius: var(--button-radius);
	background: var(--button-tertiary-bg);
	color: var(--button-tertiary-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
	transition: var(--motion-control);
}

.wcg-pa .wcg-pa__summary::-webkit-details-marker {
	display: none;
}

.wcg-pa .wcg-pa__summary:hover {
	background: var(--button-tertiary-hover-bg);
	color: var(--button-tertiary-hover-text);
}

.wcg-pa .wcg-pa__summary:focus-visible {
	outline: 2px solid var(--wcg-pa-focus);
	outline-offset: 2px;
}

.wcg-pa__summary-text {
	flex: 1;
	min-width: 0;
}

.wcg-pa__bell,
.wcg-pa__chevron {
	flex: none;
}

.wcg-pa__fold[open] .wcg-pa__chevron {
	transform: rotate(180deg);
}

.wcg-pa__panel {
	padding-top: 12px;
}

.wcg-pa__panel .wcg-pa__description {
	margin-bottom: 10px;
}

/* Folded, the form is a quiet aside: a secondary button, below the Style
   tab - it only fills in what is not set. */
:where(.wcg-pa__fold) .wcg-pa__button {
	padding: 0 18px;
	border: 0;
	border-radius: var(--button-radius);
	background-color: var(--button-secondary-bg);
	color: var(--button-secondary-text);
	font-weight: 600;
}

/* DS v3.5: a field's edge goes one step darker under the pointer. */
.wcg-pa .wcg-pa__email:hover:not(:focus) {
	border-color: var(--input-hover-border);
}
