/*
 * The FluentAuth login form on the FluentCart account page, drawn in the
 * storefront's look: a white card, the site's fields, pill buttons.
 *
 * Colours, font and radii come from the Astro site's design tokens, which the
 * WordPress header and footer already define on every page. Another brand
 * changes only the --ks-login-* lines below.
 *
 * Every selector starts at .fct_auth_wrap (FluentCart's wrapper) so it outranks
 * FluentAuth's own stylesheet and never reaches a form anywhere else. The few
 * !important rules override inline styles that FluentCart and FluentAuth print
 * on their elements.
 */

.fct_auth_wrap {
	--ks-login-accent: var(--dc-color-brand-500, #9b2242);
	--ks-login-accent-dark: var(--dc-color-brand-700, #6e1630);
	--ks-login-ink: var(--dc-color-ink, #231218);
	--ks-login-muted: var(--dc-color-muted, #8c797e);
	--ks-login-line: var(--dc-color-hairline, #e7dcdf);
	--ks-login-line-strong: var(--dc-color-hairline-strong, #d6c5ca);
	--ks-login-font: var(--dc-font-sans, system-ui, sans-serif);
	--ks-login-radius-card: var(--dc-radius-card, 1rem);
	--ks-login-radius-input: var(--dc-radius-input, 0.5rem);
	--ks-login-shadow: var(--dc-shadow-card, 0 1px 3px rgb(0 0 0 / 0.1));

	/* FluentAuth's passkey button reads these. */
	--fls-form-button_color: #fff;
	--fls-form-button_label_color: var(--ks-login-ink);
}

/* The card. FluentCart prints its own width, padding and border inline. */
.fct_auth_wrap {
	max-width: 28rem !important;
	margin: 2rem auto !important;
	padding: 2rem !important;
	border: 1px solid var(--ks-login-line) !important;
	border-radius: var(--ks-login-radius-card) !important;
	background: #fff;
	box-shadow: var(--ks-login-shadow);
	color: var(--ks-login-ink);
	font-family: var(--ks-login-font);
	font-size: 1rem;
	line-height: 1.5;
}

@media (max-width: 480px) {
	.fct_auth_wrap {
		padding: 1.5rem 1.25rem !important;
	}
}

.fct_auth_wrap h4 {
	margin: 0 0 1.5rem;
	padding: 0;
	color: var(--ks-login-ink);
	font-family: var(--ks-login-font);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.fct_auth_wrap .fls_login_wrapper,
.fct_auth_wrap .fls_reset_pass_wrapper,
.fct_auth_wrap .fls_registration_wrapper {
	max-width: none;
}

.fct_auth_wrap .fls_login_wrapper form#loginform > p,
.fct_auth_wrap .fls_field_group {
	margin: 0 0 1.25rem;
	padding: 0;
}

/* Labels and fields, as in the site's .field */
.fct_auth_wrap label {
	display: block;
	color: var(--ks-login-ink);
	font-size: 0.875rem;
	font-weight: 700;
}

.fct_auth_wrap input[type="text"],
.fct_auth_wrap input[type="email"],
.fct_auth_wrap input[type="password"],
.fct_auth_wrap .fls_login_wrapper form#loginform .input,
.fct_auth_wrap .fls_login_wrapper .fls_magic_input,
.fct_auth_wrap .fls_reset_pass_wrapper .fls_reset_pass_form input,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form input {
	width: 100%;
	margin: 0.4rem 0 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--ks-login-line-strong);
	border-radius: var(--ks-login-radius-input);
	background: #fff;
	box-shadow: none;
	color: var(--ks-login-ink);
	font: inherit;
	line-height: 1.5;
}

.fct_auth_wrap input[type="text"]:focus,
.fct_auth_wrap input[type="email"]:focus,
.fct_auth_wrap input[type="password"]:focus {
	border-color: var(--ks-login-accent);
	outline: none;
}

.fct_auth_wrap input::placeholder {
	color: var(--ks-login-muted);
}

/* Remember Me, as in the site's .field-check. The id outranks FluentAuth's
   own label rule, which also carries one. */
.fct_auth_wrap form#loginform .login-remember label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 500;
	cursor: pointer;
}

.fct_auth_wrap .login-remember input[type="checkbox"] {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0;
	accent-color: var(--ks-login-accent);
}

/* Buttons share the site's pill shape */
.fct_auth_wrap .fls_login_wrapper input#wp-submit,
.fct_auth_wrap .fls_login_wrapper #fls_magic_submit,
.fct_auth_wrap .fls_reset_pass_wrapper .fls_reset_pass_form #fls_reset_pass,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_submit,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_verification_submit,
.fct_auth_wrap .magic_btn_secondary,
.fct_auth_wrap #fls_passkey_login_button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 0 !important;
	padding: 0.9rem 1.5rem !important;
	border: 1px solid transparent;
	border-radius: 999px !important;
	font-family: var(--ks-login-font);
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	text-shadow: none;
	cursor: pointer;
	transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.3s;
}

/* Primary: Log In, Continue, Reset Password, Sign Up */
.fct_auth_wrap .fls_login_wrapper input#wp-submit,
.fct_auth_wrap .fls_login_wrapper #fls_magic_submit,
.fct_auth_wrap .fls_reset_pass_wrapper .fls_reset_pass_form #fls_reset_pass,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_submit,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_verification_submit {
	background: var(--ks-login-accent);
	color: #fff;
}

/* Darkened the same way as the site's primary button */
.fct_auth_wrap .fls_login_wrapper input#wp-submit:hover,
.fct_auth_wrap .fls_login_wrapper #fls_magic_submit:hover,
.fct_auth_wrap .fls_reset_pass_wrapper .fls_reset_pass_form #fls_reset_pass:hover,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_submit:hover,
.fct_auth_wrap .fls_registration_wrapper .fls_registration_form #fls_verification_submit:hover {
	background: var(--ks-login-accent);
	box-shadow: inset 0 0 0 100px rgb(0 0 0 / 0.15);
}

/* Secondary: passkey and magic link */
.fct_auth_wrap .magic_btn_secondary,
.fct_auth_wrap #fls_passkey_login_button {
	border-color: var(--ks-login-line-strong) !important;
	background: #fff !important;
	color: var(--ks-login-ink) !important;
}

.fct_auth_wrap .magic_btn_secondary:hover,
.fct_auth_wrap #fls_passkey_login_button:hover {
	border-color: var(--ks-login-accent) !important;
	color: var(--ks-login-accent-dark) !important;
}

