/* IransiteAuth - قالب آقای ویلا (mrvila): استایل پایه‌ی قالب default + ظاهر فرم قبلی ورود سایت (انتهای فایل). */
.ia {
    --ia-primary: #0f766e;
    --ia-primary-hover: #115e59;
    --ia-text: #1f2937;
    --ia-muted: #6b7280;
    --ia-border: #d1d5db;
    --ia-bg: #ffffff;
    --ia-soft: #f3f4f6;
    --ia-danger: #b91c1c;
    --ia-danger-soft: #fef2f2;
    --ia-success: #047857;
    --ia-success-soft: #ecfdf5;
    --ia-radius: 12px;
    color: var(--ia-text);
    font-size: 15px;
    line-height: 1.7;
    padding: 16px 12px;
}
.ia *, .ia *::before, .ia *::after { box-sizing: border-box; }
.ia [hidden] { display: none !important; }
.ia-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--ia-bg);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .06);
}
.ia-card.ia-account { max-width: 760px; }
.ia-brand { text-align: center; margin-bottom: 8px; }
.ia-brand img { max-height: 56px; max-width: 70%; }
.ia-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; text-align: center; }
.ia-subtitle { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.ia-head { position: relative; }
.ia-head .ia-title { padding: 0 36px; }
.ia-back {
    position: absolute; top: -2px; inset-inline-start: 0;
    width: 34px; height: 34px; border-radius: 50%;
    border: 0; background: var(--ia-soft); color: var(--ia-text);
    font-size: 18px; line-height: 34px; cursor: pointer;
}
.ia-back:hover { background: #e5e7eb; }
.ia[dir="ltr"] .ia-back { transform: scaleX(-1); }
.ia-label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.ia-field { position: relative; display: flex; align-items: stretch; }
.ia-input {
    width: 100%; height: 48px; padding: 0 14px;
    border: 1px solid var(--ia-border); border-radius: var(--ia-radius);
    background: #fff; color: var(--ia-text); font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.ia-input:focus { outline: none; border-color: var(--ia-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.ia-input.ia-invalid { border-color: var(--ia-danger); box-shadow: 0 0 0 3px rgba(185, 28, 28, .12); }
.ia-ltr { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.ia-country {
    height: 48px; max-width: 120px; margin-inline-end: 8px; padding: 0 8px;
    border: 1px solid var(--ia-border); border-radius: var(--ia-radius); background: #fff; direction: ltr;
}
.ia-field .ia-eye {
    position: absolute; top: 0; bottom: 0; inset-inline-end: 4px; width: 42px;
    border: 0; background: transparent; cursor: pointer; opacity: .6;
    background-repeat: no-repeat; background-position: center; background-size: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.ia-field .ia-eye.ia-on { opacity: 1; }
.ia-field .ia-eye + .ia-input, .ia-field .ia-input:has(+ .ia-eye) { padding-inline-end: 46px; }
.ia-error { color: var(--ia-danger); font-size: 13px; min-height: 0; margin-top: 4px; }
.ia-error:empty { display: none; }
.ia-message { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--ia-danger-soft); color: var(--ia-danger); }
.ia-message:empty { display: none; }
.ia-message.ia-success, .ia-message.ia-info { background: var(--ia-success-soft); color: var(--ia-success); }
.ia-hint { color: var(--ia-muted); font-size: 13px; margin: 6px 0 0; }
.ia-hint:empty { display: none; }
.ia-who { text-align: center; color: var(--ia-muted); margin: -8px 0 8px; font-size: 14px; }
.ia-who-value, .ia-otp-hint { color: var(--ia-text); font-weight: 600; }
.ia-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 48px; margin-top: 18px; padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--ia-radius);
    font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s, opacity .15s;
}
.ia-primary { background: var(--ia-primary); color: #fff; }
.ia-primary:hover { background: var(--ia-primary-hover); color: #fff; }
.ia-secondary { background: #fff; color: var(--ia-danger); border-color: #fecaca; }
.ia-secondary:hover { background: var(--ia-danger-soft); }
.ia-ghost { background: var(--ia-soft); color: var(--ia-text); }
.ia-ghost:hover { background: #e5e7eb; color: var(--ia-text); }
.ia-btn[disabled], .ia-btn.ia-busy { opacity: .65; cursor: default; pointer-events: none; }
.ia-btn.ia-busy::after {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent; animation: ia-spin .7s linear infinite;
}
.ia-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; }
.ia-link { background: none; border: 0; padding: 0; color: var(--ia-primary); font-size: 14px; cursor: pointer; }
.ia-link:hover { text-decoration: underline; }
.ia-link[disabled] { color: var(--ia-muted); cursor: default; text-decoration: none; }
.ia-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; cursor: pointer; user-select: none; }
.ia-check input { width: 18px; height: 18px; accent-color: var(--ia-primary); margin: 0; }
.ia-hidden-user { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Captcha */
.ia-captcha-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ia-captcha-img { height: 56px; border-radius: 10px; border: 1px solid var(--ia-border); background: var(--ia-soft); min-width: 150px; }
.ia-icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--ia-border); background: #fff; font-size: 20px; cursor: pointer; }
.ia-icon-btn:hover { background: var(--ia-soft); }
.ia-recaptcha { margin-top: 14px; display: flex; justify-content: center; }

/* One-time code boxes */
.ia-otp { display: flex; justify-content: center; gap: 10px; margin: 18px 0 4px; }
.ia-otp-box {
    width: 52px; height: 58px; padding: 0;
    border: 1.5px solid var(--ia-border); border-radius: 12px;
    font-size: 26px; font-weight: 700; text-align: center; color: var(--ia-text);
    background: #fff; caret-color: var(--ia-primary);
    font-variant-numeric: tabular-nums;
}
.ia-otp-box:focus { outline: none; border-color: var(--ia-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .18); }
.ia-otp-box.ia-filled { border-color: #9ca3af; background: #f9fafb; }
.ia-otp.ia-invalid .ia-otp-box { border-color: var(--ia-danger); animation: ia-shake .35s; }
.ia-otp[data-length="7"] .ia-otp-box, .ia-otp[data-length="8"] .ia-otp-box { width: 42px; height: 52px; font-size: 22px; gap: 6px; }
.ia-timer { text-align: center; font-size: 14px; color: var(--ia-muted); margin-top: 10px; min-height: 22px; }

/* Account panel */
.ia-section { border-top: 1px solid #e5e7eb; padding-top: 18px; margin-top: 18px; }
.ia-sessions > li { list-style: none; margin: 0; }
.ia-sessions { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ia-session { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; font-size: 13px; position: relative; }
.ia-session.ia-current { border-color: var(--ia-primary); background: #f0fdfa; }
.ia-session strong { display: block; font-size: 14px; margin-bottom: 4px; }
.ia-session .ia-badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--ia-primary); color: #fff; margin-inline-start: 6px; }
.ia-session .ia-meta { color: var(--ia-muted); }
.ia-session .ia-link { margin-top: 6px; color: var(--ia-danger); }
.ia-session-empty { color: var(--ia-muted); font-size: 14px; }
.ia-account .ia-btn.ia-secondary, .ia-account .ia-logout { max-width: 320px; }
.ia-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Done */
.ia-spinner { width: 42px; height: 42px; margin: 12px auto; border-radius: 50%; border: 3px solid #d1fae5; border-top-color: var(--ia-primary); animation: ia-spin .8s linear infinite; }
.ia-step[data-step="done"] .ia-message { text-align: center; }

/* Social logins rendered by DNN */
.ia-social:empty { display: none; }
.ia-social { margin-top: 16px; }
.ia-social ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

@keyframes ia-spin { to { transform: rotate(360deg); } }
@keyframes ia-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (max-width: 480px) {
    .ia-card { padding: 22px 16px; border-radius: 14px; }
    .ia-otp { gap: 7px; }
    .ia-otp-box { width: 44px; height: 52px; font-size: 22px; }
    .ia-row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- user menu */
.ia-menu { min-width: 230px; }
.ia > .ia-menu { max-width: 420px; margin: 0 auto; background: var(--ia-bg); border: 1px solid #e5e7eb; border-radius: 16px; padding: 8px; box-shadow: 0 10px 30px rgba(17, 24, 39, .06); }
.ia-menu-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 6px; }
.ia-menu-head strong { display: block; font-size: 14px; line-height: 1.5; }
.ia-menu-head .ia-ltr { display: block; font-size: 12px; color: var(--ia-muted); }
.ia-menu-item { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ia-text); text-decoration: none; font-size: 14px; }
.ia-menu-item:hover, .ia-menu-item:focus { background: var(--ia-soft); color: var(--ia-text); text-decoration: none; }
.ia-menu-logout { color: var(--ia-danger); border-top: 1px solid #f0f0f0; margin-top: 6px; border-radius: 0 0 10px 10px; }
.ia-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--ia-primary); color: #fff; font-weight: 700; font-size: 15px;
}

/* ---------------------------------------------------------------- skin object */
.ia-so {
    --ia-primary: #0f766e; --ia-primary-hover: #115e59; --ia-text: #1f2937; --ia-muted: #6b7280; --ia-soft: #f3f4f6;
    --ia-bg: #fff; --ia-danger: #b91c1c;
    position: relative; display: inline-block; font-size: 14px; line-height: 1.6;
}
.ia-so *, .ia-so *::before, .ia-so *::after { box-sizing: border-box; }
.ia-so [hidden] { display: none !important; }
.ia-so-trigger {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
    border: 1px solid var(--ia-primary); border-radius: 999px; background: var(--ia-primary); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ia-so-trigger:hover, .ia-so-trigger:focus { background: var(--ia-primary-hover); color: #fff; text-decoration: none; }
.ia-so-user { background: #fff; color: var(--ia-text); border-color: #e5e7eb; padding: 0 10px 0 6px; }
.ia-so-user:hover, .ia-so-user:focus { background: var(--ia-soft); color: var(--ia-text); }
.ia-so-user .ia-avatar { width: 28px; height: 28px; font-size: 13px; }
.ia-so-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ia-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.ia-so-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 10000;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 6px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, .14); color: var(--ia-text); text-align: start;
}
.ia-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ia-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); backdrop-filter: blur(2px); }
.ia-modal-dialog { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; animation: ia-pop .18s ease-out; text-align: start; }
.ia-modal-dialog .ia { padding: 0; }
.ia-modal-dialog .ia-card { box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.ia-modal-dialog .ia-card.ia-account { max-width: none; }
.ia-modal-dialog:has(.ia-account) { max-width: 760px; }
.ia-modal-close {
    position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ia-soft);
    font-size: 22px; line-height: 34px; cursor: pointer; color: var(--ia-text);
}
.ia-modal-close:hover { background: #e5e7eb; }
html.ia-modal-open, html.ia-modal-open body { overflow: hidden; }
@keyframes ia-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 480px) {
    .ia-modal { padding: 0; align-items: stretch; }
    .ia-modal-dialog { max-width: none; max-height: none; height: 100%; }
    .ia-modal-dialog .ia-card { min-height: 100%; border-radius: 0; border: 0; }
    .ia-so-name { display: none; }
}

/* Mobile / e-mail in the account panel */
.ia-contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ia-soft); font-size: 14px; }
.ia-contact-label { color: var(--ia-muted); min-width: 64px; }
.ia-contact-value { flex: 1; direction: ltr; unicode-bidi: isolate; text-align: start; font-weight: 600; overflow-wrap: anywhere; }
.ia-contact-form { margin-top: 12px; }
.ia-contact-form .ia-btn { margin-top: 12px; }

/* National code / consent steps */
.ia-national-hint { margin-bottom: 12px; }
.ia-consent-text { font-size: 14px; line-height: 1.9; color: var(--ia-text); }
.ia-consent-text a { color: var(--ia-primary); font-weight: 600; }

/* Recent activity */
.ia-events { list-style: none; margin: 10px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.ia-event { padding: 8px 10px; border-inline-start: 3px solid var(--ia-border); margin-bottom: 6px; font-size: 13px; }
.ia-event strong { font-size: 14px; }
.ia-event.ia-warn { border-inline-start-color: var(--ia-danger); background: var(--ia-danger-soft); }

/* ================================================================
   آقای ویلا - هم‌شکل فرم قبلی ورود (SMSAuthentication / MrVila)
   رنگ‌ها از متغیرهای قالب سایت (Iransite) خوانده می‌شوند.
   ================================================================ */
.ia {
    --ia-primary: var(--primary-main, #f03e58);
    --ia-primary-hover: var(--primary-main, #f03e58);
    --ia-text: #28293d;
    --ia-muted: var(--secondary-lighter, #6d6d78);
    --ia-border: #dbdbdb;
    --ia-soft: var(--secondary-subtle, #ebebf0);
    --ia-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ia .mv-card {
    width: 35rem;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    background: #fff;
    display: flex;
    flex-direction: column;
    text-align: right;
    overflow: hidden;
}
.mv-card .mv-head {
    display: flex; align-items: center; gap: .57rem;
    padding: 1rem .92rem;
    border-bottom: 1px solid var(--ia-soft);
}
.mv-card .mv-head-title { font-size: 1rem; font-weight: 700; }
.mv-card .mv-close { display: inline-flex; color: var(--ia-text); line-height: 0; }
.mv-card .mv-close:hover { color: var(--ia-primary); }
.mv-card .mv-logo-row {
    display: flex; flex-direction: column; align-items: center; gap: 1.8rem;
    padding: 1.8rem .87rem .87rem;
    border-bottom: 1px solid var(--ia-soft);
}
.mv-card .mv-logo-row img { width: 11rem; max-width: 70%; }
.mv-card .mv-slogan { font-size: .87rem; color: var(--ia-muted); text-align: center; }

.mv-card .ia-step { display: flex; flex-direction: column; flex: 1 1 auto; }
.mv-card .ia-step:not(:has(.mv-body)) { padding: .87rem; }
.mv-card .mv-body { padding: .87rem; }
.ia .mv-card .ia-title { /* h2: صفحه فقط یک h1 داشته باشد (SEO) */ font-size: 14px; line-height: 1.7; font-weight: 700; text-align: right; margin: 0; color: var(--ia-text); }
.mv-card .ia-head .ia-title { padding: 0 40px 0 0; }
.mv-card .mv-tip { margin: .5rem 0 1.72rem; font-size: .92rem; color: var(--ia-muted); }
.mv-card .mv-tip:empty, .mv-card .mv-tip:has(> span:empty) { display: none; }
.mv-card .mv-tip .ia-otp-hint { font-weight: 400; color: var(--ia-muted); }
.mv-card .ia-who { text-align: right; margin: -1.2rem 0 1rem; }
.mv-card .ia-input { height: 44.8px; font-size: .92rem; border-radius: var(--ia-radius); }
.mv-card .ia-input::placeholder { color: #9a9aa5; }
.mv-card .ia-input:focus { border-color: var(--ia-primary); box-shadow: none; }
.mv-card .mv-privacy { margin-top: 1rem; font-size: .92rem; }
.mv-card .mv-privacy a { color: var(--ia-primary); text-decoration: none; }
.mv-card .mv-privacy a:hover { text-decoration: underline; }
.mv-card .ia-links { justify-content: space-between; }
.mv-card .ia-link { font-size: .92rem; }
.mv-card .mv-otp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.mv-card .mv-otp-row .ia-timer { margin: 0; min-height: 0; }
.mv-card .ia-otp { justify-content: center; }
.mv-card .ia-otp-box:focus { box-shadow: none; }
.mv-card .ia-check input { accent-color: var(--ia-primary); }

.mv-card .mv-footer {
    margin-top: auto;
    padding: 1.14rem;
    border-top: 1px solid var(--ia-soft);
    display: flex; gap: .57rem;
}
.mv-card .mv-footer .ia-btn { margin: 0; height: 2.85rem; font-size: 14px; border-radius: var(--ia-radius); }
.mv-card .mv-footer .ia-btn[hidden] { display: none !important; }
.mv-card .ia-primary { background: var(--ia-primary); border-color: var(--ia-primary); }
.mv-card .ia-primary:hover { background: var(--ia-primary); filter: brightness(.95); }
.mv-card .mv-outline { background: transparent; color: var(--ia-primary); border-color: var(--ia-primary); }
.mv-card .mv-outline:hover { background: var(--ia-soft); color: var(--ia-primary); }

.mv-sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* موبایل: تمام‌صفحه و دکمه پایین صفحه، مثل فرم قبلی */
@media screen and (max-width: 768px) {
    .ia { padding: 0; align-items: stretch; }
    .ia .mv-card { width: 100%; min-height: 100vh; border-radius: 0; }
    .mv-card .mv-footer { margin-bottom: 5rem; flex-direction: column-reverse; }
}

/* پنجره‌ی ورود هدر (skin object): بدون تمام‌صفحه */
.ia-modal-dialog .ia { min-height: 0; display: block; padding: 0; }
.ia-modal-dialog .ia .mv-card { width: 100%; min-height: 0; }
.ia-modal-dialog .mv-card .mv-close { display: none; }
@media (max-width: 480px) { .ia-modal-dialog .ia .mv-card { min-height: 100%; } }

/* کادرهای کد: قالب سایت input[type=text] را گوشه‌تیز (radius 0) می‌کند */
.mv-card .ia-otp .ia-otp-box, .ia-modal-dialog .mv-card .ia-otp .ia-otp-box { border-radius: 10px; }
.mv-card input.ia-input { border-radius: var(--ia-radius); }
