/* خبرنامه پیامکی — فرم عضویت */
.psms-box {
	--psms-c1: #7c3aed;
	--psms-c2: #a855f7;
	--psms-btn-txt: #fff;
	--psms-r: 14px;
	--psms-ink: #0f172a;
	--psms-muted: #64748b;
	--psms-line: rgba(15, 23, 42, .1);
	--psms-surface: #ffffff;
	--psms-field: #f8fafc;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
	color: var(--psms-ink);
	font-family: inherit;
	line-height: 1.7;
	max-width: 100%;
	margin: 0 auto 24px;
}
.psms-box *, .psms-box *::before, .psms-box *::after { box-sizing: border-box; }
.psms-box [hidden] { display: none !important; }

/* ---------- سرتیتر ---------- */
.psms-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; position: relative; }
.psms-icon {
	flex: 0 0 52px; height: 52px; border-radius: calc(var(--psms-r) + 2px);
	display: grid; place-items: center; color: var(--psms-btn-txt);
	background: linear-gradient(135deg, var(--psms-c1), var(--psms-c2));
	box-shadow: 0 10px 24px -8px var(--psms-c1);
}
.psms-title { margin: 0 !important; padding: 0; font-size: 1.15em; font-weight: 800; line-height: 1.5; color: inherit; letter-spacing: 0; }
.psms-desc { margin: 2px 0 0 !important; font-size: .9em; color: var(--psms-muted); }

/* ---------- ورودی‌ها ---------- */
.psms-form { position: relative; margin: 0; }
.psms-row { display: flex; gap: 8px; align-items: stretch; }
.psms-field { position: relative; flex: 1; min-width: 0; }
.psms-field-name { margin-bottom: 8px; }
.psms-prefix { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--psms-muted); display: flex; pointer-events: none; transition: color .2s; z-index: 2; }
.psms-box .psms-input {
	width: 100%; height: 52px; margin: 0;
	padding: 0 16px; font: inherit; font-size: 15px; color: var(--psms-ink);
	background: var(--psms-field); border: 1.5px solid var(--psms-line);
	border-radius: var(--psms-r); outline: none; box-shadow: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
	-webkit-appearance: none; appearance: none;
}
.psms-box .psms-phone { padding-right: 42px; text-align: left; letter-spacing: .5px; }
.psms-phone::placeholder { text-align: right; letter-spacing: 0; }
.psms-input::placeholder { color: #94a3b8; opacity: 1; }
.psms-box .psms-input:focus { background: var(--psms-surface); border-color: var(--psms-c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--psms-c1) 18%, transparent); }
.psms-field:focus-within .psms-prefix { color: var(--psms-c1); }
.psms-box .psms-code { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 10px; }
.psms-code::placeholder { letter-spacing: 6px; font-size: 16px; }
.psms-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- دکمه ---------- */
.psms-box .psms-btn, .psms-float .psms-float-btn {
	position: relative; overflow: hidden; flex: 0 0 auto;
	height: 52px; min-width: 120px; padding: 0 26px; margin: 0;
	font: inherit; font-size: 15px; font-weight: 700; color: var(--psms-btn-txt);
	background: linear-gradient(135deg, var(--psms-c1), var(--psms-c2));
	background-size: 160% 160%; background-position: 0 50%;
	border: 0; border-radius: var(--psms-r); cursor: pointer;
	box-shadow: 0 10px 22px -10px var(--psms-c1);
	transition: transform .15s, box-shadow .25s, background-position .4s;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	text-shadow: none; line-height: 1;
}
.psms-btn::after {
	content: ""; position: absolute; inset: 0; transform: translateX(120%) skewX(-20deg);
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
	transition: transform .7s;
}
.psms-box .psms-btn:hover { background-position: 100% 50%; box-shadow: 0 14px 28px -10px var(--psms-c1); transform: translateY(-1px); color: var(--psms-btn-txt); }
.psms-btn:hover::after { transform: translateX(-120%) skewX(-20deg); }
.psms-btn:active { transform: translateY(0) scale(.98); }
.psms-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--psms-c1) 40%, transparent); outline-offset: 2px; }
.psms-btn[disabled] { opacity: .75; cursor: progress; }
.psms-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: currentColor; border-radius: 50%; animation: psms-spin .7s linear infinite; }
.psms-loading .psms-spinner { display: inline-block; }
.psms-loading .psms-btn-text { opacity: .6; }
@keyframes psms-spin { to { transform: rotate(360deg); } }

