/**
 * Webyarpayamak auth forms — inherits theme font on the frontend
 */

:root {
	--wy-primary: #4f8cff;
	--wy-primary-dark: #3b6fd9;
	--wy-secondary: #2dd4bf;
	--wy-secondary-dark: #14b8a6;
	--wy-danger: #f43f5e;
	--wy-text: #1e2433;
	--wy-muted: #738099;
	--wy-btn-text: #ffffff;
	--wy-surface: #ffffff;
	--wy-surface-alt: #f6f8fc;
	--wy-input-bg: #ffffff;
	--wy-border: #e2e8f0;
	--wy-error-text: #be123c;
	--wy-success-text: #047857;
	--wy-error-bg: #fbeaea;
	--wy-info-bg: #e2f3fe;
}

.webyarpayamak-auth-shell,
.webyarpayamak-auth-modal,
.webyarpayamak-vip-gate {
	direction: rtl;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.webyarpayamak-ui {
	color: var(--wy-text);
	font-family: inherit;
}

.webyarpayamak-ui .webyarpayamak-btn,
.webyarpayamak-ui .webyarpayamak-auth-link-btn,
.webyarpayamak-ui .webyarpayamak-auth-field input,
.webyarpayamak-ui .webyarpayamak-auth-field select,
.webyarpayamak-ui .webyarpayamak-auth-field textarea,
.webyarpayamak-ui .webyarpayamak-auth-modal__tab,
.webyarpayamak-ui .webyarpayamak-btn-outline {
	font-family:inherit;
}

.webyarpayamak-admin-wrap {
	direction: rtl;
}

.webyarpayamak-auth-shell {
	max-width: 920px;
	margin: 28px auto;
	padding: 0 16px;
}

.webyarpayamak-auth-card {
	background:
		radial-gradient(700px 280px at 100% -10%, color-mix(in srgb, var(--wy-primary) 18%, transparent), transparent 55%),
		radial-gradient(560px 240px at 0% 100%, color-mix(in srgb, var(--wy-secondary) 12%, transparent), transparent 50%),
		var(--wy-surface);
	border: 1px solid var(--wy-border);
	border-radius: 24px;
	box-shadow: 0 16px 40px color-mix(in srgb, var(--wy-text) 10%, transparent);
	padding: 28px;
	color: var(--wy-text);
	font-family: 'kalameh';
}
code{
font-family: 'kalameh';
}
.webyarpayamak-auth-card--login {
	max-width: 440px;
	margin: 0 auto;
	font-family: 'kalameh';
}

.webyarpayamak-auth-brand .webyarpayamak-panel-brand-mark,
.webyarpayamak-panel-brand-mark {
	width: 46px;
	height: 46px;
	border-radius: 14px;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 20px;
	color: var(--wy-btn-text);
	background: linear-gradient(135deg, var(--wy-primary), var(--wy-secondary));
	box-shadow: 0 10px 24px color-mix(in srgb, var(--wy-primary) 28%, transparent);
	flex-shrink: 0;
}

.webyarpayamak-auth-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 22px;
	flex-wrap: wrap;
}

.webyarpayamak-auth-brand strong { display: block; font-size: 18px; color: var(--wy-text); }
.webyarpayamak-auth-brand span { display: block; color: var(--wy-muted); font-size: 13px; }

.webyarpayamak-auth-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.webyarpayamak-auth-field { display: flex; flex-direction: column; gap: 6px; }
.webyarpayamak-auth-field--full { grid-column: 1 / -1; }

.webyarpayamak-auth-field label,
.webyarpayamak-auth-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wy-muted);
}

.webyarpayamak-auth-field input,
.webyarpayamak-auth-field select,
.webyarpayamak-auth-field textarea {
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid var(--wy-border);
	background: var(--wy-input-bg);
	font-family: inherit;
	font-size: 14px;
	color: var(--wy-text);
}

.webyarpayamak-auth-field select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-left: 40px;
	padding-right: 12px;
	background-color: var(--wy-input-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23738099' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px 16px;
	cursor: pointer;
}

.webyarpayamak-auth-field select::-ms-expand {
	display: none;
}

.webyarpayamak-auth-field textarea { min-height: 90px; resize: vertical; }

.webyarpayamak-auth-field input:focus,
.webyarpayamak-auth-field select:focus,
.webyarpayamak-auth-field textarea:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--wy-primary) 55%, var(--wy-border));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wy-primary) 18%, transparent);
}

.webyarpayamak-auth-field input:disabled {
	background: var(--wy-surface-alt);
	color: var(--wy-muted);
}

.webyarpayamak-auth-radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.webyarpayamak-auth-radio {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid var(--wy-border);
	background: var(--wy-surface-alt);
	cursor: pointer;
	font-size: 14px;
	color: var(--wy-text);
}

.webyarpayamak-auth-remember {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0;
	font-size: 13px;
	color: var(--wy-muted);
}

