/**
 * mod_pluslogin — Plus code gate
 *
 * Scoped under .plusgate so it cannot leak into the site template. Colours are
 * exposed as custom properties on the wrapper so a template override can retheme
 * the whole thing without touching this file.
 *
 * The buttons (.plusgate__button, .plusgate__submit) carry the theme's button
 * class (Button CSS class module setting, default ptotoday-btn-primary) and are
 * deliberately not skinned here — the site template owns how they look.
 */

 .plusgate {
	--plusgate-accent: #3aa9c9;
	--plusgate-rule: #f5b32b;
	--plusgate-ink: #4a4a4a;
	--plusgate-ink-soft: #6f6f6f;
	--plusgate-line: #cfcfcf;
	--plusgate-surface: #fff;
	--plusgate-error: #b3261e;

	position: relative;
	display: inline-block;
	font-family: inherit;
	color: var(--plusgate-ink);
}

/* Panel ------------------------------------------------------------------ */

.plusgate__panel {
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	left: 0;
	width: min(33rem, calc(100vw - 2rem));
	padding: 1.75rem 1.75rem 1.5rem;
	border-top: 6px solid var(--plusgate-rule);
	background: var(--plusgate-surface);
	box-shadow: 0 6px 24px rgb(0 0 0 / 18%);
	text-align: left;
}

.plusgate__panel[hidden] {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.plusgate__panel {
		animation: plusgate-in 140ms ease-out;
	}
}

@keyframes plusgate-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

.plusgate__heading {
	margin: 0 0 1.1rem;
	font-size: 1.4rem;
	font-weight: 400;
	line-height: 1.3;
	color: var(--plusgate-ink);
}

/* Input row -------------------------------------------------------------- */

.plusgate__row {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	max-width: 28rem;
}

.plusgate__srlabel {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.plusgate__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.7em 0.85em;
	border: 1px solid var(--plusgate-line);
	background: #fff;
	font-size: 1.0625rem;
	color: var(--plusgate-ink);
	text-transform: uppercase;
}

.plusgate__input::placeholder {
	color: var(--plusgate-ink-soft);
	text-transform: none;
}

.plusgate__input:focus {
	outline: 2px solid var(--plusgate-accent);
	outline-offset: -2px;
}

.plusgate__submit {
	flex: 0 0 auto;
}

.plusgate__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Remember, messages, footer -------------------------------------------- */

.plusgate__remember {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.9rem;
	font-weight: 700;
}

.plusgate__remember input {
	margin: 0;
}

.plusgate__remember label {
	margin: 0;
	font-weight: 700;
}

.plusgate__message {
	margin: 0.9rem 0 0;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--plusgate-ink-soft);
}

.plusgate__message:empty {
	display: none;
}

.plusgate__message.is-error {
	color: var(--plusgate-error);
}

.plusgate__status {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	color: var(--plusgate-ink-soft);
}

.plusgate__footer {
	margin-top: 1.6rem;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.plusgate__link {
	display: block;
	color: var(--plusgate-accent);
	text-decoration: none;
}

.plusgate__link:hover {
	text-decoration: underline;
}

.plusgate__footnote {
	display: block;
	color: var(--plusgate-ink);
}

/* Small screens: the popover becomes a normal block ---------------------- */

@media (max-width: 40rem) {
	.plusgate {
		display: block;
	}

	.plusgate__panel {
		position: static;
		width: auto;
		box-shadow: none;
		border: 1px solid var(--plusgate-line);
		border-top: 6px solid var(--plusgate-rule);
		padding: 1.25rem;
	}

	.plusgate__row {
		flex-wrap: wrap;
	}

	.plusgate__input {
		flex-basis: 100%;
	}
}
