/**
 * WooCommerce Product Reviews Pro — Auth modal (login / register / OTP)
 *
 * @since 1.17.9
 */

.wprp-auth-modal {
	--wprp-accent: #087b57;
	--wprp-accent-dark: #05563e;
	--wprp-danger: #c73939;
	--wprp-text: #1e2a25;
	--wprp-text-muted: #68756f;
	--wprp-border: #dce7e1;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	direction: rtl;
	/* Inherit the active theme font, including its Persian webfont. */
	font-family: inherit;
	font-size: inherit;
}

.wprp-auth-modal.is-open {
	display: block;
}

.wprp-auth-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(16, 34, 26, .62);
	backdrop-filter: blur(5px);
}

.wprp-auth-modal__dialog {
	position: relative;
	width: min(100% - 32px, 440px);
	margin: 5vh auto;
	background: #fff;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 22px;
	box-shadow: 0 28px 80px rgba(0, 30, 18, .32);
	padding: 42px 30px 28px;
	max-height: 90vh;
	overflow-y: auto;
}

.wprp-auth-modal__dialog:before {
	content: '';
	position: absolute;
	top: 0;
	right: 28px;
	left: 28px;
	height: 4px;
	border-radius: 0 0 99px 99px;
	background: linear-gradient(90deg, #0b8e64, #42be85);
}

.wprp-auth-modal__close {
	position: absolute;
	top: 13px;
	left: 15px;
	right: auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f1f6f3;
	border: 1px solid #e1ebe5;
	font: inherit;
	font-size: 23px;
	line-height: 26px;
	color: var(--wprp-text-muted);
	cursor: pointer;
	padding: 0;
	transition: .18s ease;
}

.wprp-auth-modal__close:hover { background: #e6f2eb !important; color: var(--wprp-accent-dark) !important; transform: rotate(90deg); }

.wprp-auth-title {
	font-family: inherit;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.6;
	margin: 0 0 5px;
	color: var(--wprp-text);
}

.wprp-auth-subtitle {
	font-family: inherit;
	font-size: 13px;
	line-height: 1.9;
	color: var(--wprp-text-muted);
	margin: 0 0 18px;
}

.wprp-field {
	margin-bottom: 16px;
}

.wprp-field label {
	display: block;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--wprp-text);
	margin-bottom: 6px;
}

.wprp-input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--wprp-border) !important;
	border-radius: 12px !important;
	padding: 12px 14px !important;
	font-family: inherit !important;
	font-size: 14px !important;
	line-height: 1.5;
	background: #fbfdfc !important;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
	direction: ltr;
	text-align: right;
}

.wprp-input:focus {
	outline: none;
	border-color: var(--wprp-accent);
	box-shadow: 0 0 0 4px rgba(8, 123, 87, .12);
	background: #fff !important;
}

.wprp-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
	font-size: 13px;
	color: var(--wprp-text);
	margin-bottom: 16px;
	cursor: pointer;
}

.wprp-button {
	display: block;
	width: 100%;
	border: none;
	border-radius: 12px;
	padding: 13px 16px;
	font-family: inherit !important;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	margin-bottom: 10px;
	box-shadow: 0 8px 16px rgba(8, 123, 87, .18);
	transition: background .18s ease, transform .15s ease, box-shadow .18s ease;
}

.wprp-button--primary {
	background: var(--wprp-accent);
	color: #fff;
}

.wprp-button--primary:hover {
	background: var(--wprp-accent-dark);
	color: #fff !important;
	box-shadow: 0 10px 20px rgba(8, 123, 87, .26);
	transform: translateY(-1px);
}

.wprp-button--primary:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.wprp-link {
	display: block;
	width: 100%;
	background: none;
	border: none;
	color: var(--wprp-text-muted);
	font-family: inherit !important;
	font-size: 12.5px;
	text-align: center;
	cursor: pointer;
	padding: 8px 6px 2px;
}

.wprp-link:hover {
	background: #edf6f1 !important;
	color: var(--wprp-accent-dark) !important;
	border-radius: 8px;
}

.wprp-link:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.wprp-error {
	color: var(--wprp-danger);
	font-family: inherit;
	font-size: 12.5px;
	line-height: 1.7;
	margin: -7px 0 13px;
	padding: 0 2px;
	min-height: 0;
}

.wprp-error:empty {
	display: none;
}

.wprp-success-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(0, 183, 120, .12);
	color: var(--wprp-accent-dark);
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 10px auto 16px;
}

.wprp-auth-success-message {
	text-align: center;
	font-size: 14.5px;
	color: var(--wprp-text);
}

.wprp-auth-loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 18px;
}

/* the rule above sets display:flex unconditionally, which otherwise defeats
   the [hidden] attribute entirely (an author-stylesheet "display" always
   wins over the browser's default hidden-attribute styling) - this makes
   sure [hidden] actually hides the overlay */
.wprp-auth-loading[hidden] {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.wprp-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid var(--wprp-border);
	border-top-color: var(--wprp-accent);
	border-radius: 50%;
	animation: wprp-spin 0.7s linear infinite;
}

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

@media (max-width: 480px) {
	.wprp-auth-modal__dialog {
		width: min(100% - 20px, 440px);
		margin: 16px auto;
		min-height: 0;
		border-radius: 18px;
		max-height: calc(100vh - 32px);
		padding: 40px 22px 24px;
	}
}
body.wprp-phone-auth-only .woocommerce form.woocommerce-form-login,
body.wprp-phone-auth-only .woocommerce form.woocommerce-form-register,
body.wprp-phone-auth-only .woocommerce .u-column1,
body.wprp-phone-auth-only .woocommerce .u-column2 {
	display: none !important;
}

.wprp-my-account-auth-trigger {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 620px;
	margin: 24px auto;
	padding: 20px;
	border: 1px solid rgba(0, 183, 120, .22);
	border-radius: 16px;
	background: rgba(0, 183, 120, .06);
	font-family: inherit;
}

.wprp-my-account-auth-trigger .dashicons {
	width: 28px;
	height: 28px;
	color: #00a76f;
	font-size: 28px;
}

.wprp-my-account-auth-trigger strong { display: block; }
.wprp-my-account-auth-trigger p { margin: 4px 0 0; font-size: .9em; }

.wprp-my-account-auth-trigger button {
	margin-inline-start: auto;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: #00a76f;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

@media (max-width: 520px) {
	.wprp-my-account-auth-trigger { align-items: flex-start; flex-wrap: wrap; }
	.wprp-my-account-auth-trigger button { width: 100%; margin-inline-start: 0; }
}
