/* MehrBot — صفحات ورود/ثبت‌نام/فراموشی رمز قالب «مهرشاد» */
:root {
  --ink: #1B1530; --ink-2: #2A2146; --plum: #3B2C66;
  --saffron: #E8891C; --saffron-2: #F4A940; --saffron-d: #B8620B;
  --firuzeh: #0F9D8F; --anar: #D2453B;
  --ivory: #FAF7F2; --sand: #F3EDE3; --line: #E6DDCF; --text: #4A4458; --muted: #7D7790;
  --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.ms-auth { font-family: 'Vazirmatn', system-ui, sans-serif; color: var(--text); background: var(--ivory); font-size: 15px; line-height: 1.85; -webkit-font-smoothing: antialiased; }
a { color: var(--saffron-d); }
svg { display: block; }
.ms-skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 10; }
.ms-skip:focus { top: 12px; }
:focus-visible { outline: 2.5px solid var(--saffron); outline-offset: 3px; border-radius: 8px; }

.ms-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ── بخش تصویری ── */
.ms-visual { position: relative; overflow: hidden; margin: 14px; border-radius: 28px; color: #fff; padding: 28px;
  background: linear-gradient(150deg, var(--ink) 0%, #231a3f 55%, var(--plum) 100%); display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.ms-aurora { position: absolute; inset: 0; z-index: -1; filter: blur(40px); opacity: .75; }
.ms-aurora i { position: absolute; border-radius: 50%; animation: msFloat 18s ease-in-out infinite; }
.ms-aurora i:nth-child(1) { width: 380px; height: 380px; background: rgba(244, 169, 64, .45); top: -120px; inset-inline-end: -80px; }
.ms-aurora i:nth-child(2) { width: 320px; height: 320px; background: rgba(15, 157, 143, .38); bottom: -120px; inset-inline-start: -60px; animation-delay: -6s; }
.ms-aurora i:nth-child(3) { width: 240px; height: 240px; background: rgba(210, 69, 59, .28); top: 40%; inset-inline-start: 40%; animation-delay: -12s; }
.ms-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.ms-brand small { display: block; font-weight: 500; font-size: .72rem; opacity: .7; }
.ms-brand.sm { color: var(--ink); }
.ms-logo { width: 42px; height: 42px; border-radius: 13px; flex: 0 0 42px; background: var(--ink) center/28px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Ccircle cx='24' cy='24' r='9' fill='%23F4A940'/%3E%3Cg stroke='%23F4A940' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M24 5v5M24 38v5M5 24h5M38 24h5M10.6 10.6l3.5 3.5M33.9 33.9l3.5 3.5M10.6 37.4l3.5-3.5M33.9 14.1l3.5-3.5'/%3E%3C/g%3E%3Cpath d='M18.5 26.5a6 6 0 0 0 11 0' stroke='%231B1530' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ms-visual .ms-logo { background-color: rgba(255, 255, 255, .08); }

/* مدار ایجنت‌ها */
.ms-orbit { position: relative; width: min(340px, 70%); aspect-ratio: 1; margin: 10px auto; }
.ms-sun-core { position: absolute; inset: 34%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FFD08A, var(--saffron-2) 45%, var(--saffron) 100%);
  box-shadow: 0 0 60px rgba(244, 169, 64, .65), 0 0 0 12px rgba(244, 169, 64, .08), 0 0 0 26px rgba(244, 169, 64, .04); animation: msBreath 5s ease-in-out infinite; display: grid; place-items: center; }
.ms-sun-face { width: 42%; height: 22%; border-bottom: 4px solid var(--ink); border-radius: 0 0 60px 60px; margin-top: 18%; }
.ms-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .18); animation: msSpin 38s linear infinite; }
.ms-ring.r2 { inset: 16%; animation-duration: 26s; animation-direction: reverse; }
.ms-ring span { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px; display: grid; place-items: center; font-size: 1.3rem;
  border-radius: 15px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .16);
  transform: rotate(var(--a)) translate(calc(var(--r, 170px))) rotate(calc(-1 * var(--a))); }
.ms-ring.r1 span { --r: min(165px, 15vw); }
.ms-ring.r2 span { --r: min(110px, 10vw); width: 40px; height: 40px; margin: -20px; font-size: 1.1rem; }
.ms-ring span b { display: block; font-weight: 400; animation: msCounter 38s linear infinite; }
.ms-ring.r2 span b { animation-duration: 26s; animation-direction: reverse; }

