/* Auth page — theme-aware login page */

/* Hide cart drawer, overlays, and other chrome on the standalone auth page.
   Uses :has() to scope — only when the auth page wrapper is present in the DOM. */
body:has(.c-auth-page-wrap) .cc-cart,
body:has(.c-auth-page-wrap) .cc-cart-overlay,
body:has(.c-auth-page-wrap) #cc-auth-modal {
	display: none !important;
}

.c-auth-page-wrap {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
	justify-content: center;
	padding: var(--wp--preset--spacing--large, 3rem) var(--wp--preset--spacing--medium, 1.5rem);
	background-color: var(--wp--preset--color--tertiary, #f8f7fc);
	font-family: var(--wp--preset--font-family--primary, -apple-system, BlinkMacSystemFont, sans-serif);
	color: var(--wp--preset--color--main, #1E1E26);
}

.c-auth-page__header {
	margin: 0 auto;
	width: 100%;
	max-width: 28rem;
	text-align: center;
}

.c-auth-page__logo {
	display: flex;
	justify-content: center;
}

.c-auth-page__logo img {
	height: auto;
	max-height: 2.5rem;
	width: auto;
	max-width: 10rem;
	-o-object-fit: contain;
	   object-fit: contain;
}

.c-auth-page__title {
	margin-top: 1.5rem;
	text-align: center;
	font-family: var(--wp--preset--font-family--primary, -apple-system, BlinkMacSystemFont, sans-serif);
	font-size: var(--wp--preset--font-size--medium, 1.5rem);
	line-height: var(--wp--custom--line-height--snug, 1.2);
	font-weight: var(--wp--custom--font-weight--semi-bold, 600);
	letter-spacing: -0.025em;
	color: var(--wp--preset--color--main, #1E1E26);
	text-transform: none;
}

.c-auth-page__card-wrap {
	margin-top: 2.5rem;
	margin-left: auto;
	margin-right: auto;
	width: 100%;
	max-width: 30rem;
}

.c-auth-page__card {
	background-color: var(--wp--preset--color--base, #fff);
	padding: 1.5rem;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	border-radius: var(--wp--custom--radius--medium, 10px);
}

@media (min-width: 640px) {
	.c-auth-page__card {
		padding: 3rem;
	}
}

/* Form elements */
.c-auth-page__form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.c-auth-page__field {}

.c-auth-page__label {
	display: block;
	font-size: var(--wp--preset--font-size--x-small, 0.875rem);
	line-height: 1.5;
	font-weight: 500;
	color: var(--wp--preset--color--main, #1E1E26);
}

.c-auth-page__input-wrap {
	margin-top: 0.5rem;
}

.c-auth-page__input {
	display: block;
	width: 100%;
	border-radius: var(--wp--custom--radius--small, 5px);
	background-color: var(--wp--preset--color--base, #fff);
	padding: 0.375rem 0.75rem;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--main, #1E1E26);
	outline: 1px solid var(--wp--preset--color--border-light, #E3E3F0);
	outline-offset: -1px;
	box-sizing: border-box;
}

.c-auth-page__input::-moz-placeholder {
	color: var(--wp--preset--color--secondary, #545473);
	opacity: 0.6;
}

.c-auth-page__input::placeholder {
	color: var(--wp--preset--color--secondary, #545473);
	opacity: 0.6;
}

.c-auth-page__input:focus {
	outline: 2px solid var(--wp--preset--color--primary, #5344F4);
	outline-offset: -2px;
}

/* Password field with toggle */
.c-auth-page__pw-wrap {
	position: relative;
}

.c-auth-page__pw-wrap .c-auth-page__input,
.c-auth-page__pw-wrap .c-auth__input {
	padding-right: 2.75rem;
}

.c-auth-page__pw-toggle {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--wp--preset--color--secondary, #545473);
	border-radius: 0.25rem;
}

.c-auth-page__pw-toggle:hover {
	color: var(--wp--preset--color--main, #1E1E26);
}

/* Spinner animation */
.c-auth-page__spinner {
	animation: auth-spin 0.75s linear infinite;
	flex-shrink: 0;
}

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

@media (min-width: 640px) {
	.c-auth-page__input {
		font-size: 0.875rem;
		line-height: 1.5;
	}
}

/* Row for remember me + forgot password */
.c-auth-page__options {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.c-auth-page__remember {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.c-auth-page__checkbox {
	width: 1rem;
	height: 1rem;
	border-radius: 0.125rem;
	border: 1px solid var(--wp--preset--color--border-light, #E3E3F0);
	background-color: var(--wp--preset--color--base, #fff);
	accent-color: var(--wp--preset--color--primary, #5344F4);
}

.c-auth-page__remember-label {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--main, #1E1E26);
}

.c-auth-page__forgot-link {
	font-size: 0.875rem;
	line-height: 1.5;
	font-weight: 600;
	color: var(--wp--preset--color--primary, #5344F4);
	text-decoration: none;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.c-auth-page__forgot-link:hover {
	opacity: 0.85;
}

/* Submit button */
.c-auth-page__submit {
	display: flex;
	width: 100%;
	justify-content: center;
	gap: 0.5rem;
	border-radius: var(--wp--custom--radius--small, 5px);
	background-color: var(--wp--preset--color--primary, #5344F4);
	padding: 0.375rem 0.75rem;
	font-family: inherit;
	font-size: 0.875rem;
	line-height: 1.5;
	font-weight: 600;
	color: var(--wp--preset--color--base, #fff);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	border: none;
	cursor: pointer;
	height: var(--control-height-md, 46px);
	align-items: center;
}

.c-auth-page__submit:hover {
	opacity: 0.9;
}

.c-auth-page__submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #5344F4);
	outline-offset: 2px;
}

.c-auth-page__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Social auth divider */
.c-auth-page__divider {
	margin-top: 2.5rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.c-auth-page__divider-line {
	flex: 1;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--border-light, #E3E3F0);
}

.c-auth-page__divider-text {
	font-size: 0.875rem;
	line-height: 1.5;
	font-weight: 500;
	white-space: nowrap;
	color: var(--wp--preset--color--secondary, #545473);
}

/* Social buttons */
.c-auth-page__social-grid {
	margin-top: 1.5rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.c-auth-page__social-btn {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	border-radius: var(--wp--custom--radius--small, 5px);
	background-color: var(--wp--preset--color--base, #fff);
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--main, #1E1E26);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--border-light, #E3E3F0);
	border: none;
	cursor: pointer;
	text-decoration: none;
	height: var(--control-height-md, 46px);
}

.c-auth-page__social-btn:hover {
	background-color: var(--wp--preset--color--tertiary, #f8f7fc);
}

.c-auth-page__social-btn svg {
	height: 1.25rem;
	width: 1.25rem;
}

.c-auth-page__social-btn span {
	font-size: 0.875rem;
	line-height: 1.5;
	font-weight: 600;
}

/* Footer text */
.c-auth-page__footer {
	margin-top: 2.5rem;
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--secondary, #545473);
}

.c-auth-page__footer-link {
	font-weight: 600;
	color: var(--wp--preset--color--primary, #5344F4);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.c-auth-page__footer-link:hover {
	opacity: 0.85;
}

/* Field-level validation errors */
.c-auth-page__input--error {
	outline: 2px solid #ef4444;
	outline-offset: -2px;
}

.c-auth-page__field-error {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #dc2626;
}

/* Error message */
.c-auth-page__error {
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--wp--custom--radius--small, 5px);
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	color: #991b1b;
}

/* Success/info message */
.c-auth-page__message {
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.7;
	color: var(--wp--preset--color--secondary, #545473);
}

.c-auth-page__message strong {
	color: var(--wp--preset--color--main, #1E1E26);
}

/* Back link */
.c-auth-page__back-link {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary, #5344F4);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	display: inline;
}

.c-auth-page__back-link:hover {
	opacity: 0.85;
}

/* Name row for signup */
.c-auth-page__name-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

/* Email display chip */
.c-auth-page__email-display {
	font-size: 0.875rem;
	color: var(--wp--preset--color--secondary, #545473);
	margin: 0;
}

/* Google button wrapper override */
.c-auth-page__social-btn--google-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ------------------------------------------------------------------ */
/*  Toast notifications                                                */
/* ------------------------------------------------------------------ */

.c-toast-container {
	pointer-events: none;
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	padding: 1.5rem;
	gap: 0.75rem;
	z-index: 50;
}

@media (min-width: 640px) {
	.c-toast-container {
		align-items: flex-end;
		padding: 1.5rem;
	}
}

.c-toast {
	pointer-events: auto;
	width: 100%;
	max-width: 24rem;
	background-color: var(--wp--preset--color--base, #fff);
	border-radius: var(--wp--custom--radius--medium, 10px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
	outline: 1px solid rgba(0, 0, 0, 0.05);
	padding: 1rem;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	animation: toast-enter 0.3s ease-out forwards;
}

.c-toast--exiting {
	animation: toast-leave 0.15s ease-in forwards;
}

@keyframes toast-enter {
	from {
		opacity: 0;
		transform: translateY(-0.5rem) translateX(0.5rem);
	}
	to {
		opacity: 1;
		transform: translateY(0) translateX(0);
	}
}

@keyframes toast-leave {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

.c-toast__icon {
	flex-shrink: 0;
}

.c-toast__icon-svg {
	width: 1.25rem;
	height: 1.25rem;
}

.c-toast__icon-svg--error {
	color: #ef4444;
}

.c-toast__icon-svg--success {
	color: #22c55e;
}

.c-toast__body {
	flex: 1;
	min-width: 0;
	padding-top: 0.0625rem;
}

.c-toast__message {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.4;
	font-weight: 500;
	color: var(--wp--preset--color--main, #1E1E26);
}

.c-toast__close {
	flex-shrink: 0;
	display: inline-flex;
	border-radius: 0.375rem;
	background: transparent;
	border: none;
	padding: 0.25rem;
	color: var(--wp--preset--color--secondary, #545473);
	cursor: pointer;
}

.c-toast__close:hover {
	color: var(--wp--preset--color--main, #1E1E26);
}

/* Screen reader only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

