@font-face {
    font-family: 'vazir';
    src: url("./fonts/Vazir-FD.woff");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body.login-page {
    min-height: 100%;
    background: #0d0d0d;
}

body.login-page {
    font-family: vazir, "vazir", Tahoma, sans-serif;
    color: #f5f5f5;
    overflow-x: hidden;
}

body.login-page h1,
body.login-page h2,
body.login-page p,
body.login-page label {
    color: inherit;
    float: none;
}

body.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.login-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(212, 175, 55, 0.16), transparent 55%),
        linear-gradient(180deg, #161616 0%, #0d0d0d 42%, #0a0a0a 100%);
    padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}

.login-shell {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 36px);
    min-height: calc(100dvh - 36px);
}

.login-brand {
    text-align: center;
    padding-top: 12px;
}

.login-mark {
    width: 92px;
    height: 92px;
    margin: 8px auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, rgba(232, 197, 71, 0.28), rgba(13, 13, 13, 0) 68%);
    box-shadow: 0 0 34px rgba(212, 175, 55, 0.22);
}

.login-mark-sm {
    width: 64px;
    height: 64px;
    margin: 0 auto 6px;
}

.login-mark-icon {
    width: 74px;
    height: 74px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.login-mark-sm .login-mark-icon {
    width: 40px;
    height: 40px;
}

.login-brand-name {
    color: #d4af37 !important;
    letter-spacing: 0.28em;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.login-arc {
    height: 28px;
    margin: 10px -8px 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 0 0 50% 50%;
    box-shadow: 0 10px 18px -12px rgba(232, 197, 71, 0.7);
}

.login-headings {
    text-align: center;
    margin: 18px 0 36px;
}

.login-headings h1 {
    color: #ffffff !important;
    font-size: 34px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.login-headings p {
    color: #9a9a9a !important;
    font-size: 14px;
    margin: 0;
}

#div-form {
    display: none;
    flex-direction: column;
    gap: 28px;
    margin: 0;
    text-align: right;
}

#div-form.is-visible {
    display: flex;
}

#div-form input[type="hidden"] {
    display: none;
}

.login-field {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    float: none !important;
    padding: 0;
    color: inherit;
}

.login-field-control {
    position: relative;
}

.login-field .login-field-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: #d4af37;
    pointer-events: none;
    z-index: 2;
}

.login-field .login-field-icon svg {
    width: 100%;
    height: 100%;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #d4af37;
    padding: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
}

.password-toggle svg {
    width: 22px;
    height: 22px;
}

.password-toggle .icon-eye-off,
.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

.login-page .input-form,
.login-page .input-form:focus,
.login-page input.form-control,
.login-page input.form-control:focus {
    -webkit-appearance: none;
    appearance: none;
    height: 56px !important;
    border: 0 !important;
    border-radius: 22px !important;
    background: #1a1a1a !important;
    color: #f3f3f3 !important;
    box-shadow: none !important;
    padding: 0 22px 0 54px !important;
    font-size: 16px;
    letter-spacing: 0;
    text-align: right;
    direction: rtl;
}

.login-field:has(.password-toggle) .input-form,
.login-field:has(.password-toggle) .input-form:focus {
    padding-right: 48px !important;
}

.field-error {
    display: none;
    margin: 8px 10px 0 0;
    color: #f0b4b4;
    font-size: 12px;
    text-align: right;
    line-height: 1.6;
}

.login-field.is-invalid .field-error {
    display: block;
}

.login-field.is-invalid .input-form,
.login-field.is-invalid .input-form:focus {
    box-shadow: 0 0 0 1px rgba(237, 88, 88, 0.7) !important;
}

.login-page .input-form::placeholder {
    color: #8b8b8b !important;
}

.login-page .input-form:focus {
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.45) !important;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 4px 8px;
}

.forgot-link {
    color: #d4af37;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.forgot-link:hover {
    color: #f0d56c;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4af37 !important;
    font-size: 12px;
    margin: 0;
    float: none;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d4af37;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.remember-me input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #d4af37;
    border-width: 0 1.6px 1.6px 0;
    transform: rotate(45deg);
}

.login-page .btn-login {
    position: relative;
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 28px !important;
    margin-top: 12px;
    color: #1a1408 !important;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(90deg, #8b6914 0%, #e8c547 42%, #f6e7a0 50%, #e8c547 58%, #8b6914 100%);
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page .btn-login:hover,
.login-page .btn-login:focus {
    color: #1a1408 !important;
    box-shadow: 0 10px 28px rgba(201, 162, 39, 0.42);
}

.login-page .btn-login:disabled {
    opacity: 0.75;
}

.login-page .btn-login i {
    position: absolute;
    right: 22px;
    font-size: 14px;
    color: #1a1408;
    transform: none;
}

.login-page .messages {
    list-style: none;
    margin: 8px 0 0 !important;
    padding: 12px 14px;
    background: rgba(120, 24, 24, 0.35);
    border: 1px solid rgba(237, 88, 88, 0.45);
    border-radius: 14px;
    color: #ffd2d2;
    font-size: 13px;
    text-align: center;
}

.login-footer {
    margin-top: auto;
    padding-top: 28px;
    text-align: center;
    color: #b08d2e !important;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.pwa-install-panel {
    display: none;
    width: 100%;
    background: #141414;
    border-radius: 24px;
    padding: 22px 20px 8px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.08);
    text-align: center;
}

.pwa-install-title {
    color: #ffffff !important;
    font-size: 22px;
    margin: 0 0 8px;
    font-weight: 700;
}

.pwa-popup-copy {
    color: #9a9a9a !important;
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.8;
}

#install-android,
#install-ios {
    display: none;
}

.ol_help {
    text-align: right;
    padding: 0 4px 0 0;
    margin: 0 0 16px;
    color: #d6d6d6;
}

.ol_help li {
    color: #cfcfcf;
    font-size: 14px;
    margin: 8px 18px 8px 0;
    line-height: 1.7;
}

.ol_help .icon {
    color: #d4af37;
    font-size: 16px;
}

.pwa-share-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    filter: invert(78%) sepia(62%) saturate(500%) hue-rotate(6deg) brightness(92%);
}

.login-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    background: #1a1a1a;
    color: #f0d56c;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 16px;
    padding: 10px 16px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    z-index: 40;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media only screen and (max-width: 900px) {
    body.login-page {
        background-color: #0d0d0d;
    }
}
