/**
 * Petopia signup / verify / coupon panels (Figma signup redesign).
 * Login stage styles stay in login-redesign.css.
 */

body.petopia-redesign-v1 .petopia-login {
	--ps-blue: #003bd1;
	--ps-blue-soft: #e8f0ff;
	--ps-blue-border: #b7d0ff;
	--ps-blue-muted: #7eb3ff;
	--ps-text: #1a2b5c;
	--ps-muted: #7a8499;
	--ps-line: #dce3f0;
	--ps-pink: #ff3b81;
	position: relative;
	overflow: visible;
}

body.petopia-redesign-v1 .petopia-login--onboarding {
	max-width: 380px;
	padding: 20px 18px 36px;
	text-align: right;
}

body.petopia-redesign-v1 .petopia-login[data-petopia-view="signup"],
body.petopia-redesign-v1 .petopia-login[data-petopia-view="verify"],
body.petopia-redesign-v1 .petopia-login[data-petopia-view="coupon"] {
	max-width: 380px;
}

/* Hide Digits chrome while custom panels show (Digits still in DOM for OTP). */
body.petopia-redesign-v1 .petopia-login--onboarding .petopia-login__stage {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	padding: 0 !important;
	margin: -1px !important;
}

/* —— Panels —— */
body.petopia-redesign-v1 .petopia-signup-panel {
	position: relative;
	display: none;
	width: 100%;
	padding: 8px 4px 0;
	direction: rtl;
	text-align: center;
	z-index: 1;
}

body.petopia-redesign-v1 .petopia-signup-panel.is-active,
body.petopia-redesign-v1 .petopia-signup-panel:not([hidden]) {
	display: block;
}

body.petopia-redesign-v1 .petopia-signup-panel[hidden] {
	display: none !important;
}

/* Background paws — match design angle / opacity / crop */
body.petopia-redesign-v1 .petopia-signup__paw {
	position: absolute;
	pointer-events: none;
	z-index: 0;
	line-height: 0;
	opacity: 0.1;
}

body.petopia-redesign-v1 .petopia-signup__paw img {
	display: block;
	width: 160px;
	height: auto;
}

body.petopia-redesign-v1 .petopia-signup__paw--tr {
	top: -28px;
	right: -42px;
	transform: rotate(-38deg);
	opacity: 0.12;
}

body.petopia-redesign-v1 .petopia-signup__paw--tr img {
	width: 180px;
}

body.petopia-redesign-v1 .petopia-signup__paw--bl {
	bottom: 48px;
	left: -48px;
	transform: rotate(148deg);
	opacity: 0.1;
}

body.petopia-redesign-v1 .petopia-signup__paw--bl img {
	width: 150px;
}

body.petopia-redesign-v1 .petopia-signup-panel--coupon .petopia-signup__paw--bl {
	bottom: 72px;
}

