/* Stone Tower Winery account login/register card.
   Used as a modal on normal pages and as a standalone fallback on My Account. */

.stw-login-active,
.stw-login,
.stw-login-modal {
	--stw-bg: #faf9f5;
	--stw-paper: #ffffff;
	--stw-soft: #f7f7f0;
	--stw-travertine: #e1ddc8;
	--stw-gold: #ad9841;
	--stw-gold-soft: #c9b978;
	--stw-gold-tint: rgba(173, 152, 65, 0.12);
	--stw-ink: #1a1a1a;
	--stw-ink-deep: #000000;
	--stw-line: rgba(26, 26, 26, 0.14);
	--stw-line-soft: rgba(26, 26, 26, 0.07);
	--stw-line-strong: rgba(26, 26, 26, 0.32);
	--stw-mute: rgba(26, 26, 26, 0.6);
	--stw-serif: var(--wp--preset--font-family--lora, "Lora", Georgia, "Times New Roman", serif);
	--stw-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.stw-login *,
.stw-login *::before,
.stw-login *::after,
.stw-login-modal *,
.stw-login-modal *::before,
.stw-login-modal *::after {
	box-sizing: border-box;
}

/* Keep the standalone fallback inside the normal site chrome, but remove the
   duplicate My Account heading block above the form. */
.stw-login-active main .wp-block-group.is-vertical:has(> .wp-block-heading),
.stw-login-active main .wp-block-heading.has-text-align-center,
.stw-login-active .my-account-tab-title {
	display: none !important;
}

.stw-login-active .woocommerce-notices-wrapper:empty,
.stw-login-modal .woocommerce-notices-wrapper:empty {
	display: none;
}

.stw-login-active .woocommerce-notices-wrapper,
.stw-login-modal .woocommerce-notices-wrapper {
	width: min(720px, 100%);
	margin: 0 auto 14px;
}

.stw-login-active .woocommerce-notices-wrapper .woocommerce-error,
.stw-login-active .woocommerce-notices-wrapper .woocommerce-info,
.stw-login-active .woocommerce-notices-wrapper .woocommerce-message,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-error,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-info,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-message {
	background: var(--stw-paper);
	border: 1px solid var(--stw-line);
	border-left: 3px solid var(--stw-gold);
	color: var(--stw-ink);
	font-family: var(--stw-serif);
	font-size: 14px;
	line-height: 1.5;
	padding: 13px 15px;
	margin: 0 0 10px;
	list-style: none;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.stw-login-active .woocommerce-notices-wrapper .woocommerce-error,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-error {
	border-left-color: #8a2a2a;
	color: #8a2a2a;
}

.stw-login-active .woocommerce-notices-wrapper .woocommerce-error::before,
.stw-login-active .woocommerce-notices-wrapper .woocommerce-info::before,
.stw-login-active .woocommerce-notices-wrapper .woocommerce-message::before,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-error::before,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-info::before,
.stw-login-modal .woocommerce-notices-wrapper .woocommerce-message::before {
	display: none;
}

.stw-login-active .wp-block-group.alignwide:has(.stw-login),
.stw-login-active .wp-block-group:has(> .woocommerce > .stw-login),
.stw-login-active .wp-block-group:has(.stw-login) {
	max-width: none !important;
	width: 100% !important;
}

.stw-login-active .woocommerce,
.stw-login-active main .woocommerce {
	width: 100% !important;
	max-width: none !important;
}

/* Modal shell */
body.stw-login-modal-open {
	overflow: hidden;
}

.stw-login-modal[hidden] {
	display: none !important;
}

.stw-login-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: clamp(16px, 4vw, 44px);
}

.stw-login-modal__scrim {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.52);
}

.stw-login-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(760px, calc(100vw - 32px));
	max-height: min(88vh, 860px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	outline: none;
	background: var(--stw-paper);
	box-shadow: 0 34px 72px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.14);
}

.stw-login-modal.is-open .stw-login-modal__scrim {
	animation: stw-login-modal-fade .16s ease-out both;
}

.stw-login-modal.is-open .stw-login-modal__dialog {
	animation: stw-login-dialog-in .18s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes stw-login-modal-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes stw-login-dialog-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.stw-login-modal.is-open .stw-login-modal__scrim,
	.stw-login-modal.is-open .stw-login-modal__dialog {
		animation: none;
	}
}

