/* Registration page polish. Layout/form shared rules live in styles.css. */

/* Hide user metadata group headers and descriptions in registration form */
#header-user-metadata,
#description-user-metadata,
label[id='header-user-metadata'],
label[id='description-user-metadata'] {
	display: none !important;
}

/* Hide the entire form group containing user metadata headers */
.pf-v5-c-form__group:has(#header-user-metadata),
.pf-v5-c-form__group:has(label[id='header-user-metadata']) {
	display: none !important;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
	.pf-v5-c-form__group:first-of-type {
		display: none !important;
	}
}

[data-page-id='login-register'] .pf-v5-c-login__main-header {
	display: none;
}

[data-page-id='login-register'] .pf-v5-c-login__main-header::after {
	content: 'Create your account to get started';
}

html[lang='es']
	[data-page-id='login-register']
	.pf-v5-c-login__main-header::after {
	content: 'Crea tu cuenta para comenzar';
}

[data-page-id='login-register'] .subtitle {
	display: none !important;
}

#kc-register-form > .subtitle {
	display: none !important;
}

#kc-register-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 1.35rem 1rem;
}

#kc-register-form > .pf-v5-c-form__group,
#kc-register-form > #kc-form-buttons,
#kc-register-form > .pf-v5-c-login__main-footer-band {
	grid-column: 1 / -1;
	width: 100%;
	margin: 0;
}

#kc-register-form > .pf-v5-c-form__group:has(#firstName) {
	grid-column: 1;
	order: 1;
}

#kc-register-form > .pf-v5-c-form__group:has(#lastName) {
	grid-column: 2;
	order: 2;
}

#kc-register-form > .pf-v5-c-form__group:has(#email) {
	order: 3;
}

#kc-register-form > .pf-v5-c-form__group:has(#password) {
	order: 4;
}

#kc-register-form > .pf-v5-c-form__group:has(#password-confirm) {
	order: 5;
}

#kc-register-form > #kc-form-buttons {
	order: 6;
}

#kc-register-form > .pf-v5-c-login__main-footer-band {
	order: 7;
	padding: 0;
	border-top: 0;
	background: transparent;
	text-align: center;
	color: var(--auth-muted);
}

#kc-register-form > .pf-v5-c-login__main-footer-band::before {
	content: 'Already have an account? ';
}

html[lang='es'] #kc-register-form > .pf-v5-c-login__main-footer-band::before {
	content: '¿Ya tienes una cuenta? ';
}

#kc-register-form > .pf-v5-c-login__main-footer-band a {
	font-size: 0;
}

#kc-register-form > .pf-v5-c-login__main-footer-band a::after {
	content: 'Sign in';
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

html[lang='es'] #kc-register-form > .pf-v5-c-login__main-footer-band a::after {
	content: 'Iniciar sesión';
}

#kc-register-form .pf-v5-c-form__label-text {
	text-transform: capitalize;
}

#kc-register-form .pf-v5-c-form__label-required {
	margin-left: 0.2rem;
	color: var(--error);
}

#kc-register-form .pf-v5-c-form__group:has(#email) .pf-v5-c-form__label-text,
#kc-register-form .pf-v5-c-form__group:has(#password) .pf-v5-c-form__label-text,
#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label-text {
	font-size: 0;
}

#kc-register-form
	.pf-v5-c-form__group:has(#email)
	.pf-v5-c-form__label-text::before {
	content: 'Email Address';
	font-size: 0.875rem;
}

html[lang='es']
	#kc-register-form
	.pf-v5-c-form__group:has(#email)
	.pf-v5-c-form__label-text::before {
	content: 'Correo electrónico';
}

#kc-register-form
	.pf-v5-c-form__group:has(#password)
	.pf-v5-c-form__label-text::before {
	content: 'Create Password';
	font-size: 0.875rem;
}

html[lang='es']
	#kc-register-form
	.pf-v5-c-form__group:has(#password)
	.pf-v5-c-form__label-text::before {
	content: 'Crear contraseña';
}

#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label-text::before {
	content: 'Confirm Password';
	font-size: 0.875rem;
}

html[lang='es']
	#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label-text::before {
	content: 'Confirmar contraseña';
}

#kc-register-form
	.pf-v5-c-form__group:has(#password)
	.pf-v5-c-form__label::after,
#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label::after {
	display: block;
	margin-top: 0.95rem;
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--auth-muted);
}

#kc-register-form
	.pf-v5-c-form__group:has(#password)
	.pf-v5-c-form__label::after {
	content: 'Must be at least 8 characters and include one uppercase letter, lowercase letter, number, and special character (e.g., !, #).';
}

html[lang='es']
	#kc-register-form
	.pf-v5-c-form__group:has(#password)
	.pf-v5-c-form__label::after {
	content: 'Debe tener al menos 8 caracteres e incluir una mayúscula, una minúscula, un número y un carácter especial (p. ej., !, @, #, $).';
}

#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label::after {
	content: 'Re-enter your password to confirm.';
}

html[lang='es']
	#kc-register-form
	.pf-v5-c-form__group:has(#password-confirm)
	.pf-v5-c-form__label::after {
	content: 'Vuelve a ingresar tu contraseña para confirmar';
}

@media (max-width: 640px) {
	#kc-register-form > .pf-v5-c-form__group:has(#firstName),
	#kc-register-form > .pf-v5-c-form__group:has(#lastName) {
		grid-column: 1 / -1;
	}
}