/* Digits “توجه” toast after failed login → signup handoff */
body.petopia-redesign-v1:has(.petopia-login--onboarding) .dig_popmessage,
body.petopia-redesign-v1:has(.petopia-login-side--onboarding) .dig_popmessage,
body.petopia-redesign-v1 .petopia-login--onboarding .dig_popmessage {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Woodmart side-panel “بستن” — hidden during onboarding */
body.petopia-redesign-v1 .petopia-login-side--onboarding .close-side-widget,
body.petopia-redesign-v1 .petopia-login-side--onboarding .petopia-login-side__heading {
	display: none !important;
}

/* Side panel scroll */
body.petopia-redesign-v1 .petopia-login-side {
	overflow-x: hidden !important;
	overflow-y: auto !important;
}

body.petopia-redesign-v1 .petopia-login--onboarding {
	overflow: visible;
}

body.petopia-redesign-v1 .petopia-signup-field--birthday {
	position: relative;
	z-index: 6;
	overflow: visible;
}

/* Birthday trigger (replaces kama text input) */
body.petopia-redesign-v1 .petopia-birthday-trigger {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px 0 44px;
	border: 1px solid var(--ps-line);
	border-radius: 12px;
	background: #fff;
	color: var(--ps-text);
	font-size: 0.95rem;
	font-family: inherit;
	text-align: right;
	direction: rtl;
	cursor: pointer;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

body.petopia-redesign-v1 .petopia-birthday-trigger:hover,
body.petopia-redesign-v1 .petopia-birthday-trigger[aria-expanded="true"] {
	border-color: var(--ps-blue);
	box-shadow: 0 0 0 3px rgba(0, 59, 209, 0.08);
}

body.petopia-redesign-v1 .petopia-birthday-trigger .petopia-signup-input__icon {
	position: absolute;
	left: 12px;
	right: auto;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
}

body.petopia-redesign-v1 .petopia-birthday-trigger__text {
	flex: 1;
	color: #a8b0c0;
}

body.petopia-redesign-v1 .petopia-birthday-trigger__text.is-set,
body.petopia-redesign-v1 .petopia-birthday-trigger.has-value .petopia-birthday-trigger__text {
	color: var(--ps-text);
}

/* Inline RTL Jalali calendar */
body.petopia-redesign-v1 .petopia-jcal {
	direction: rtl;
	margin-top: 10px;
	padding: 12px;
	border: 1px solid var(--ps-line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(26, 43, 92, 0.12);
	box-sizing: border-box;
}

body.petopia-redesign-v1 .petopia-jcal__nav {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
}

body.petopia-redesign-v1 .petopia-jcal__navBtn {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ps-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ps-text);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}

body.petopia-redesign-v1 .petopia-jcal__navBtn:hover {
	border-color: var(--ps-blue);
	color: var(--ps-blue);
}

body.petopia-redesign-v1 .petopia-jcal__select {
	flex: 1 1 auto;
	min-width: 0;
	height: 34px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid var(--ps-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ps-text);
	font-size: 0.85rem;
	font-family: inherit;
	direction: rtl;
	text-align: right;
}

body.petopia-redesign-v1 .petopia-jcal__weekdays,
body.petopia-redesign-v1 .petopia-jcal__days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	direction: rtl;
}

body.petopia-redesign-v1 .petopia-jcal__weekdays {
	margin-bottom: 6px;
}

body.petopia-redesign-v1 .petopia-jcal__weekdays span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ps-muted);
}

body.petopia-redesign-v1 .petopia-jcal__empty {
	min-height: 34px;
}

body.petopia-redesign-v1 .petopia-jcal__day {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 34px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: transparent !important;
	background-color: transparent !important;
	color: var(--ps-text) !important;
	font-size: 0.9rem !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	line-height: 1 !important;
	box-shadow: none !important;
	transform: none !important;
	cursor: pointer !important;
	pointer-events: auto !important;
}

body.petopia-redesign-v1 .petopia-jcal__day:hover {
	background: var(--ps-blue-soft) !important;
	background-color: var(--ps-blue-soft) !important;
	color: var(--ps-blue) !important;
}

body.petopia-redesign-v1 .petopia-jcal__day.is-today {
	box-shadow: inset 0 0 0 1px var(--ps-blue-border) !important;
}

body.petopia-redesign-v1 .petopia-jcal__day.is-selected,
body.petopia-redesign-v1 .petopia-jcal__day.is-selected:hover {
	background: var(--ps-blue) !important;
	background-color: var(--ps-blue) !important;
	color: #fff !important;
	box-shadow: none !important;
}

body.petopia-redesign-v1 .petopia-signup__logo {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	margin: 12px 0 18px;
}

body.petopia-redesign-v1 .petopia-signup__logo img {
	width: 84px;
	height: auto;
	display: block;
}

body.petopia-redesign-v1 .petopia-signup__title {
	position: relative;
	z-index: 1;
	margin: 0 0 8px;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--ps-text);
	line-height: 1.4;
}

body.petopia-redesign-v1 .petopia-signup__subtitle {
	position: relative;
	z-index: 1;
	margin: 0 0 22px;
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--ps-muted);
	line-height: 1.7;
}

body.petopia-redesign-v1 .petopia-signup__hl {
	color: var(--ps-blue);
	font-weight: 700;
}