.stw-login-modal__close {
	position: absolute;
	top: 10px;
	right: auto;
	left: 10px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--stw-ink-deep);
	cursor: pointer;
	box-shadow: none;
	-webkit-tap-highlight-color: transparent;
	transition: color .2s ease, opacity .2s ease;
}

.stw-login-modal__close svg {
	display: block;
	width: 20px;
	height: 20px;
}

.stw-login-modal__close:hover,
.stw-login-modal__close:focus-visible {
	color: var(--stw-gold);
	background: transparent;
	outline: none;
}

.stw-login-modal__close:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 2px;
}

/* Card layout */
.stw-login {
	position: relative;
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(38px, 7vw, 86px) clamp(16px, 4vw, 56px);
	background: transparent;
	color: var(--stw-ink);
	font-family: var(--stw-serif);
}

.stw-login-modal .stw-login {
	padding: 0;
}

.stw-login__panel {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
}

.stw-login__body {
	position: relative;
	width: min(720px, 100%);
	margin: 0 auto;
	background: var(--stw-paper);
	border: 1px solid var(--stw-line);
	padding: clamp(34px, 5vw, 56px) clamp(24px, 7vw, 64px) clamp(30px, 5vw, 48px);
	box-shadow: 0 24px 54px rgba(0, 0, 0, 0.08);
}

.stw-login-modal .stw-login__body {
	width: 100%;
	border: 0;
	box-shadow: none;
	padding-top: clamp(42px, 6vw, 58px);
}

.stw-login__tabs {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin: 0 auto 20px;
	padding: 4px;
	background: var(--stw-soft);
	border: 1px solid var(--stw-line);
	width: fit-content;
}

.stw-login__tab {
	border: 0;
	background: transparent;
	color: var(--stw-mute);
	font-family: var(--stw-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 10px 18px;
	cursor: pointer;
	transition: background .25s ease, color .25s ease;
}

.stw-login__tab:hover {
	color: var(--stw-ink-deep);
}

.stw-login__tab[aria-selected="true"] {
	background: var(--stw-ink-deep);
	color: var(--stw-paper);
}

.stw-login__pane[hidden] {
	display: none;
}

.stw-login__pane {
	animation: stw-login-pane-in .18s ease-out both;
}

.stw-login[data-stw-view="success"] .stw-login__tabs {
	display: none;
}

@keyframes stw-login-pane-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.stw-login__eyebrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-family: var(--stw-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--stw-gold);
	margin-bottom: 14px;
	text-align: center;
}

.stw-login__eyebrow-dot,
.stw-login__eyebrow-dash {
	width: 28px;
	height: 1px;
	background: var(--stw-line-strong);
	display: inline-block;
	border-radius: 0;
}

.stw-login__display {
	font-family: var(--stw-serif);
	font-weight: 500;
	font-size: clamp(34px, 4.4vw, 48px);
	line-height: 1.08;
	letter-spacing: 0;
	color: var(--stw-ink-deep);
	margin: 0 0 8px;
	text-align: center;
	text-wrap: balance;
}

.stw-login__display em {
	font-style: italic;
	color: var(--stw-gold);
	font-weight: 500;
}

.stw-login__lede {
	font-family: var(--stw-serif);
	font-weight: 500;
	font-size: 17px;
	line-height: 1.55;
	color: var(--stw-mute);
	max-width: 54ch;
	margin: 8px auto 22px;
	text-align: center;
	text-wrap: balance;
}

.stw-login__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 100%;
	margin: 0;
}

.stw-login__form.is-shake {
	animation: stw-login-shake .42s ease;
}

@keyframes stw-login-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-6px); }
	50% { transform: translateX(6px); }
	75% { transform: translateX(-3px); }
}

.stw-field {
	display: block;
	position: relative;
}

.stw-field__label {
	display: block;
	font-family: var(--stw-sans);
	font-size: 10.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--stw-mute);
	margin-bottom: 8px;
	font-weight: 600;
	text-align: left;
	transition: color .25s ease;
}

.stw-field.is-active .stw-field__label {
	color: var(--stw-gold);
}

.stw-field.is-error .stw-field__label {
	color: #8a2a2a;
}

.stw-field__row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.stw-login .password-input {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	position: relative;
	width: 100%;
}

