﻿/*
** Dademan login page — self-contained modern layout.
** Loaded only by Views/Customer/Login.cshtml; scoped under .html-login-page
** so it cannot leak into other public pages.
*/

.html-login-page {
    /* match the rest of the system (admin uses Vazirmatn); the theme already
       loads the Vazirmatn @font-face, the card just inherited the theme's
       default body font otherwise */
    font-family: Vazirmatn, Vazir, Tahoma, sans-serif;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(162, 28, 175, .10), transparent 60%),
        radial-gradient(700px 400px at 0% 110%, rgba(109, 40, 217, .10), transparent 60%),
        #f4f2f8;
}

/* the card and its fields use font-family: inherit, so pin the family here too
   in case a bank-specific theme overrides the page body font */
.html-login-page .dd-login-card,
.html-login-page .dd-login-card input,
.html-login-page .dd-login-card button {
    font-family: Vazirmatn, Vazir, Tahoma, sans-serif;
}

.html-login-page .master-wrapper-page,
.html-login-page .master-wrapper-content,
.html-login-page .master-column-wrapper,
.html-login-page .center-1 {
    margin: 0;
    padding: 0;
    max-width: none;
    width: auto;
    float: none;
}

.html-login-page .login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
}

/* the old page-title block is replaced by the brand panel */
.html-login-page .login-page > .page-title {
    display: none;
}

/* ---------- light/dark theme toggle ---------- */

.dd-theme-toggle {
    position: fixed;
    top: 18px;
    inset-inline-start: 18px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border: 1.5px solid rgba(124, 58, 237, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(6px);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6d28d9;
    box-shadow: 0 6px 18px rgba(49, 22, 71, .12);
    transition: transform .12s, background .15s, border-color .15s;
}

.dd-theme-toggle:hover {
    transform: translateY(-1px);
    background: #fff;
}

.dd-theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

/* show the icon of the mode you'll switch TO: moon in light, sun in dark */
.dd-theme-toggle .dd-icon-sun { display: none; }
.dd-theme-toggle .dd-icon-moon { display: block; }

/* the card's wrapper div is a flex item of .login-page; without an explicit
   width it shrinks to fit its content and the card never reaches max-width */
.html-login-page .login-page > div {
    width: 100%;
    max-width: 920px;
}

.dd-login-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 470px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(49, 22, 71, .18);
}

/* ---------- brand panel (right side in RTL) ---------- */