.webyarpayamak-auth-submit { width: 100%; margin-top: 8px; min-height: 46px; }
.webyarpayamak-auth-messages { min-height: 22px; margin: 8px 0; font-size: 13px; }
.webyarpayamak-auth-messages .is-error { color: var(--wy-error-text); }
.webyarpayamak-auth-messages .is-success { color: var(--wy-success-text); }
.webyarpayamak-auth-footer { margin: 18px 0 0; text-align: center; color: var(--wy-muted); font-size: 14px; }
.webyarpayamak-auth-footer a { color: var(--wy-primary); font-weight: 600; text-decoration: none; }

.webyarpayamak-auth-form .spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid color-mix(in srgb, var(--wy-btn-text) 40%, transparent);
	border-top-color: var(--wy-btn-text);
	border-radius: 50%;
	animation: webyarpayamakAuthSpin .8s linear infinite;
	margin-right: 8px;
}
.webyarpayamak-auth-form.is-loading .spinner { display: inline-block; }
@keyframes webyarpayamakAuthSpin { to { transform: rotate(360deg); } }

.webyarpayamak-btn,
a.webyarpayamak-btn,
button.webyarpayamak-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 24px;
	min-height: 44px;
	border-radius: 14px;
	border: none;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
	transition: all .2s ease;
}
.webyarpayamak-btn.btn-small { padding: 0 16px; min-height: 36px; font-size: 13px; border-radius: 8px; }
.webyarpayamak-btn.btn-primary { background: var(--wy-primary); color: var(--wy-btn-text); }
.webyarpayamak-btn.btn-primary:hover { background: var(--wy-primary-dark); }
.webyarpayamak-btn.btn-secondary { background: var(--wy-secondary); color: var(--wy-btn-text); }
.webyarpayamak-btn.btn-secondary:hover { background: var(--wy-secondary-dark); }
.webyarpayamak-btn.btn-tertiary { background: var(--wy-surface-alt); color: var(--wy-text); border: 1px solid var(--wy-border); }
.webyarpayamak-btn.btn-danger { background: var(--wy-danger); color: var(--wy-btn-text); }
.webyarpayamak-btn:disabled { opacity: .55; cursor: not-allowed; }

.webyarpayamak-message { padding: 15px 20px; margin-bottom: 20px; border-radius: 14px; border: 1px solid transparent; border-right-width: 5px; color: var(--wy-text); }
.webyarpayamak-message-error { background: var(--wy-error-bg); border-color: var(--wy-danger); }
.webyarpayamak-message-info { background: var(--wy-info-bg); border-color: var(--wy-primary); }

.webyarpayamak-theme-dark {
	--wy-error-text: #fda4af;
	--wy-success-text: #6ee7b7;
	--wy-error-bg: color-mix(in srgb, var(--wy-danger) 18%, var(--wy-surface));
	--wy-info-bg: color-mix(in srgb, var(--wy-primary) 16%, var(--wy-surface));
}

.webyarpayamak-profile-avatar-picker {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 16px;
	margin-bottom: 18px;
	border-radius: 18px;
	border: 1px solid var(--wy-border);
	background: linear-gradient(160deg, var(--wy-surface-alt), color-mix(in srgb, var(--wy-primary) 10%, var(--wy-surface)));
}
.webyarpayamak-profile-avatar-preview {
	width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
	border: 3px solid var(--wy-surface); box-shadow: 0 10px 24px color-mix(in srgb, var(--wy-text) 12%, transparent); background: var(--wy-surface-alt);
}
.webyarpayamak-profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.webyarpayamak-profile-avatar-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.webyarpayamak-profile-avatar-controls p { margin: 0; color: var(--wy-muted); font-size: .86rem; }
.webyarpayamak-profile-avatar-remove { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--wy-danger); cursor: pointer; }

.webyarpayamak-auth-forgot-toggle { margin: 14px 0 0; text-align: center; }
.webyarpayamak-auth-link-btn {
	background: none; border: 0; padding: 0; color: var(--wy-primary); font: inherit; cursor: pointer;
	text-decoration: underline; text-underline-offset: 3px;
}
.webyarpayamak-forgot-panel { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--wy-border); }
.webyarpayamak-forgot-hint, .webyarpayamak-field-hint { margin: 0 0 12px; color: var(--wy-muted); font-size: .88rem; line-height: 1.6; }
.webyarpayamak-auth-otp-block {
	padding: 14px; border-radius: 16px;
	background: linear-gradient(160deg, color-mix(in srgb, var(--wy-primary) 12%, var(--wy-surface)), color-mix(in srgb, var(--wy-secondary) 10%, var(--wy-surface)));
	border: 1px solid color-mix(in srgb, var(--wy-primary) 22%, var(--wy-border));
}
.webyarpayamak-auth-otp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.webyarpayamak-btn-outline {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--wy-surface); color: var(--wy-primary); border: 1px solid color-mix(in srgb, var(--wy-primary) 40%, var(--wy-border));
	border-radius: 12px; min-height: 40px; padding: 0 14px; font: inherit; cursor: pointer;
}
.webyarpayamak-login-otp-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin: 4px 0 10px;
}
.webyarpayamak-login-otp-actions .webyarpayamak-auth-link-btn { font-size: 13px; }
.webyarpayamak-reg-back-step { display: inline-block; margin-top: 10px; }
.webyarpayamak-auth-field input[data-jdp],
.webyarpayamak-auth-field input.jalali-datepicker { cursor: pointer; background-color: var(--wy-input-bg); }
.webyarpayamak-otp-cooldown { color: var(--wy-muted); font-size: .85rem; }

