/*
 * SECTION:  Login, register, lost password and reset password pages
 * File:     assets/css/pages/sol-auth.css
 * Used by:  woocommerce/myaccount/form-login.php, form-lost-password.php,
 *           form-reset-password.php, lost-password-confirmation.php
 *           and assets/js/sol-auth.js
 * To remove: delete this file and its line in inc/assets.php (handle "sol-auth").
 *
 * Loaded only for visitors who are not logged in. Everything is scoped to .sol-auth.
 * Colors come only from the tokens, so light and dark mode follow the theme switch.
 * Form colors are !important on purpose: the Elementor kit colors form fields with
 * stronger selectors (see the same note in sol-checkout.css).
 *
 * Contents
 *   1. Layout
 *   2. Intro panel
 *   3. Card, tabs and headings
 *   4. Fields
 *   5. Checkbox, buttons, links
 *   6. Password: show button and strength
 *   7. Confirmation
 */

/* ==========================================================================
   1. Layout
   ========================================================================== */
.sol-auth.sol-auth {
	display: grid;
	gap: 20px;
	max-width: var(--sol-container);
	margin-inline: auto;
	padding: 24px var(--sol-gutter) 72px;
	color: var(--sol-text);
}

.sol-auth [hidden] {
	display: none !important;
}

/* Text inside follows the theme, not a color set by the kit around the shortcode. */
.sol-auth.sol-auth :where(strong, b, label, p, li, span, small, h1, h2, h3) {
	color: inherit;
}

/* Lost and reset password: one centered card. */
.sol-auth--narrow.sol-auth--narrow {
	max-width: calc(560px + 2 * var(--sol-gutter));
	padding-top: 40px;
}

@media (min-width: 900px) {
	.sol-auth--split.sol-auth--split {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		align-items: center;
		gap: 56px;
		padding-top: 56px;
	}
}

/* ==========================================================================
   2. Intro panel (login and register page only)
   ========================================================================== */
.sol-auth__intro {
	padding: 28px 24px;
	border: 1px solid var(--sol-line);
	border-radius: var(--sol-radius-lg);
	background: color-mix(in srgb, var(--sol-accent) 10%, var(--sol-surface));
}

.sol-auth__intro-title {
	margin: 0 0 12px;
	font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
	line-height: var(--sol-leading-title);
}

.sol-auth__intro-text {
	margin: 0;
	color: var(--sol-muted);
	font-size: 1.0625rem;
	line-height: 1.55;
}

/* The list is extra: phones go straight to the form. */
.sol-auth__perks {
	display: none;
	gap: 14px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.sol-auth__perks li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	color: var(--sol-text);
	font-weight: 500;
	line-height: 1.45;
}

.sol-auth__perks svg {
	flex: none;
	margin-top: 1px;
	padding: 3px;
	border-radius: 50%;
	background: var(--sol-accent);
	fill: none;
	stroke: var(--sol-accent-ink);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	box-sizing: content-box;
	width: 14px;
	height: 14px;
}

@media (min-width: 900px) {
	.sol-auth__intro {
		padding: 48px 44px;
	}

	.sol-auth__perks {
		display: grid;
	}
}

/* ==========================================================================
   3. Card, tabs and headings
   ========================================================================== */
.sol-auth__card {
	min-width: 0;
	padding: 24px 20px;
	border: 1px solid var(--sol-line);
	border-radius: var(--sol-radius-lg);
	background: var(--sol-surface);
	box-shadow: 0 24px 48px -32px var(--sol-shadow);
}

@media (min-width: 640px) {
	.sol-auth__card {
		padding: 36px;
	}
}

.sol-auth__card--center {
	display: grid;
	justify-items: center;
	text-align: center;
}

/* Tabs only work with the script, so they only show with it. */
.sol-auth__tabs {
	display: none;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px;
	margin-bottom: 28px;
	padding: 4px;
	border: 1px solid var(--sol-line);
	border-radius: 12px;
	background: var(--sol-bg);
}

.sol-js .sol-auth__tabs {
	display: grid;
}