/* —— Form —— */
body.petopia-redesign-v1 .petopia-signup-form,
body.petopia-redesign-v1 .petopia-signup-panel--verify,
body.petopia-redesign-v1 .petopia-signup-panel--coupon {
	position: relative;
	z-index: 1;
}

body.petopia-redesign-v1 .petopia-signup-field {
	margin-bottom: 14px;
	text-align: right;
}

body.petopia-redesign-v1 .petopia-signup-label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ps-text);
}

body.petopia-redesign-v1 .petopia-signup-label .req {
	color: #e53935;
	margin-right: 2px;
}

body.petopia-redesign-v1 .petopia-signup-control,
body.petopia-redesign-v1 .petopia-signup-input input {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--ps-line);
	border-radius: 12px;
	background: #fff;
	font-size: 0.95rem;
	color: var(--ps-text);
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.petopia-redesign-v1 .petopia-signup-control:focus,
body.petopia-redesign-v1 .petopia-signup-input input:focus {
	border-color: var(--ps-blue);
	box-shadow: 0 0 0 3px rgba(0, 59, 209, 0.08);
}

body.petopia-redesign-v1 .petopia-signup-control::placeholder,
body.petopia-redesign-v1 .petopia-signup-input input::placeholder {
	color: #a8b0c0;
}

body.petopia-redesign-v1 .petopia-signup-input.has-icon {
	position: relative;
}

body.petopia-redesign-v1 .petopia-signup-input.has-icon input {
	padding-left: 44px;
}

body.petopia-redesign-v1 .petopia-signup-input__icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	pointer-events: none;
}

/* Pet type toggle */
body.petopia-redesign-v1 .petopia-pet-type {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var(--ps-line);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

body.petopia-redesign-v1 .petopia-pet-type__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-left: 1px solid var(--ps-line);
	background: #fff;
	color: #8a93a8;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

body.petopia-redesign-v1 .petopia-pet-type__btn:last-child {
	border-left: 0;
}

body.petopia-redesign-v1 .petopia-pet-type__btn img {
	width: 26px;
	height: auto;
	opacity: 0.55;
	filter: grayscale(0.2);
}

body.petopia-redesign-v1 .petopia-pet-type__btn.is-active {
	background: var(--ps-blue-soft);
	color: var(--ps-blue);
	box-shadow: inset 0 0 0 1px var(--ps-blue-border);
}

body.petopia-redesign-v1 .petopia-pet-type__btn.is-active img {
	opacity: 1;
	filter: none;
}

/* Primary CTA */
body.petopia-redesign-v1 .petopia-signup-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 52px;
	margin-top: 10px;
	padding: 0 16px;
	border: 0;
	border-radius: 14px;
	background: var(--ps-blue);
	color: #fff !important;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none !important;
	transition: filter 0.15s ease, transform 0.1s ease;
}

body.petopia-redesign-v1 .petopia-signup-submit:hover {
	filter: brightness(1.05);
	color: #fff !important;
}

body.petopia-redesign-v1 .petopia-signup-submit.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

body.petopia-redesign-v1 .petopia-signup-submit img {
	width: 22px;
	height: 22px;
	filter: brightness(0) invert(1);
}

body.petopia-redesign-v1 .petopia-signup-error {
	margin: 0 0 8px;
	padding: 8px 10px;
	border-radius: 10px;
	background: #fff1f0;
	color: #c62828;
	font-size: 0.85rem;
	text-align: right;
}

/* Verify */
body.petopia-redesign-v1 .petopia-verify-phone {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--ps-blue-soft);
	color: var(--ps-text);
	font-size: 0.9rem;
}

body.petopia-redesign-v1 .petopia-verify-phone__label {
	font-weight: 600;
}

body.petopia-redesign-v1 .petopia-verify-phone__value {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	direction: ltr;
	font-weight: 600;
	color: var(--ps-blue);
}

body.petopia-redesign-v1 .petopia-otp {
	display: grid !important;
	grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	gap: 8px !important;
	direction: ltr;
	width: 100% !important;
	margin: 0 0 4px !important;
	visibility: visible !important;
}