.stw-login .password-input .show-password-input {
	display: none !important;
}

.stw-field__input,
.stw-login .stw-field__input.woocommerce-Input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	background: transparent;
	border: 0;
	outline: 0;
	font-family: var(--stw-serif);
	font-weight: 500;
	font-size: 21px;
	color: var(--stw-ink);
	padding: 4px 0 10px;
	letter-spacing: 0;
	box-shadow: none;
	border-radius: 0;
	line-height: 1.25;
}

.stw-field__input::placeholder {
	color: var(--stw-mute);
}

.stw-field__rule {
	display: block;
	height: 1px;
	background: var(--stw-line);
	position: relative;
}

.stw-field__rule::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 1px;
	width: 100%;
	background: var(--stw-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .35s cubic-bezier(.2,.7,.2,1);
}

.stw-field.is-active .stw-field__rule::after,
.stw-field.is-error .stw-field__rule::after {
	transform: scaleX(1);
}

.stw-field.is-error .stw-field__rule::after {
	background: #8a2a2a;
}

.stw-login__name-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.stw-field__eye {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--stw-mute);
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color .2s ease;
}

.stw-field__eye svg {
	display: block;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
}

.stw-field__eye:hover,
.stw-field__eye:focus-visible {
	color: var(--stw-gold);
	outline: none;
}

.stw-field__eye .stw-field__eye-off {
	display: none;
}

.stw-field__eye[aria-pressed="true"] .stw-field__eye-on {
	display: none;
}

.stw-field__eye[aria-pressed="true"] .stw-field__eye-off {
	display: block;
}

.stw-login__row-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: -4px;
}

.stw-login__quiet-link {
	font-family: var(--stw-serif);
	font-size: 14px;
	color: var(--stw-gold);
	text-decoration: none;
	border-bottom: 1px solid var(--stw-line);
	padding-bottom: 2px;
	transition: color .2s ease, border-color .2s ease;
}

.stw-login__quiet-link:hover {
	color: var(--stw-ink-deep);
	border-color: var(--stw-gold);
}

.stw-check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	font-family: var(--stw-serif);
}

.stw-check__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.stw-check__box {
	width: 16px;
	height: 16px;
	border: 1px solid var(--stw-line-strong);
	background: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, border-color .2s ease;
	color: var(--stw-paper);
	flex-shrink: 0;
}

.stw-check__box svg {
	opacity: 0;
	transition: opacity .15s ease;
}

.stw-check__input:checked + .stw-check__box {
	background: var(--stw-gold);
	border-color: var(--stw-gold);
}

.stw-check__input:checked + .stw-check__box svg {
	opacity: 1;
}

.stw-check__input:focus-visible + .stw-check__box {
	outline: 2px solid var(--stw-gold);
	outline-offset: 2px;
}

.stw-check__label {
	font-family: var(--stw-serif);
	font-size: 14px;
	color: var(--stw-ink);
	letter-spacing: 0;
}

.stw-login__submit,
.stw-login .stw-login__submit.woocommerce-button,
.stw-login .stw-login__submit.woocommerce-Button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 56px;
	padding: 0 28px;
	background: var(--stw-ink-deep);
	color: var(--stw-paper);
	border: 0;
	border-radius: 0;
	font-family: var(--stw-sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	cursor: pointer;
	overflow: hidden;
	transition: background .35s ease, transform .25s ease;
	width: 100%;
	box-shadow: none;
	text-decoration: none;
}

.stw-login__submit::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--stw-gold);
	transform: translateY(100%);
	transition: transform .35s cubic-bezier(.2,.7,.2,1);
	z-index: 0;
}

.stw-login__submit:hover::before,
.stw-login__submit:focus-visible::before {
	transform: translateY(0);
}

.stw-login__submit-label,
.stw-login__submit-arrow {
	position: relative;
	z-index: 1;
}

.stw-login__submit-arrow {
	display: inline-flex;
	transition: transform .3s ease;
}

.stw-login__submit:hover .stw-login__submit-arrow,
.stw-login__submit:focus-visible .stw-login__submit-arrow {
	transform: translateX(4px);
}

.stw-login__submit:disabled {
	opacity: 0.75;
	cursor: progress;
}

