/* استانداردسازی فرم‌های ورود، ورود با کد و بازیابی رمز (ظاهر کلی صفحه بدون تغییر؛ فقط فرم‌ها) */
.af-head { width: 350px; margin: 4px auto 12px; text-align: center; }
.af-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: bold; color: #3b1f6e; }
.af-head p { margin: 0; font-size: 12.5px; line-height: 1.9; color: #6b6b80; }

.af-steps { display: flex; gap: 6px; width: 330px; margin: 0 auto 10px; padding: 0; list-style: none; }
.af-steps li { flex: 1; padding-top: 6px; border-top: 3px solid #e4e0ee; font-size: 11px; color: #9a9ab0; text-align: center; }
.af-steps li.done, .af-steps li.active { border-color: #573098; color: #573098; }
.af-steps li.active { font-weight: bold; }

form .form-group input[type=text], form .form-group input[type=password], form .form-group input[type=tel] {
    height: 46px; padding: 8px 12px; border: 1px solid #d6d3e0; border-radius: 10px; background: #fafafe;
    font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
form .form-group input:focus { outline: none; border-color: #573098; background: #fff; box-shadow: 0 0 0 3px rgba(87,48,152,.15); }
form .form-group input.af-icon { padding-right: 38px !important; }
form .form-group input.af-eye-pad { padding-left: 42px !important; }
form .form-group > label { right: 12px; }
form .form-group > label .zmdi { color: #8b84a3; }
form .form-group input:focus ~ label .zmdi, form .form-group input:focus + label .zmdi { color: #573098; }

.af-eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: #8b84a3; cursor: pointer; }
.af-eye:hover, .af-eye:focus { background: #f0ecf8; color: #573098; outline: none; }
.af-eye .zmdi { color: inherit; }

.form-submit { height: 46px; border-radius: 10px; font-size: 15px; font-weight: bold; transition: background-color .15s ease, opacity .15s ease; }
.form-submit:focus { outline: none; box-shadow: 0 0 0 3px rgba(87,48,152,.25); }
.form-submit[disabled] { opacity: .7; cursor: wait; }
.form-submit.af-busy { position: relative; color: transparent !important; }
.form-submit.af-busy:after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: af-spin .7s linear infinite; }
@keyframes af-spin { to { transform: rotate(360deg); } }

.af-hint { display: none; margin: 6px 4px 0; font-size: 12px; color: #b45309; }
.af-hint.show { display: block; }
.af-hint.error { color: #b42318; }

.af-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin: 4px 10px 0; padding-top: 12px; border-top: 1px solid #ece9f3; overflow: visible; }
.af-links .link { display: inline-block; margin: 0; padding: 4px 0; font-size: 13px; }
.af-links .link:hover, .af-links .link:focus { text-decoration: underline; outline: none; }
.af-links.af-secondary { border-top: 0; padding-top: 0; }

/* کد تأیید: شمارندهٔ زمان داخل کادر و ارقام با فاصله */
.af-code input[type=text] { padding-left: 84px !important; padding-right: 12px !important; text-align: center; letter-spacing: 6px; font-size: 20px !important; direction: ltr; }
.af-code input::placeholder { letter-spacing: 0; font-size: 13px; }
.af-code #timer { right: auto; left: 6px; padding: 6px 10px; border-radius: 8px; background: #efeaf8; color: #573098; font-size: 13px; direction: ltr; min-width: 46px; text-align: center; }
.af-code #timer.expired { background: #fdecec; color: #b42318; }

.captcha-wrapper .af-refresh { flex-shrink: 0; width: 36px; height: 40px; border: 1px solid #d6d3e0; border-radius: 8px; background: #fafafe; color: #573098; cursor: pointer; }
.captcha-wrapper input[type=text] { height: 40px; border-radius: 8px; }

.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0 10px 4px; padding: 0; list-style: none; }
.validation-summary-errors ul li { padding: 8px 12px; border: 1px solid #f5c2c2; border-radius: 8px; background: #fdecec; color: #9b1c1c; font-size: 12.5px; line-height: 1.9; }

/* page frame: the form column (right in RTL) fills the height, scrolls on short screens and keeps its content centred;
   the banner takes the rest */
.main { display: flex; }
.main .wrapper {
    position: relative; top: auto; right: auto; left: auto; transform: none; z-index: 2;
    flex: 0 0 440px; width: 440px; height: 100%; margin: 0; padding: 24px 0 14px; box-sizing: border-box;
    display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; border-radius: 0; background: #fff; box-shadow: -1px 0 0 #ece9f3;
}
.side { flex: 1 1 auto; width: auto; float: none; }
/* .form-title has width:100% in style-*.css, so its padding must stay inside that width (no horizontal scroll) */
.af-brand { margin-top: auto; padding: 0 24px 6px; box-sizing: border-box; width: 100%; }
.form-title.af-brand img, .af-logo { display: inline-block; max-height: 72px; max-width: 180px; }
.af-tagline { margin: 6px 0 0; font-size: 13px; line-height: 1.8; color: #6b6b80; }
#wrapper { flex-shrink: 0; }
.af-foot { margin-top: auto; padding: 18px 24px 0; box-sizing: border-box; text-align: center; font-size: 11.5px; color: #9a9ab0; }

/* forgot password under the password field, aligned to the field's end */
.af-row-end { display: flex; justify-content: flex-end; margin: -4px 12px 4px; }
.af-row-end .link { display: inline-block; margin: 0; padding: 2px 0; font-size: 12.5px; }
.af-row-end .link:hover, .af-row-end .link:focus { text-decoration: underline; outline: none; }

/* "or" divider and the secondary sign-in method */
.af-or { display: flex; align-items: center; gap: 10px; margin: 14px 10px 10px; color: #9a9ab0; font-size: 12px; }
.af-or:before, .af-or:after { content: ''; flex: 1; border-top: 1px solid #ece9f3; }
.af-alt {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 20px); height: 44px; margin: 0 10px;
    border: 1px solid #d6d3e0; border-radius: 10px; background: #fff; color: #573098; font-size: 14px; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.af-alt .zmdi { font-size: 18px; }
.af-alt:hover { background: #f6f3fb; border-color: #c9c1de; }
.af-alt:focus { outline: none; box-shadow: 0 0 0 3px rgba(87,48,152,.2); }
.af-alt[disabled] { opacity: .6; cursor: wait; }
.af-or + .af-alt + .af-links.af-secondary { margin-top: 14px; }

/* busy overlay over the form column; after a successful sign-in it turns into "signed in, opening the panel" */
.loader { position: fixed; top: 0; bottom: 0; right: 0; left: auto; width: 440px; z-index: 5; background: rgba(255,255,255,.75); }
.af-redirect { display: none; }
.loader.af-redirecting { background: rgba(255,255,255,.96); }
.loader.af-redirecting .af-loader-img { display: none; }
.loader.af-redirecting .af-redirect {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 0 24px; text-align: center;
}
.af-redirect strong { font-size: 17px; color: #3b1f6e; }
.af-redirect > span:not([class]) { font-size: 13px; color: #6b6b80; }
.af-redirect-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; background: #e7f6ee; color: #12805c; font-size: 30px; }
.af-progress { position: relative; width: 160px; height: 4px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: #ece9f3; }
.af-progress span { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 4px; background: #573098; animation: af-progress 1.2s ease-in-out infinite; }
@keyframes af-progress { from { right: -40%; } to { right: 100%; } }
@media (prefers-reduced-motion: reduce) {
    .af-progress span { animation: none; right: 0; width: 100%; opacity: .5; }
    .form-submit.af-busy:after { animation-duration: 2s; }
}

@media only screen and (max-width: 900px) {
    .af-head, .af-steps { width: auto; max-width: 350px; }
    form { width: auto; max-width: 350px; }
    .main .wrapper { flex: 1 1 auto; width: 100%; padding: 20px 16px 12px; box-shadow: none; background: #fff; }
    .loader { width: auto; left: 0; }
}

.af-head h2, .af-head p, .af-steps li, .af-hint, .af-code #timer, .form-submit, .validation-summary-errors ul li,
.af-tagline, .af-foot, .af-or, .af-alt, .af-redirect, .af-row-end .link { font-family: sahel, NotoSansArabic, tahoma; }
.af-code input::placeholder { text-align: center; }


/* admin password recovery from the server (/recovery) */
.af-box { width: 330px; margin: 0 auto 12px; padding: 10px 12px; border: 1px solid #e4e0ee; border-radius: 10px; background: #fafafe; font-size: 13px; line-height: 1.9; color: #3d3d4e; }
.af-box p { margin: 0 0 6px; }
.af-box.af-success { border-color: #a6e3c0; background: #effaf4; color: #14532d; }
.af-path, .af-filecode { text-align: center; font-family: Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.af-filecode { padding: 6px; border-radius: 8px; background: #f0ecf8; color: #3b1f6e; font-size: 15px; font-weight: bold; letter-spacing: 1px; user-select: all; }
.af-muted { color: #6b6b80; font-size: 12px; }

/* result of a finished step (password changed, registered, signed in with a code) */
.af-done { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 260px; padding: 24px 0; text-align: center; }
.af-done strong { font-size: 18px; color: #3b1f6e; }
.af-done > span:not([class]) { font-size: 13px; color: #6b6b80; }
.af-done .link { margin-top: 10px; }
.af-sent-to { margin-top: 6px; font-size: 13px; color: #3b1f6e; }
.af-sent-to bdi { font-weight: 600; }