body.petopia-redesign-v1 .petopia-otp__digit,
body.petopia-redesign-v1 .petopia-login .petopia-otp__digit,
body.petopia-redesign-v1 .petopia-login input.petopia-otp__digit[type="text"] {
	display: block !important;
	box-sizing: border-box !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	height: 48px !important;
	min-height: 48px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1.5px solid var(--ps-blue-border) !important;
	border-radius: 10px !important;
	text-align: center !important;
	font-size: 1.15rem !important;
	font-weight: 700 !important;
	color: var(--ps-text) !important;
	background: #fff !important;
	box-shadow: none !important;
	outline: none !important;
	visibility: visible !important;
	opacity: 1 !important;
	caret-color: var(--ps-blue);
}

body.petopia-redesign-v1 .petopia-otp__digit:focus,
body.petopia-redesign-v1 .petopia-login input.petopia-otp__digit[type="text"]:focus {
	border-color: var(--ps-blue) !important;
	box-shadow: 0 0 0 3px rgba(0, 59, 209, 0.1) !important;
}

body.petopia-redesign-v1 .petopia-verify-resend {
	margin: 14px 0 8px;
	font-size: 0.85rem;
	color: var(--ps-muted);
	text-align: center;
}

body.petopia-redesign-v1 .petopia-verify-resend__btn {
	border: 0;
	background: transparent;
	color: var(--ps-blue);
	font-weight: 700;
	cursor: pointer;
	padding: 0 4px;
}

body.petopia-redesign-v1 .petopia-verify-resend__btn:disabled {
	opacity: 0.45;
	cursor: default;
}

body.petopia-redesign-v1 .petopia-verify-resend__timer {
	color: var(--ps-muted);
	margin-right: 4px;
}

/* Coupon */
body.petopia-redesign-v1 .petopia-coupon-code {
	display: grid;
	grid-template-columns: 36px 1fr auto;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	padding: 14px 12px;
	border: 1.5px dashed var(--ps-blue-border);
	border-radius: 14px;
	background: var(--ps-blue-soft);
}

body.petopia-redesign-v1 .petopia-coupon-code__tag {
	width: 28px;
	height: 28px;
}

body.petopia-redesign-v1 .petopia-coupon-code__value {
	font-family: dynapuff, "DynaPuff", dana, sans-serif;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--ps-blue);
	text-align: center;
	direction: ltr;
}

body.petopia-redesign-v1 .petopia-coupon-code__copy {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 52px;
	padding: 4px 8px;
	margin: 0;
	border: 0;
	border-right: 1.5px dashed var(--ps-blue-border);
	background: transparent;
	color: var(--ps-blue);
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
}

body.petopia-redesign-v1 .petopia-coupon-code__copy img {
	width: 20px;
	height: 20px;
}

body.petopia-redesign-v1 .petopia-coupon-benefits {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 18px;
	padding: 14px;
	border-radius: 14px;
	background: var(--ps-blue-soft);
	text-align: right;
}

body.petopia-redesign-v1 .petopia-coupon-benefits img {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

body.petopia-redesign-v1 .petopia-coupon-benefits__title {
	margin: 0 0 6px;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ps-text);
}

body.petopia-redesign-v1 .petopia-coupon-benefits ul {
	margin: 0;
	padding: 0 14px 0 0;
	list-style: disc;
	color: var(--ps-muted);
	font-size: 0.88rem;
}

body.petopia-redesign-v1 .petopia-signup-back {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ps-blue);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
}

/* Side panel: slightly tighter */
body.petopia-redesign-v1 .petopia-login--side.petopia-login--onboarding {
	max-width: 100%;
	padding-inline: 12px;
}

body.petopia-redesign-v1 .petopia-login--side .petopia-signup__paw--tr {
	right: -56px;
}

body.petopia-redesign-v1 .petopia-login--side .petopia-signup__paw--bl {
	left: -56px;
}

/* Account edit pet fields spacing */
.petopia-account-pet-fields {
	margin-top: 8px;
}

/* Digits loader stuck over signup/coupon — kill it while our flow owns the UI */
body.petopia-hide-digits-loader .dig_load_overlay {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}