.sol-auth .sol-auth__tab {
	min-height: 44px;
	padding: 0 12px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--sol-muted);
	font: 600 0.9375rem var(--sol-font-sans);
	cursor: pointer;
	transition: background-color var(--sol-fast) ease, color var(--sol-fast) ease;
}

.sol-auth .sol-auth__tab:hover {
	background: transparent;
	color: var(--sol-text);
}

.sol-auth .sol-auth__tab.is-active,
.sol-auth .sol-auth__tab.is-active:hover {
	background: var(--sol-accent);
	color: var(--sol-accent-ink);
}

.sol-auth__heading {
	margin: 0 0 20px;
	font-size: 1.5rem;
	line-height: var(--sol-leading-title);
}

/* Without the script both forms show, so the second one needs room above. */
.sol-auth__panel + .sol-auth__panel {
	margin-top: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--sol-line);
}

.sol-js .sol-auth__panel + .sol-auth__panel {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.sol-auth__note {
	margin: 0 0 20px;
	color: var(--sol-muted);
	font-size: var(--sol-text-sm);
	line-height: 1.55;
}

/* Notices (wrong password and so on) sit on top of the card; their look is in sol-woo-common.css. */
.sol-auth .woocommerce-notices-wrapper:empty {
	display: none;
}

.sol-auth .woocommerce-error,
.sol-auth .woocommerce-message,
.sol-auth .woocommerce-info {
	margin: 0 0 20px;
}

/* ==========================================================================
   4. Fields
   ========================================================================== */
.sol-auth form {
	display: grid;
	gap: 16px;
	margin: 0;
}

.sol-auth .form-row {
	min-width: 0;
	margin: 0;
	padding: 0;
	float: none;
	width: 100%;
}

.sol-auth .form-row > label:not(.woocommerce-form__label-for-checkbox) {
	display: block;
	margin: 0 0 6px;
	color: var(--sol-text);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
}

.sol-auth .form-row .required {
	border: 0;
	color: var(--sol-gold-text);
	text-decoration: none;
}

.sol-auth .input-text {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 11px 14px;
	/* States change --sol-field-line instead of the border itself. */
	border: 1.5px solid var(--sol-field-line, var(--sol-line)) !important;
	border-radius: 10px;
	background-color: var(--sol-bg) !important;
	box-shadow: none;
	color: var(--sol-text) !important;
	/* 16px keeps iOS from zooming the page when a field gets focus. */
	font: 400 1rem/1.4 var(--sol-font-sans);
	transition: border-color var(--sol-fast) ease, box-shadow var(--sol-fast) ease;
}

.sol-auth .input-text:hover {
	--sol-field-line: var(--sol-muted);
}

.sol-auth .input-text:focus {
	--sol-field-line: var(--sol-gold-text);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sol-accent) 28%, transparent);
	outline: 0;
}

.sol-auth .input-text::placeholder {
	color: var(--sol-muted);
	opacity: 0.8;
}

/* Browser autofill paints fields light blue or yellow; keep them on the theme colors. */
.sol-auth .input-text:-webkit-autofill {
	-webkit-text-fill-color: var(--sol-text);
	caret-color: var(--sol-text);
	box-shadow: 0 0 0 1000px var(--sol-bg) inset;
}

.sol-auth .input-text:-webkit-autofill:focus {
	box-shadow: 0 0 0 1000px var(--sol-bg) inset, 0 0 0 3px color-mix(in srgb, var(--sol-accent) 28%, transparent);
}

/* ==========================================================================
   5. Checkbox, buttons, links
   ========================================================================== */
.sol-auth input[type="checkbox"] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 1.5px solid var(--sol-muted);
	border-radius: 6px;
	background: var(--sol-bg);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color var(--sol-fast) ease, background-color var(--sol-fast) ease;
}

.sol-auth input[type="checkbox"]:checked {
	border-color: var(--sol-accent);
	background-color: var(--sol-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314130F' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	background-position: center;
	background-size: 14px;
	background-repeat: no-repeat;
}

.sol-auth input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--sol-focus);
	outline-offset: 2px;
}

.sol-auth .woocommerce-form__label-for-checkbox {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	color: var(--sol-text);
	font-size: var(--sol-text-sm);
	font-weight: 500;
	cursor: pointer;
}