.stw-login__switch {
	margin: 20px 0 0;
	font-family: var(--stw-serif);
	font-size: 16px;
	color: var(--stw-mute);
	text-align: center;
}

.stw-login__switch--subtle {
	margin-top: 10px;
	font-size: 15px;
}

.stw-login__switch--field-note {
	margin: -6px 0 0;
	font-size: 15px;
	text-align: left;
}

.stw-login__switch a {
	color: var(--stw-ink-deep);
	font-style: italic;
	text-decoration: none;
	border-bottom: 1px solid var(--stw-line-strong);
	padding-bottom: 2px;
	margin-left: 6px;
	transition: border-color .2s ease;
}

.stw-login__switch a:hover {
	border-color: var(--stw-ink-deep);
}

.stw-login__hint {
	font-family: var(--stw-serif);
	font-size: 14px;
	line-height: 1.5;
	color: var(--stw-mute);
	margin: 0;
	padding: 0;
	text-align: left;
}

.stw-login__notices,
.stw-login__notices .woocommerce-notices-wrapper {
	width: 100%;
	margin: 0;
}

.stw-login__notices .woocommerce-error,
.stw-login__notices .woocommerce-info,
.stw-login__notices .woocommerce-message {
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	background: rgba(138, 42, 42, 0.06);
	border: 1px solid rgba(138, 42, 42, 0.22);
	box-shadow: none;
	text-align: center;
}

.stw-login__notices .woocommerce-info,
.stw-login__notices .woocommerce-message {
	background: var(--stw-soft);
	border-color: var(--stw-line);
}

.stw-login__pane--success {
	width: min(560px, 100%);
	margin: 0 auto;
	text-align: center;
}

.stw-login__success-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0 auto 18px;
	border: 1px solid var(--stw-gold);
	color: var(--stw-gold);
}

.stw-login__success-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 8px;
}

.stw-login__success-actions .stw-login__submit {
	flex: 1 1 220px;
	width: auto;
}

.stw-login__submit--secondary {
	background: transparent;
	border: 1px solid var(--stw-line-strong);
	color: var(--stw-ink-deep);
}

.stw-login__submit--secondary:hover,
.stw-login__submit--secondary:focus-visible {
	color: var(--stw-paper);
}

.stw-login__form .mailchimp-newsletter {
	margin: 4px 0;
	font-family: var(--stw-serif);
	font-size: 14px;
	color: var(--stw-mute);
}

.stw-login__form .mailchimp-newsletter label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--stw-serif);
	font-size: 14px;
	line-height: 1.4;
	color: var(--stw-mute);
}

.stw-login__form .mailchimp-newsletter input[type="checkbox"] {
	width: 14px;
	height: 14px;
	accent-color: var(--stw-gold);
}

.stw-login__form #mailchimp-gdpr-fields {
	display: none !important;
}

.stw-login__form .woocommerce-privacy-policy-text {
	margin: 0;
	font-family: var(--stw-serif);
	font-size: 13px;
	line-height: 1.5;
	color: var(--stw-mute);
}

.stw-login__form .woocommerce-privacy-policy-text p {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

.stw-login__form .woocommerce-privacy-policy-text a {
	color: var(--stw-gold);
	border-bottom: 1px solid var(--stw-line);
}

.stw-login__form .woocommerce-privacy-policy-text a:hover {
	color: var(--stw-ink-deep);
	border-color: var(--stw-gold);
}

.stw-login__form wc-order-attribution-inputs,
.stw-login__form .clear {
	display: none;
}

@media (max-width: 860px) {
	.stw-login {
		padding: 34px 16px 48px;
	}

	.stw-login__body {
		padding: 38px 28px 34px;
	}

	.stw-login-modal {
		padding: 12px;
	}

	.stw-login-modal__dialog {
		width: calc(100vw - 24px);
		max-height: calc(100dvh - 24px);
	}
}

@media (max-width: 520px) {
	.stw-login__tabs {
		width: 100%;
	}

	.stw-login__tab {
		flex: 1 1 0;
		padding-left: 10px;
		padding-right: 10px;
		font-size: 10px;
	}

	.stw-login__row-between {
		flex-wrap: wrap;
	}

	.stw-login__name-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.stw-login__display {
		font-size: 32px;
	}

	.stw-login__lede {
		font-size: 16px;
	}
}
