/* ورود با موبایل — هنرکده عسل */
.apl-card, .apl-modal {
	--apl-pink: #F48FB1;
	--apl-purple: #9B7ED6;
	--apl-yellow: #FFD166;
	--apl-mint: #A7D8C9;
	--apl-blue: #A7D8F0;
	--apl-pink-d: color-mix(in srgb, var(--apl-pink) 80%, #4a0d2a);
	--apl-purple-d: color-mix(in srgb, var(--apl-purple) 82%, #1d0f45);
	--apl-ink: #3b2f4f;
	--apl-muted: #7d7390;
	--apl-line: #eadff5;
}

.apl-card, .apl-card * { box-sizing: border-box; }
.apl-card [hidden] { display: none !important; }

.apl-card {
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	background: #fff;
	border-radius: 28px;
	overflow: hidden;
	color: var(--apl-ink);
	font-family: inherit;
	line-height: 1.7;
	text-align: right;
	box-shadow:
		0 24px 60px -24px color-mix(in srgb, var(--apl-purple) 60%, transparent),
		0 10px 26px -14px color-mix(in srgb, var(--apl-pink) 70%, transparent);
	position: relative;
}

.apl-inline, .apl-myaccount { padding: 12px 0; }

/* ---------- Hero ---------- */
.apl-hero {
	position: relative;
	overflow: hidden;
	text-align: center;
	color: #fff;
	padding: 34px 28px 58px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--apl-pink) 86%, #6b1b45) 0%, var(--apl-purple) 100%);
}
.apl-hero::after {
	content: "";
	position: absolute;
	left: -10%; right: -10%; bottom: -1px;
	height: 36px;
	background: #fff;
	border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.apl-bubble { position: absolute; border-radius: 50%; pointer-events: none; }
.apl-b1 { width: 120px; height: 120px; top: -40px; right: -30px; background: rgba(255,255,255,.14); }
.apl-b2 { width: 70px; height: 70px; bottom: 20px; left: -18px; background: color-mix(in srgb, var(--apl-yellow) 55%, transparent); }
.apl-b3 { width: 26px; height: 26px; top: 30px; left: 38px; background: color-mix(in srgb, var(--apl-mint) 80%, transparent); animation: aplFloat 5s ease-in-out infinite; }
.apl-b4 { width: 16px; height: 16px; top: 78px; right: 46px; background: color-mix(in srgb, var(--apl-blue) 85%, transparent); animation: aplFloat 4s ease-in-out infinite reverse; }

.apl-logo {
	position: relative;
	width: 76px; height: 76px;
	margin: 0 auto 14px;
	border-radius: 24px;
	background: #fff;
	color: var(--apl-purple-d);
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 12px 24px -8px rgba(60, 20, 90, .35);
	transform: rotate(-6deg);
}
.apl-logo img { max-width: 70%; max-height: 70%; object-fit: contain; }
.apl-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 1px 8px rgba(70, 20, 90, .25); }
.apl-sub { margin: 0; font-size: 14px; color: #fff; opacity: .95; text-shadow: 0 1px 6px rgba(70, 20, 90, .25); }

/* ---------- Body ---------- */
.apl-body { padding: 0 28px 26px; margin-top: -8px; position: relative; z-index: 1; }

.apl-dots { display: flex; justify-content: center; gap: 6px; margin: 0 0 18px; }
.apl-dot { height: 8px; width: 8px; border-radius: 99px; background: var(--apl-line); transition: all .35s ease; }
.apl-dot.is-on { width: 28px; background: linear-gradient(90deg, var(--apl-pink), var(--apl-purple)); }
.apl-card[data-step-now="done"] .apl-dots { display: none; }

.apl-msg {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13.5px;
	background: color-mix(in srgb, var(--apl-pink) 16%, #fff);
	color: #8a1f4b;
	border: 1px solid color-mix(in srgb, var(--apl-pink) 45%, #fff);
	animation: aplIn .3s ease;
}
.apl-msg.is-ok {
	background: color-mix(in srgb, var(--apl-mint) 28%, #fff);
	color: #1f6a53;
	border-color: color-mix(in srgb, var(--apl-mint) 70%, #fff);
}

.apl-step { display: none; }
.apl-step.is-active { display: block; animation: aplIn .4s ease both; }

.apl-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 8px; color: var(--apl-ink); }

.apl-field { position: relative; }
.apl-field .apl-ico {
	position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
	color: var(--apl-purple); pointer-events: none;
}
.apl-field input {
	width: 100%;
	height: 56px;
	padding: 0 16px 0 48px;
	border: 2px solid var(--apl-line);
	border-radius: 16px;
	background: #fcf9ff;
	font-family: inherit;
	font-size: 19px;
	letter-spacing: 1.5px;
	color: var(--apl-ink);
	text-align: left;
	outline: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
	box-shadow: none;
}
.apl-field input[name="name"] { direction: rtl; text-align: right; letter-spacing: 0; padding: 0 48px 0 16px; font-size: 17px; }
.apl-field input[name="name"] ~ .apl-ico, .apl-field:has(input[name="name"]) .apl-ico { left: auto; right: 16px; }
.apl-field input::placeholder { color: #c3b7d3; letter-spacing: 1px; }
.apl-field input:focus {
	border-color: var(--apl-purple);
	background: #fff;
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--apl-purple) 20%, transparent);
}
.apl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- Button ---------- */
.apl-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%;
	height: 56px;
	margin-top: 16px;
	border: 0;
	border-radius: 16px;
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, var(--apl-pink-d), var(--apl-purple-d));
	box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--apl-purple) 90%, #000);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s, opacity .2s;
}
.apl-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 18px 30px -12px color-mix(in srgb, var(--apl-purple) 95%, #000); }
.apl-btn:active:not(:disabled) { transform: translateY(0); }
.apl-btn:disabled { opacity: .55; cursor: not-allowed; }
.apl-btn.is-loading span { opacity: .75; }
.apl-btn.is-loading::after {
	content: ""; width: 18px; height: 18px; border-radius: 50%;
	border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
	animation: aplSpin .7s linear infinite;
}

.apl-hint { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--apl-muted); }

/* ---------- OTP ---------- */
.apl-where { margin: 0 0 16px; text-align: center; font-size: 14px; color: var(--apl-muted); }
.apl-where strong { color: var(--apl-ink); font-size: 15px; }
.apl-otp { display: flex; justify-content: center; gap: 9px; }
.apl-otp input {
	width: 100%; max-width: 54px; height: 62px; padding: 0;
	border: 2px solid var(--apl-line); border-radius: 16px;
	background: #fcf9ff;
	text-align: center; font-family: inherit; font-size: 26px; font-weight: 800; color: var(--apl-ink);
	outline: none; box-shadow: none;
	transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}
.apl-otp input.is-filled { border-color: var(--apl-pink); background: color-mix(in srgb, var(--apl-pink) 8%, #fff); }
.apl-otp input:focus { border-color: var(--apl-purple); background: #fff; transform: translateY(-2px); box-shadow: 0 0 0 5px color-mix(in srgb, var(--apl-purple) 20%, transparent); }
.apl-otp.is-error { animation: aplShake .45s ease; }
.apl-otp.is-error input { border-color: #e5527f; }

.apl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--apl-muted); min-height: 24px; }
.apl-link {
	background: none; border: 0; padding: 2px 0; cursor: pointer;
	font-family: inherit; font-size: 13px; font-weight: 700; color: var(--apl-purple-d);
	text-decoration: none; box-shadow: none;
}
.apl-link:hover { text-decoration: underline; background: none; color: var(--apl-pink-d); }

/* ---------- Success ---------- */
.apl-success { text-align: center; padding: 6px 0 4px; }
.apl-success.is-active { display: block; }
.apl-success h4 { margin: 8px 0 2px; font-size: 20px; color: var(--apl-ink); }
.apl-success p { margin: 0; font-size: 14px; color: var(--apl-muted); }
.apl-ck-c { stroke: var(--apl-mint); stroke-dasharray: 150; stroke-dashoffset: 150; animation: aplDraw .6s ease forwards; }
.apl-ck-p { stroke: var(--apl-purple); stroke-dasharray: 48; stroke-dashoffset: 48; animation: aplDraw .45s .45s ease forwards; }

/* ---------- Badges ---------- */
.apl-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.apl-badge { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; color: var(--apl-ink); white-space: nowrap; }
.b-mint { background: color-mix(in srgb, var(--apl-mint) 40%, #fff); }
.b-blue { background: color-mix(in srgb, var(--apl-blue) 40%, #fff); }
.b-yellow { background: color-mix(in srgb, var(--apl-yellow) 40%, #fff); }
.apl-slogan { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--apl-muted); }
.apl-card[data-step-now="done"] .apl-badges, .apl-card[data-step-now="done"] .apl-slogan { display: none; }

/* ---------- Modal ---------- */
.apl-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.apl-modal[hidden] { display: none; }
.apl-overlay { position: absolute; inset: 0; background: rgba(46, 28, 78, .55); backdrop-filter: blur(5px); animation: aplFade .25s ease; }
.apl-dialog { position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto; border-radius: 28px; animation: aplPop .35s cubic-bezier(.2,.9,.3,1.2); }
.apl-dialog .apl-card { margin: 0; }
.apl-close {
	position: absolute; top: 12px; left: 12px; z-index: 5;
	width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255,255,255,.25); color: #fff; font-size: 24px; line-height: 36px; text-align: center; cursor: pointer;
	transition: background .2s, transform .2s;
}
.apl-close:hover { background: rgba(255,255,255,.4); transform: rotate(90deg); }
body.apl-lock { overflow: hidden; }

/* ---------- Trigger link ---------- */
.apl-btn-link {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 10px 22px; border-radius: 99px; font-weight: 800; font-size: 14px; text-decoration: none !important;
	color: #fff !important;
	background: linear-gradient(135deg, var(--apl-pink-d, #c2557c), var(--apl-purple-d, #6f55a8));
	transition: transform .2s, filter .2s;
}
.apl-btn-link:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* ---------- WooCommerce: alt password login ---------- */
.apl-alt { max-width: 440px; margin: 16px auto 0; background: #fff; border: 1px solid var(--apl-line, #eadff5); border-radius: 18px; padding: 4px 18px; }
.apl-alt summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 14px; color: #6f55a8; list-style: none; text-align: center; }
.apl-alt summary::-webkit-details-marker { display: none; }
.apl-alt .apl-alt-body { padding: 4px 0 14px; }
.apl-alt .woocommerce-form-login { border: 0 !important; padding: 0 !important; margin: 0 !important; }

/* ---------- Animations ---------- */
@keyframes aplIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes aplFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aplPop { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes aplSpin { to { transform: rotate(360deg); } }
@keyframes aplFloat { 50% { transform: translateY(-9px); } }
@keyframes aplShake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes aplDraw { to { stroke-dashoffset: 0; } }

@media (max-width: 420px) {
	.apl-body { padding: 0 18px 22px; }
	.apl-otp { gap: 6px; }
	.apl-otp input { height: 56px; font-size: 22px; border-radius: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.apl-card *, .apl-modal * { animation: none !important; transition: none !important; }
}