/* "Remember me" on top, the button under it. */
.sol-auth .sol-auth__submit-row {
	display: grid;
	gap: 18px;
	margin-top: 4px;
}

.sol-auth .sol-auth__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: 10px;
	background: var(--sol-accent) !important;
	color: var(--sol-accent-ink) !important;
	font: 700 1rem var(--sol-font-sans);
	cursor: pointer;
	transition: transform var(--sol-normal) var(--sol-ease), box-shadow var(--sol-normal) var(--sol-ease);
}

.sol-auth .sol-auth__submit:hover {
	box-shadow: 0 14px 26px -14px var(--sol-shadow);
	transform: translateY(-2px);
}

.sol-auth .lost_password,
.sol-auth__back {
	margin: 0;
	text-align: center;
}

.sol-auth__back {
	margin-top: 24px;
}

.sol-auth .lost_password a,
.sol-auth__back a {
	color: var(--sol-gold-text);
	font-size: var(--sol-text-sm);
	font-weight: 600;
	text-underline-offset: 3px;
}

.sol-auth .lost_password a:hover,
.sol-auth__back a:hover {
	color: var(--sol-text);
}

/* Privacy text that WooCommerce adds above the register button. */
.sol-auth .woocommerce-privacy-policy-text,
.sol-auth .woocommerce-privacy-policy-text p {
	margin: 0;
	color: var(--sol-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.sol-auth .woocommerce-privacy-policy-text a {
	color: var(--sol-gold-text);
	text-underline-offset: 3px;
}

/* ==========================================================================
   6. Password: show button and strength
   WooCommerce's script wraps password fields in .password-input and adds the
   button; its icon font is not loaded here, so the eye is drawn with a mask.
   ========================================================================== */
.sol-auth .password-input {
	position: relative;
	display: block;
}

.sol-auth .password-input .input-text {
	padding-inline-end: 52px;
}

.sol-auth .show-password-input {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	display: grid;
	place-items: center;
	width: 50px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sol-muted);
	cursor: pointer;
}

.sol-auth .show-password-input::before {
	content: "";
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sol-auth .show-password-input.display-password::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10.1 10.1 0 0112 19C5.6 19 2 12 2 12a18 18 0 015.1-5.9M9.9 5.2A9.7 9.7 0 0112 5c6.4 0 10 7 10 7a18 18 0 01-2.2 3.2M1 1l22 22'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10.1 10.1 0 0112 19C5.6 19 2 12 2 12a18 18 0 015.1-5.9M9.9 5.2A9.7 9.7 0 0112 5c6.4 0 10 7 10 7a18 18 0 01-2.2 3.2M1 1l22 22'/%3E%3C/svg%3E");
}

.sol-auth .show-password-input:hover {
	color: var(--sol-text);
}

/* Strength meter (shown on register when the customer chooses the password). */
.sol-auth .woocommerce-password-strength {
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--sol-surface-alt);
	color: var(--sol-text);
	font-size: 0.8125rem;
	font-weight: 600;
	text-align: left;
}

.sol-auth .woocommerce-password-strength.short,
.sol-auth .woocommerce-password-strength.bad {
	background: color-mix(in srgb, var(--sol-danger) 14%, var(--sol-surface));
}

.sol-auth .woocommerce-password-strength.good {
	background: color-mix(in srgb, var(--sol-accent) 22%, var(--sol-surface));
}

.sol-auth .woocommerce-password-strength.strong {
	background: color-mix(in srgb, var(--sol-success) 16%, var(--sol-surface));
}

.sol-auth .woocommerce-password-hint {
	display: block;
	margin-top: 8px;
	color: var(--sol-muted);
	font-size: 0.8125rem;
}

/* ==========================================================================
   7. Confirmation (reset email sent)
   ========================================================================== */
.sol-auth__icon {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--sol-accent);
	box-shadow: 0 0 0 8px color-mix(in srgb, var(--sol-accent) 22%, transparent);
}

.sol-auth__icon svg {
	fill: none;
	stroke: var(--sol-accent-ink);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
	.sol-auth .sol-auth__submit,
	.sol-auth .sol-auth__tab {
		transition: none;
	}
}
