/**
 * Jelentkezési Űrlap – frontend stílusok.
 *
 * A betűtípust az oldaltól örökli, a kiemelő szín a beállított gombszín.
 * Az #ju-modal ID-alapú szelektorok azért kellenek, hogy a téma általános
 * input/button/label stílusai ne torzítsák az űrlapot.
 */

:root {
	--ju-accent: #1e6fd9;
	--ju-accent-text: #fff;
	--ju-accent-hover: #1557ad;
	--ju-accent-hover-text: #fff;
	--ju-btn-radius: 6px;
}

/* ---------- Megnyitó gomb ---------- */

.ju-button-wrap {
	display: block;
	margin: 0;
}

.ju-button-wrap.ju-align-left { text-align: left; }
.ju-button-wrap.ju-align-center { text-align: center; }
.ju-button-wrap.ju-align-right { text-align: right; }

.ju-button-wrap button.ju-open-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	margin: 0;
	padding: .8em 1.6em;
	min-height: 44px;
	border: 0;
	border-radius: var(--ju-btn-radius);
	background: var(--ju-accent);
	background-image: none;
	color: var(--ju-accent-text);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, transform .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ju-button-wrap button.ju-open-button:hover,
.ju-button-wrap button.ju-open-button:focus-visible {
	background: var(--ju-accent-hover);
	color: var(--ju-accent-hover-text);
}

.ju-button-wrap button.ju-open-button:active {
	transform: translateY(1px);
}

.ju-button-wrap button.ju-open-button:focus-visible {
	outline: 2px solid var(--ju-accent);
	outline-offset: 3px;
}

.ju-button-wrap.ju-full button.ju-open-button {
	display: flex;
	width: 100%;
}

/* ---------- Popup ---------- */

html.ju-modal-open,
html.ju-modal-open body {
	overflow: hidden !important;
}

#ju-modal {
	--ju-text: #1f2328;
	--ju-muted: #5b636d;
	--ju-border: #d0d5dc;
	--ju-bg: #fff;
	--ju-soft: #f5f6f8;
	--ju-danger: #c62828;
	--ju-radius: 10px;
	--ju-gap: 16px;

	box-sizing: border-box;
	position: fixed;
	inset: 0;
	margin: auto;
	padding: 0;
	width: min(640px, calc(100vw - 32px));
	max-width: none;
	height: fit-content;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	border: 0;
	border-radius: var(--ju-radius);
	background: var(--ju-bg);
	color: var(--ju-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
	overflow: hidden;
	z-index: 2147483000;
}

#ju-modal:not([open]) {
	display: none;
}

#ju-modal[open] {
	display: flex;
	flex-direction: column;
	animation: ju-in .2s ease-out;
}

#ju-modal::backdrop {
	background: rgba(15, 20, 25, .6);
	animation: ju-fade .2s ease-out;
}

#ju-modal *,
#ju-modal *::before,
#ju-modal *::after {
	box-sizing: border-box;
}

@keyframes ju-in {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to { opacity: 1; transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
	#ju-modal[open],
	#ju-modal::backdrop { animation: none; }
}

/* Fejléc – fix marad görgetéskor */
#ju-modal .ju-modal__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 16px 24px;
	border-bottom: 1px solid var(--ju-border);
	background: var(--ju-bg);
}

#ju-modal .ju-modal__title {
	margin: 0;
	padding: 0;
	color: var(--ju-text);
	font-family: inherit;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	border: 0;
}

#ju-modal button.ju-modal__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0 -6px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ju-muted);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

#ju-modal button.ju-modal__close:hover,
#ju-modal button.ju-modal__close:focus-visible {
	background: var(--ju-soft);
	color: var(--ju-text);
}

#ju-modal button.ju-modal__close:focus-visible {
	outline: 2px solid var(--ju-accent);
	outline-offset: 0;
}

/* Tartalom – ez görget, ha sok a mező */
#ju-modal .ju-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 20px 24px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

/* Lábléc – fix marad görgetéskor */
#ju-modal .ju-modal__footer {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 24px;
	border-top: 1px solid var(--ju-border);
	background: var(--ju-soft);
}

/* ---------- Űrlap ---------- */

#ju-modal .ju-form { margin: 0; padding: 0; }
#ju-modal .ju-form[hidden] { display: none; }

#ju-modal .ju-form__intro {
	margin: 0 0 16px;
	color: var(--ju-text);
}

#ju-modal .ju-form__intro > :first-child { margin-top: 0; }
#ju-modal .ju-form__intro > :last-child { margin-bottom: 0; }

#ju-modal .ju-form__legend {
	margin: 0 0 16px;
	color: var(--ju-muted);
	font-size: .875rem;
}

#ju-modal .ju-req {
	color: var(--ju-danger);
	font-weight: 700;
}

#ju-modal .ju-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--ju-gap) 16px;
}

#ju-modal .ju-field {
	grid-column: 1 / -1;
	min-width: 0;
	margin: 0;
}