/* The "Or" lines between the ways to sign in */
.fct_auth_wrap .fls_magic-or::before,
.fct_auth_wrap .fls_magic-or::after {
	border-color: var(--ks-login-line);
}

.fct_auth_wrap .fls_magic-or span,
.fct_auth_wrap .fls_passkey_login__or {
	color: var(--ks-login-muted) !important;
	font-size: 0.8125rem !important;
	letter-spacing: 0.04em !important;
}

.fct_auth_wrap .fls_passkey_login__or > span:not(:nth-child(2)) {
	background: var(--ks-login-line) !important;
}

.fct_auth_wrap #fls_magic_login {
	margin-top: 1rem;
}

.fct_auth_wrap p.fls_magic_text {
	color: var(--ks-login-muted);
	font-size: 0.875rem;
}

/* Forgot your password? and the other links under the form */
.fct_auth_wrap .fls_login_wrapper > p,
.fct_auth_wrap .fls_reset_pass_wrapper > p,
.fct_auth_wrap .fls_registration_wrapper > p {
	margin: 1.25rem 0 0;
	padding: 0;
	color: var(--ks-login-muted);
	font-size: 0.875rem;
}

.fct_auth_wrap a {
	color: var(--ks-login-accent);
	font-weight: 600;
	text-decoration: none;
}

.fct_auth_wrap a:hover {
	color: var(--ks-login-accent-dark);
	text-decoration: underline;
}

.fct_auth_wrap .error.text-danger {
	color: var(--dc-color-warn, #9a5b12);
	font-size: 0.875rem;
}