.dd-login-brand {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 40px 28px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(400px 300px at 20% 0%, rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(160deg, #a21caf 0%, #7c3aed 55%, #4c1d95 100%);
}

.dd-login-brand img {
    max-height: 96px;
    max-width: 78%;
    background: #fff;
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.dd-login-brand h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.9;
    color: #fff;
}

.dd-login-brand .dd-login-tag {
    font-size: 12.5px;
    opacity: .85;
}

/* ---------- form panel ---------- */

.dd-login-form {
    flex: 1 1 auto;
    min-width: 0; /* allow the flex panel to shrink despite the theme's fixed widths */
    padding: 44px 42px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* the theme pins the login wrapper/rows to fixed pixel widths — neutralize
   them inside the card so everything sizes to the panel */
.html-login-page .returning-wrapper,
.html-login-page .login-page .form-fields,
.html-login-page .login-page .inputs,
.html-login-page .login-page .buttons {
    width: auto !important;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    float: none;
}

/* the theme draws a gray box around the field block — keep it flat */
.html-login-page .login-page .form-fields {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none;
}

.dd-login-form .dd-login-heading {
    font-size: 18px;
    font-weight: 800;
    color: #1e1b29;
    margin: 0 0 22px;
}

.dd-login-form .message-error,
.dd-login-form .validation-summary-errors {
    background: rgba(220, 38, 38, .08);
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* hide the empty error box asp-validation-summary renders on GET */
.dd-login-form .validation-summary-valid {
    display: none;
}

.dd-login-form .inputs {
    margin-bottom: 16px;
    text-align: right;
}

.dd-login-form .inputs label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #443d59;
    margin-bottom: 6px;
    width: auto;
}

.dd-field {
    position: relative;
}

.dd-field > svg {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: #a19ab5;
    pointer-events: none;
}

.dd-login-form .inputs input[type="text"],
.dd-login-form .inputs input[type="password"],
.dd-login-form .inputs input.username,
.dd-login-form .inputs input.email,
.dd-login-form .inputs input.password {
    width: 100%;
    height: 46px;
    border: 1.5px solid #ddd6ea;
    border-radius: 11px;
    background: #faf9fc;
    padding: 0 14px;
    padding-inline-start: 42px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

/* the password field carries the eye toggle on the end side (left in RTL);
   leave room so a long password never slides under the button */
.dd-login-form .inputs input.password,
.dd-login-form .inputs input#Password {
    padding-inline-end: 44px;
}

.dd-login-form .inputs input:focus {
    outline: none;
    border-color: #a21caf;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(162, 28, 175, .13);
}

.dd-login-form .inputs span.field-validation-error {
    display: block;
    color: #b91c1c;
    font-size: 12px;
    margin-top: 5px;
}

/* eye toggle inside the password field */
.dd-eye {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dd-eye:hover {
    background: rgba(162, 28, 175, .08);
}

.dd-eye svg {
    width: 19px;
    height: 19px;
    stroke: #6d6486;
}

#Password.dd-show {
    -webkit-text-security: none !important;
    text-security: none !important;
}

/* remember me */
.dd-login-form .inputs.reversed {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 2px 0 18px;
}

/* checkbox first (right in RTL), label after it */
.dd-login-form .inputs.reversed input[type="checkbox"] { order: 1; }
.dd-login-form .inputs.reversed label { order: 2; }

.dd-login-form .inputs.reversed input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #a21caf;
    margin: 0;
}

.dd-login-form .inputs.reversed label {
    margin: 0;
    font-weight: 400;
    font-size: 13px;
    color: #5a5470;
    cursor: pointer;
}

/* captcha */
.dd-login-form .captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px !important;
}

.dd-login-form .captcha-box img {
    height: 46px;
    border-radius: 10px;
    border: 1.5px solid #ddd6ea;
    cursor: pointer;
    background: #fff;
}

.dd-login-form .captcha-box input {
    flex: 1 1 auto;
    height: 46px;
    border: 1.5px solid #ddd6ea;
    border-radius: 11px;
    background: #faf9fc;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 4px;
}

.dd-login-form .captcha-box input:focus {
    outline: none;
    border-color: #a21caf;
    box-shadow: 0 0 0 3px rgba(162, 28, 175, .13);
}

/* submit */
.dd-login-form .buttons {
    margin-top: 4px;
}

.dd-login-form .login-button {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #a21caf, #7c3aed);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(124, 58, 237, .35);
    transition: transform .12s, box-shadow .12s, filter .12s;
}

.dd-login-form .login-button:hover {
    filter: brightness(1.06);
    box-shadow: 0 12px 28px rgba(124, 58, 237, .42);
}

.dd-login-form .login-button:active {
    transform: translateY(1px);
    box-shadow: 0 6px 14px rgba(124, 58, 237, .3);
}

/* external authentication (bank SSO buttons) */
.dd-login-form .external-authentication {
    margin-top: 22px;
    text-align: center;
    border: 0;
}

.dd-login-form .external-authentication:not(:empty) {
    padding-top: 4px;
}

/* footer line */
.dd-login-foot {
    text-align: center;
    font-size: 11.5px;
    color: #8d86a3;
    margin-top: 14px;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
    .dd-login-card {
        flex-direction: column;
        min-height: 0;
        max-width: 440px;
    }

    .dd-login-brand {
        flex: 0 0 auto;
        padding: 26px 20px;
        gap: 10px;
    }

    .dd-login-brand img {
        max-height: 64px;
    }

    .dd-login-brand h1 {
        font-size: 17px;
    }

    .dd-login-form {
        padding: 28px 22px 22px;
    }
}

/* ---------- dark mode ----------
   Two triggers, in priority order:
   1. explicit user choice on the login page:
      html:root[data-theme="dark"] / [data-theme="light"]
      (persisted in localStorage by the toggle in Login.cshtml)
   2. otherwise the OS/browser preference, unless the user forced light. */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        background:
        radial-gradient(900px 500px at 85% -10%, rgba(162, 28, 175, .18), transparent 60%),
        radial-gradient(700px 400px at 0% 110%, rgba(109, 40, 217, .20), transparent 60%),
        #14111f;
    }

    :root:not([data-theme="light"]) .dd-login-card {
        background: #1e1a2c;
        box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
    }

    :root:not([data-theme="light"]) .dd-login-form .dd-login-heading {
        color: #f3f0fa;
    }

    :root:not([data-theme="light"]) .dd-login-form .inputs label {
        color: #c9c2dc;
    }

    :root:not([data-theme="light"]) .dd-login-form .inputs input[type="text"],
    :root:not([data-theme="light"]) .dd-login-form .inputs input[type="password"],
    :root:not([data-theme="light"]) .dd-login-form .inputs input.username,
    :root:not([data-theme="light"]) .dd-login-form .inputs input.email,
    :root:not([data-theme="light"]) .dd-login-form .inputs input.password,
    :root:not([data-theme="light"]) .dd-login-form .captcha-box input {
        background: #17141f;
        border-color: #3a3350;
        color: #f3f0fa;
    }

    :root:not([data-theme="light"]) .dd-login-form .inputs input:focus,
    :root:not([data-theme="light"]) .dd-login-form .captcha-box input:focus {
        background: #1b1726;
        border-color: #c084fc;
        box-shadow: 0 0 0 3px rgba(192, 132, 252, .18);
    }

    :root:not([data-theme="light"]) .dd-field > svg {
        stroke: #8b83a6;
    }

    :root:not([data-theme="light"]) .dd-eye svg {
        stroke: #b7aecd;
    }

    :root:not([data-theme="light"]) .dd-eye:hover {
        background: rgba(192, 132, 252, .14);
    }

    :root:not([data-theme="light"]) .dd-login-form .inputs.reversed label {
        color: #b3abc7;
    }

    :root:not([data-theme="light"]) .dd-login-form .message-error,
    :root:not([data-theme="light"]) .dd-login-form .validation-summary-errors {
        background: rgba(220, 38, 38, .16);
        color: #fca5a5;
    }

    :root:not([data-theme="light"]) .dd-login-form .inputs span.field-validation-error {
        color: #fca5a5;
    }

    :root:not([data-theme="light"]) .dd-login-form .captcha-box img {
        border-color: #3a3350;
        background: #f4f2f8; /* captcha image needs a light backdrop to stay legible */
    }

    :root:not([data-theme="light"]) .dd-login-foot {
        color: #8b83a6;
    }
}