/* شیشهٔ داده */
.ms-glass { display: grid; grid-template-columns: 128px 1fr; gap: 14px 18px; align-items: center; padding: 16px; border-radius: 22px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(12px); }
.ms-gauge { position: relative; width: 120px; height: 120px; }
.ms-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ms-gauge .segs path { fill: none; stroke-width: 9; stroke-linecap: round; stroke: rgba(255, 255, 255, .12); transition: stroke .3s; }
.ms-gauge .segs path.on { stroke: var(--saffron-2); filter: drop-shadow(0 0 4px rgba(244, 169, 64, .6)); }
.ms-gauge b { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 1.8rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ms-gauge b small { font-size: .66rem; font-weight: 500; opacity: .75; }
.ms-console { list-style: none; margin: 0; padding: 0; font-size: .84rem; display: grid; gap: 6px; }
.ms-console li { display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateY(8px); animation: msIn .6s var(--out) forwards; }
.ms-console li:nth-child(2) { animation-delay: .5s; } .ms-console li:nth-child(3) { animation-delay: 1s; } .ms-console li:nth-child(4) { animation-delay: 1.5s; }
.ms-console i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #3BC98E; box-shadow: 0 0 0 4px rgba(59, 201, 142, .18); }
.ms-console i.warn { background: var(--saffron-2); box-shadow: 0 0 0 4px rgba(244, 169, 64, .18); }
.ms-bars { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 7px; height: 56px; }
.ms-bars span { flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--saffron-2), rgba(244, 169, 64, .25));
  box-shadow: 0 0 14px rgba(244, 169, 64, .35); transform-origin: bottom; transform: scaleY(0); animation: msGrow .9s var(--spring) forwards; animation-delay: var(--d); }
.ms-bars span:last-child { background: linear-gradient(180deg, #5EE0D2, rgba(15, 157, 143, .3)); box-shadow: 0 0 14px rgba(15, 157, 143, .5); }
.ms-quotes { position: relative; min-height: 84px; }
.ms-quote { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity .6s var(--out), transform .6s var(--out); }
.ms-quote.on { opacity: 1; transform: none; }
.ms-quote b { display: block; font-size: 1.2rem; }
.ms-quote p { margin: 4px 0 0; opacity: .78; font-size: .92rem; }

/* ── پنل فرم ── */
.ms-panel { display: flex; flex-direction: column; padding: 20px clamp(18px, 5vw, 64px); }
.ms-top { display: flex; justify-content: space-between; align-items: center; }
.ms-top .ms-brand.sm { visibility: hidden; }
.ms-links { display: flex; gap: 6px; }
.ms-links a { color: var(--text); text-decoration: none; font-size: .88rem; padding: 6px 12px; border-radius: 10px; transition: background .2s; }
.ms-links a:hover { background: var(--sand); }
.ms-card { width: 100%; max-width: 430px; margin: auto; padding: 8px 0 24px; }
.ms-h { color: var(--ink); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 800; margin: 18px 0 6px; line-height: 1.35; }
.ms-split .w { display: inline-block; opacity: 0; transform: translateY(.5em); filter: blur(4px); animation: msWord .6s var(--out) forwards; }
.ms-sub { margin: 0 0 22px; color: var(--muted); }

/* سوییچ ورود/ثبت‌نام */
.ms-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--sand); padding: 5px; border-radius: 16px; }
.ms-seg a { position: relative; z-index: 1; text-align: center; padding: 9px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 700; transition: color .25s; }
.ms-seg a.on { color: var(--ink); }
.ms-seg-pill { position: absolute; top: 5px; bottom: 5px; width: calc(50% - 5px); border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(27, 21, 48, .1); transition: inset-inline-start .5s var(--spring); inset-inline-start: 5px; }
[data-mode="register"] .ms-seg-pill { inset-inline-start: 50%; }