/* ---------- OTP ---------- */
.psms-otp-label { margin: 0 0 10px !important; font-size: .92em; color: var(--psms-muted); }
.psms-otp-label b { color: var(--psms-ink); }
.psms-edit, .psms-unsub-toggle { color: var(--psms-c1); text-decoration: none; font-size: .9em; margin-right: 6px; cursor: pointer; }
.psms-edit:hover, .psms-unsub-toggle:hover { text-decoration: underline; }
.psms-resend { margin-top: 10px; padding: 0; background: none; border: 0; font: inherit; font-size: .85em; color: var(--psms-c1); cursor: pointer; }
.psms-resend[disabled] { color: var(--psms-muted); cursor: default; }
.psms-step-otp { animation: psms-in .35s ease; }

/* ---------- پیام و موفقیت ---------- */
.psms-msg { font-size: .88em; min-height: 0; margin-top: 0; transition: all .2s; }
.psms-msg:not(:empty) { margin-top: 12px; padding: 10px 14px; border-radius: calc(var(--psms-r) - 4px); }
.psms-msg.is-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.psms-msg.is-info { background: color-mix(in srgb, var(--psms-c1) 8%, #fff); color: var(--psms-c1); border: 1px solid color-mix(in srgb, var(--psms-c1) 20%, transparent); }
.psms-done { text-align: center; padding: 6px 0 2px; animation: psms-in .4s ease; }
.psms-done-text { margin: 10px 0 0 !important; font-weight: 700; }
.psms-check { width: 64px; height: 64px; margin: 0 auto; }
.psms-check svg { width: 100%; height: 100%; }
.psms-check circle { stroke: var(--psms-c1); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: psms-draw .6s ease forwards; }
.psms-check path { stroke: var(--psms-c2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: psms-draw .4s .45s ease forwards; }
@keyframes psms-draw { to { stroke-dashoffset: 0; } }
@keyframes psms-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.psms-shake { animation: psms-shake .4s; }
@keyframes psms-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- فوتر ---------- */
.psms-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 14px; font-size: .78em; color: var(--psms-muted); }
.psms-foot .psms-unsub-toggle { margin-right: auto; font-size: 1em; }
.psms-count { font-weight: 700; color: var(--psms-ink); }

/* ---------- تزئینات ---------- */
.psms-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.psms-deco span { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .22; background: var(--psms-c1); }
.psms-deco span:first-child { width: 180px; height: 180px; top: -70px; left: -60px; }
.psms-deco span:last-child { width: 140px; height: 140px; bottom: -70px; right: 20%; background: var(--psms-c2); opacity: .16; }

/* ========== استایل کارت ========== */
.psms-style-card {
	padding: 26px; background: var(--psms-surface);
	border: 1px solid var(--psms-line);
	border-radius: calc(var(--psms-r) + 8px);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 20px 40px -24px rgba(15, 23, 42, .25);
}

/* ========== شیشه‌ای ========== */
.psms-style-glass {
	--psms-ink: #fff; --psms-muted: rgba(255, 255, 255, .78); --psms-line: rgba(255, 255, 255, .28); --psms-field: rgba(255, 255, 255, .14); --psms-surface: rgba(255, 255, 255, .22);
	padding: 30px; color: #fff;
	background: radial-gradient(120% 140% at 100% 0%, var(--psms-c2) 0%, var(--psms-c1) 55%, color-mix(in srgb, var(--psms-c1) 70%, #000) 100%);
	border-radius: calc(var(--psms-r) + 10px);
	box-shadow: 0 30px 60px -30px var(--psms-c1);
}
.psms-style-glass .psms-deco span { background: #fff; opacity: .18; }
.psms-style-glass .psms-icon { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); color: #fff; backdrop-filter: blur(8px); }
.psms-style-glass .psms-input { color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.psms-style-glass .psms-input::placeholder { color: rgba(255, 255, 255, .7); }
.psms-style-glass .psms-box .psms-input:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.psms-style-glass .psms-prefix, .psms-style-glass .psms-field:focus-within .psms-prefix { color: rgba(255, 255, 255, .85); }
.psms-style-glass .psms-btn { background: #fff; color: var(--psms-c1); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .35); }
.psms-style-glass .psms-box .psms-btn:hover { color: var(--psms-c1); }
.psms-style-glass .psms-spinner { border-color: color-mix(in srgb, var(--psms-c1) 30%, transparent); border-top-color: var(--psms-c1); }
.psms-style-glass .psms-edit, .psms-style-glass .psms-unsub-toggle, .psms-style-glass .psms-resend { color: #fff; }
.psms-style-glass .psms-msg.is-info { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.psms-style-glass .psms-check circle, .psms-style-glass .psms-check path { stroke: #fff; }

/* ========== دو ستونه ========== */
.psms-style-split {
	padding: 28px 30px; background: var(--psms-surface);
	border: 1px solid var(--psms-line); border-radius: calc(var(--psms-r) + 8px);
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px 28px; align-items: center;
	box-shadow: 0 20px 40px -28px rgba(15, 23, 42, .3);
}
.psms-style-split::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--psms-c1), var(--psms-c2)); }
.psms-style-split .psms-head { margin: 0; grid-row: span 3; }
.psms-style-split .psms-foot, .psms-style-split .psms-msg { grid-column: 2; }
.psms-style-split .psms-foot { margin-top: 4px; }

/* ========== خطی ========== */
.psms-style-inline { padding: 0; background: transparent; }
.psms-style-inline .psms-head, .psms-style-inline .psms-deco, .psms-style-inline .psms-privacy { display: none; }
.psms-style-inline .psms-row { padding: 6px; background: var(--psms-surface); border: 1.5px solid var(--psms-line); border-radius: calc(var(--psms-r) + 6px); box-shadow: 0 10px 30px -20px rgba(15, 23, 42, .4); transition: border-color .2s, box-shadow .2s; }
.psms-style-inline .psms-row:focus-within { border-color: var(--psms-c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--psms-c1) 15%, transparent); }
.psms-style-inline .psms-input { border: 0; background: transparent; height: 46px; box-shadow: none !important; }
.psms-style-inline .psms-btn { height: 46px; }
.psms-style-inline .psms-foot { margin-top: 8px; }

/* ========== مینیمال ========== */
.psms-style-minimal { padding: 4px 0; background: transparent; }
.psms-style-minimal .psms-deco { display: none; }
.psms-style-minimal .psms-icon { flex-basis: 40px; height: 40px; box-shadow: none; }
.psms-style-minimal .psms-icon svg { width: 20px; height: 20px; }
.psms-style-minimal .psms-input { background: transparent; border-width: 0 0 2px; border-radius: 0; padding-right: 30px; }
.psms-style-minimal .psms-prefix { right: 4px; }
.psms-style-minimal .psms-box .psms-input:focus { box-shadow: none; }
.psms-style-minimal .psms-code { padding-right: 16px; }

/* ---------- موبایل ---------- */
@media (max-width: 560px) {
	.psms-style-split { grid-template-columns: 1fr; padding: 24px 20px; }
	.psms-style-split .psms-head { grid-row: auto; margin-bottom: 10px; }
	.psms-style-split .psms-foot, .psms-style-split .psms-msg { grid-column: 1; }
	.psms-style-card, .psms-style-glass { padding: 22px 18px; }
}
@media (max-width: 420px) {
	.psms-box:not(.psms-style-inline) .psms-row { flex-direction: column; }
	.psms-box:not(.psms-style-inline) .psms-btn { width: 100%; }
	.psms-style-inline .psms-btn { min-width: 0; padding: 0 16px; }
}

/* ---------- دکمه شناور ---------- */
.psms-float { position: fixed; bottom: 22px; z-index: 99990; direction: rtl; font-family: inherit; }
.psms-float-left { left: 22px; }
.psms-float-right { right: 22px; }
.psms-float-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 18px;
	border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
	color: var(--psms-btn-txt); background: linear-gradient(135deg, var(--psms-c1), var(--psms-c2));
	box-shadow: 0 14px 30px -10px var(--psms-c1); transition: transform .2s;
	animation: psms-float-in .5s cubic-bezier(.2, .9, .3, 1.3) both 1s;
}
.psms-float-btn:hover { transform: translateY(-2px); }
.psms-float-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 var(--psms-c1); animation: psms-pulse 2.4s infinite 2s; pointer-events: none; }
@keyframes psms-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--psms-c1) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes psms-float-in { from { opacity: 0; transform: translateY(30px) scale(.8); } }
.psms-float-panel { position: absolute; bottom: 66px; width: min(380px, calc(100vw - 32px)); animation: psms-in .3s ease; }
.psms-float-left .psms-float-panel { left: 0; }
.psms-float-right .psms-float-panel { right: 0; }
.psms-float-panel .psms-box { margin: 0; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45); }
.psms-float-close { position: absolute; top: 10px; left: 12px; z-index: 3; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .06); color: #475569; font-size: 20px; line-height: 1; cursor: pointer; }
.psms-float-close:hover { background: rgba(15, 23, 42, .12); }
@media (max-width: 480px) { .psms-float-btn span { display: none; } .psms-float-btn { width: 54px; padding: 0; justify-content: center; } }

/* ---------- حالت تیره قالب ---------- */
@media (prefers-color-scheme: dark) {
	.psms-auto-dark.psms-style-card, .psms-auto-dark.psms-style-split { --psms-ink: #f1f5f9; --psms-muted: #94a3b8; --psms-line: rgba(255,255,255,.12); --psms-surface: #0f172a; --psms-field: #1e293b; }
}
@media (prefers-reduced-motion: reduce) {
	.psms-box *, .psms-float * { animation: none !important; transition: none !important; }
}