:root[data-theme="dark"] {
    background:
    radial-gradient(900px 500px at 85% -10%, rgba(162, 28, 175, .18), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, rgba(109, 40, 217, .20), transparent 60%),
    #14111f;
}

:root[data-theme="dark"] .dd-login-card {
    background: #1e1a2c;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

:root[data-theme="dark"] .dd-login-form .dd-login-heading {
    color: #f3f0fa;
}

:root[data-theme="dark"] .dd-login-form .inputs label {
    color: #c9c2dc;
}

:root[data-theme="dark"] .dd-login-form .inputs input[type="text"],
    :root[data-theme="dark"] .dd-login-form .inputs input[type="password"],
    :root[data-theme="dark"] .dd-login-form .inputs input.username,
    :root[data-theme="dark"] .dd-login-form .inputs input.email,
    :root[data-theme="dark"] .dd-login-form .inputs input.password,
    :root[data-theme="dark"] .dd-login-form .captcha-box input {
    background: #17141f;
    border-color: #3a3350;
    color: #f3f0fa;
}

:root[data-theme="dark"] .dd-login-form .inputs input:focus,
    :root[data-theme="dark"] .dd-login-form .captcha-box input:focus {
    background: #1b1726;
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, .18);
}

:root[data-theme="dark"] .dd-field > svg {
    stroke: #8b83a6;
}

:root[data-theme="dark"] .dd-eye svg {
    stroke: #b7aecd;
}

:root[data-theme="dark"] .dd-eye:hover {
    background: rgba(192, 132, 252, .14);
}

:root[data-theme="dark"] .dd-login-form .inputs.reversed label {
    color: #b3abc7;
}

:root[data-theme="dark"] .dd-login-form .message-error,
    :root[data-theme="dark"] .dd-login-form .validation-summary-errors {
    background: rgba(220, 38, 38, .16);
    color: #fca5a5;
}

:root[data-theme="dark"] .dd-login-form .inputs span.field-validation-error {
    color: #fca5a5;
}

:root[data-theme="dark"] .dd-login-form .captcha-box img {
    border-color: #3a3350;
    background: #f4f2f8; /* captcha image needs a light backdrop to stay legible */
}

:root[data-theme="dark"] .dd-login-foot {
    color: #8b83a6;
}

/* toggle button + icon swap when dark is active (both triggers) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .dd-theme-toggle .dd-icon-sun { display: block; }
    :root:not([data-theme="light"]) .dd-theme-toggle .dd-icon-moon { display: none; }
    :root:not([data-theme="light"]) .dd-theme-toggle {
        background: rgba(30, 26, 44, .7);
        border-color: rgba(192, 132, 252, .35);
        color: #c084fc;
    }
    :root:not([data-theme="light"]) .dd-theme-toggle:hover {
        background: #1e1a2c;
    }
}

:root[data-theme="dark"] .dd-theme-toggle .dd-icon-sun { display: block; }
:root[data-theme="dark"] .dd-theme-toggle .dd-icon-moon { display: none; }
:root[data-theme="dark"] .dd-theme-toggle {
    background: rgba(30, 26, 44, .7);
    border-color: rgba(192, 132, 252, .35);
    color: #c084fc;
}
:root[data-theme="dark"] .dd-theme-toggle:hover {
    background: #1e1a2c;
}