#ju-modal .ju-field--half {
	grid-column: auto;
}

#ju-modal .ju-label,
#ju-modal legend.ju-label {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 6px;
	padding: 0;
	color: var(--ju-text);
	font-family: inherit;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.35;
	text-transform: none;
	letter-spacing: normal;
	border: 0;
}

#ju-modal .ju-input {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	min-height: 44px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--ju-border);
	border-radius: 6px;
	background: #fff;
	color: var(--ju-text);
	font-family: inherit;
	font-size: 16px; /* iOS ne zoomoljon be */
	line-height: 1.4;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

#ju-modal textarea.ju-input {
	min-height: 96px;
	resize: vertical;
}

#ju-modal select.ju-input {
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b636d' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
}

#ju-modal .ju-input::placeholder {
	color: #8b939c;
	opacity: 1;
}

#ju-modal .ju-input:focus {
	outline: none;
	border-color: var(--ju-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ju-accent) 22%, transparent);
}

#ju-modal .ju-choices {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

#ju-modal .ju-choice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	padding: 0;
	color: var(--ju-text);
	font-size: .9375rem;
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}

#ju-modal .ju-choice:last-child { margin-bottom: 0; }

#ju-modal .ju-choice input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	padding: 0;
	accent-color: var(--ju-accent);
	cursor: pointer;
	position: static;
	opacity: 1;
	-webkit-appearance: auto;
	appearance: auto;
}

#ju-modal .ju-choice a {
	color: var(--ju-accent);
	text-decoration: underline;
}

/* Hibák */
#ju-modal .ju-error {
	display: none;
	margin: 6px 0 0;
	color: var(--ju-danger);
	font-size: .8125rem;
	line-height: 1.35;
}

#ju-modal .ju-field.has-error .ju-error { display: block; }

#ju-modal .ju-field.has-error .ju-input {
	border-color: var(--ju-danger);
}

#ju-modal .ju-field.has-error .ju-input:focus {
	box-shadow: 0 0 0 3px rgba(198, 40, 40, .18);
}

#ju-modal .ju-form__message {
	margin: 0;
	color: var(--ju-danger);
	font-size: .9375rem;
}

#ju-modal .ju-form__message:not(:empty) {
	margin-top: 20px;
	padding: 10px 14px;
	border-radius: 6px;
	background: rgba(198, 40, 40, .08);
}

/* Honeypot */
#ju-modal .ju-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Gombok a popupban ---------- */

#ju-modal button.ju-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--ju-btn-radius);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

#ju-modal button.ju-btn[hidden] { display: none; }

#ju-modal button.ju-btn--primary {
	background: var(--ju-accent);
	color: var(--ju-accent-text);
}

#ju-modal button.ju-btn--primary:hover,
#ju-modal button.ju-btn--primary:focus-visible {
	background: var(--ju-accent-hover);
	color: var(--ju-accent-hover-text);
}

#ju-modal button.ju-btn--ghost {
	background: transparent;
	border-color: var(--ju-border);
	color: var(--ju-text);
}

#ju-modal button.ju-btn--ghost:hover,
#ju-modal button.ju-btn--ghost:focus-visible {
	background: #fff;
	border-color: var(--ju-muted);
}

#ju-modal button.ju-btn:focus-visible {
	outline: 2px solid var(--ju-accent);
	outline-offset: 2px;
}

#ju-modal button.ju-btn[disabled] {
	opacity: .65;
	cursor: wait;
}

#ju-modal .ju-submit.is-loading::before {
	content: "";
	width: 16px;
	height: 16px;
	margin-right: 8px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ju-spin .7s linear infinite;
}

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

/* ---------- Siker ---------- */

#ju-modal .ju-success {
	padding: 24px 8px;
	text-align: center;
	outline: none;
}

#ju-modal .ju-success[hidden] { display: none; }

#ju-modal .ju-success__icon {
	display: block;
	margin: 0 auto 12px;
	color: var(--ju-accent);
}

#ju-modal .ju-success__text {
	color: var(--ju-text);
	font-size: 1.0625rem;
}

#ju-modal .ju-success__text > :first-child { margin-top: 0; }
#ju-modal .ju-success__text > :last-child { margin-bottom: 0; }

/* ---------- Mobil ---------- */

@media (max-width: 600px) {
	#ju-modal {
		width: 100vw;
		max-height: calc(100vh - 12px);
		max-height: calc(100dvh - 12px);
		margin: auto 0 0;
		border-radius: var(--ju-radius) var(--ju-radius) 0 0;
	}

	#ju-modal .ju-modal__header { padding: 14px 12px 12px 16px; }
	#ju-modal .ju-modal__body { padding: 16px; }
	#ju-modal .ju-modal__footer { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	#ju-modal .ju-modal__footer .ju-btn { flex: 1 1 auto; }

	#ju-modal .ju-form__grid { grid-template-columns: minmax(0, 1fr); }
	#ju-modal .ju-field--half { grid-column: 1 / -1; }
}