.webyarpayamak-gate-support { margin-top: 12px; color: var(--wy-muted); font-size: 14px; line-height: 1.8; }
.webyarpayamak-vip-gate--open { margin: 12px 0; }

.webyarpayamak-vip-gate--locked {
	margin: 20px auto;
	max-width: 560px;
	width: 100%;
	display: block;
	box-sizing: border-box;
}

.webyarpayamak-gate-teaser {
	position: relative;
	overflow: hidden;
	padding: 28px 24px;
	border-radius: 22px;
	border: 1px solid var(--wy-border);
	background:
		radial-gradient(520px 180px at 100% 0%, color-mix(in srgb, var(--wy-primary) 16%, transparent), transparent 55%),
		radial-gradient(420px 160px at 0% 100%, color-mix(in srgb, var(--wy-secondary) 12%, transparent), transparent 50%),
		var(--wy-surface);
	box-shadow: 0 14px 36px color-mix(in srgb, var(--wy-text) 10%, transparent);
	text-align: center;
	color: var(--wy-text);
}

.webyarpayamak-gate-teaser__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 16px;
	display: grid;
	place-items: center;
	color: var(--wy-primary);
	background: linear-gradient(145deg, color-mix(in srgb, var(--wy-primary) 18%, transparent), color-mix(in srgb, var(--wy-secondary) 14%, transparent));
}

.webyarpayamak-gate-teaser__msg {
	margin: 0 0 20px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.8;
	color: var(--wy-text);
}

.webyarpayamak-gate-teaser__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.webyarpayamak-gate-teaser__actions .webyarpayamak-btn {
	min-width: 128px;
}

body.webyarpayamak-modal-open { overflow: hidden; }

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

.webyarpayamak-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.webyarpayamak-auth-modal__overlay {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, #0f172a 55%, transparent);
	backdrop-filter: blur(2px);
}

.webyarpayamak-auth-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 520px);
	max-height: min(92vh, 760px);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 22px 20px 24px;
	border-radius: 22px;
	border: 1px solid var(--wy-border);
	background:
		radial-gradient(520px 200px at 100% -10%, color-mix(in srgb, var(--wy-primary) 14%, transparent), transparent 55%),
		var(--wy-surface);
	box-shadow: 0 24px 60px color-mix(in srgb, #0f172a 35%, transparent);
	box-sizing: border-box;
	color: var(--wy-text);
}

/* Datepicker above auth modal (modal z-index: 100000) */
jdp-container,
jdp-overlay {
	z-index: 100100 !important;
}

.webyarpayamak-auth-modal__close {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 12px;
	background: var(--wy-surface-alt);
	color: var(--wy-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.webyarpayamak-auth-modal__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 4px 0 16px;
	padding-left: 36px;
}

.webyarpayamak-auth-modal__brand strong { display: block; font-size: 17px; color: var(--wy-text); }
.webyarpayamak-auth-modal__brand span { display: block; color: var(--wy-muted); font-size: 13px; }

.webyarpayamak-auth-modal__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding: 4px;
	margin-bottom: 16px;
	border-radius: 14px;
	background: var(--wy-surface-alt);
}

.webyarpayamak-auth-modal__tab {
	border: 0;
	border-radius: 11px;
	min-height: 40px;
	background: transparent;
	color: var(--wy-muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.webyarpayamak-auth-modal__tab.is-active {
	background: var(--wy-surface);
	color: var(--wy-text);
	box-shadow: 0 2px 8px color-mix(in srgb, var(--wy-text) 10%, transparent);
}

.webyarpayamak-auth-modal__panel .webyarpayamak-auth-submit { width: 100%; }

@media (max-width: 720px) {
	.webyarpayamak-auth-grid { grid-template-columns: 1fr; }
	.webyarpayamak-auth-field--full { grid-column: auto; }
	.webyarpayamak-auth-card { padding: 20px 16px; border-radius: 18px; }
	.webyarpayamak-profile-avatar-picker { flex-direction: column; align-items: flex-start; }
	.webyarpayamak-vip-gate--locked { max-width: none; margin: 16px auto; }
	.webyarpayamak-gate-teaser { padding: 22px 16px; border-radius: 18px; }
	.webyarpayamak-gate-teaser__msg { font-size: 15px; }
	.webyarpayamak-gate-teaser__actions { flex-direction: column; }
	.webyarpayamak-gate-teaser__actions .webyarpayamak-btn { width: 100%; min-width: 0; }
	.webyarpayamak-auth-modal { padding: 10px; align-items: flex-end; }
	.webyarpayamak-auth-modal__dialog {
		width: 100%;
		max-height: 90vh;
		border-radius: 20px 20px 12px 12px;
		padding: 18px 14px 20px;
	}
}