/* فیلدها با برچسب شناور */
.ms-form { display: grid; gap: 14px; }
.ms-field { position: relative; }
.ms-field input { width: 100%; height: 56px; padding: 22px 46px 6px 46px; border-radius: 15px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .3s var(--out); }
.ms-field input:hover { border-color: #D9C9B0; }
.ms-field input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(232, 137, 28, .18); }
.ms-field label { position: absolute; inset-inline-start: 46px; top: 17px; color: var(--muted); pointer-events: none; transition: transform .25s var(--out), font-size .25s, color .25s, top .25s var(--out); transform-origin: right top; }
[dir="ltr"] .ms-field label { transform-origin: left top; }
.ms-field input:focus + label, .ms-field input:not(:placeholder-shown) + label { top: 7px; font-size: .74rem; color: var(--saffron-d); font-weight: 700; }
.ms-field .ms-ic { position: absolute; inset-inline-start: 15px; top: 17px; width: 21px; height: 21px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s, transform .4s var(--spring); }
.ms-field input:focus ~ .ms-ic { stroke: var(--saffron); transform: scale(1.1) rotate(-6deg); }
.ms-eye { position: absolute; inset-inline-end: 8px; top: 8px; width: 40px; height: 40px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.ms-eye:hover { background: var(--sand); }
.ms-eye svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.ms-eye[aria-pressed="true"] svg { stroke: var(--saffron-d); }
.ms-caps[hidden] { display: none; }
.ms-caps { display: block; margin-top: 4px; font-size: .76rem; color: var(--anar); }
.ms-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.ms-row.center { justify-content: center; margin-top: 4px; }
.ms-link { font-size: .88rem; font-weight: 700; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100%/0 1.5px no-repeat; transition: background-size .35s var(--out); }
.ms-link:hover { background-size: 100% 1.5px; }

/* سنج قدرت رمز (segment percent) */
.ms-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-top: -4px; }
.ms-meter i { height: 6px; border-radius: 6px; background: var(--sand); transition: background .3s, transform .4s var(--spring); }
.ms-meter i.on { transform: scaleY(1.35); }
.ms-meter[data-s="1"] i.on { background: var(--anar); } .ms-meter[data-s="2"] i.on { background: #D98A0B; }
.ms-meter[data-s="3"] i.on { background: var(--saffron-2); } .ms-meter[data-s="4"] i.on { background: var(--firuzeh); }
.ms-meter span { font-size: .74rem; min-width: 52px; text-align: end; color: var(--muted); }
.ms-note { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.9; }

/* دکمه با حالت بارگذاری (animate-ui Save button) */
.ms-btn { position: relative; height: 54px; border: 0; border-radius: 15px; cursor: pointer; font: inherit; font-weight: 800; font-size: 1.02rem; color: var(--ink); overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--saffron-2), var(--saffron) 55%, var(--saffron-2)); background-size: 200% 200%;
  box-shadow: 0 14px 30px -12px rgba(232, 137, 28, .65); transition: transform .4s var(--spring), box-shadow .3s, background-position .6s var(--out); }
.ms-btn:hover { transform: translateY(-2px); background-position: 100% 50%; box-shadow: 0 18px 36px -12px rgba(232, 137, 28, .75); }
.ms-btn:active { transform: scale(.97); transition-duration: .08s; }
.ms-btn::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .5) 48%, transparent 66%); transform: translateX(-120%); transition: transform .8s var(--out); }
.ms-btn:hover::after { transform: translateX(120%); }
.ms-btn .sp { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; border: 2.6px solid rgba(27, 21, 48, .25); border-top-color: var(--ink); opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s var(--spring); }
.ms-btn.busy .t { opacity: 0; transform: translateY(-10px); }
.ms-btn .t { display: inline-block; transition: opacity .2s, transform .3s var(--out); }
.ms-btn.busy .sp { opacity: 1; transform: scale(1); animation: msSpin .7s linear infinite; }
.ms-btn.busy { pointer-events: none; }

/* پیام‌ها */
.ms-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .9rem; animation: msShake .5s var(--out); }
.ms-alert svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; margin-top: 2px; }
.ms-alert.bad { background: #FCEBEA; color: #9E2C24; border: 1px solid #F3C9C5; }
.ms-alert.ok { background: #E4F5F2; color: #0B6A61; border: 1px solid #BFE6E0; animation: msIn .5s var(--out); }
.ms-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); padding-top: 12px; }
.ms-social { display: flex; gap: 10px; }
.ms-social a { color: var(--muted); text-decoration: none; }
.ms-social a:hover { color: var(--saffron-d); }

/* ── واکنش‌گرا ── */
@media (max-width: 960px) {
  .ms-shell { grid-template-columns: 1fr; }
  .ms-visual { display: none; }
  .ms-top .ms-brand.sm { visibility: visible; }
  body.ms-auth { background: radial-gradient(600px 300px at 100% 0%, rgba(244, 169, 64, .18), transparent 70%), var(--ivory); }
}

@keyframes msFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -20px) scale(1.08); } 66% { transform: translate(-20px, 24px) scale(.95); } }
@keyframes msBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes msSpin { to { transform: rotate(360deg); } }
@keyframes msCounter { to { transform: rotate(-360deg); } }
@keyframes msIn { to { opacity: 1; transform: none; } }
@keyframes msGrow { to { transform: scaleY(1); } }
@keyframes msWord { to { opacity: 1; transform: none; filter: none; } }
@keyframes msShake { 0% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
