#cslogin {
    --cs-primary: #2563eb;
    --cs-primary-dark: color-mix(in srgb, var(--cs-primary) 86%, #111827);
    --cs-ring: color-mix(in srgb, var(--cs-primary) 24%, transparent);
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    direction: rtl;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

#cslogin *,
#cslogin *::before,
#cslogin *::after {
    box-sizing: border-box;
}

#cslogin input,
#cslogin button {
    font-family: inherit;
}

.cs-auth-card {
    width: 100%;
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
}

.cs-auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    text-align: center;
}

.cs-auth-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid #eef2f7;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.cs-auth-header h2 {
    margin: 8px 0 0;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
}

.cs-auth-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

.cs-auth-card.is-otp-step .cs-auth-header {
    margin-bottom: 16px;
}

.cs-auth-card.is-otp-step .cs-auth-header h2,
.cs-auth-card.is-otp-step .cs-auth-header p {
    display: none;
}

.cs-form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cs-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-field label,
.cs-wrapper-text label {
    color: #374151;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.cs-otp-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 2px;
    text-align: center;
}

.cs-otp-heading h3 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.45;
}

.cs-otp-heading p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.8;
}

.cs-bale-inline-logo {
    display: inline-block;
    width: auto;
    height: 40px;
    margin: 0 4px;
    vertical-align: middle;
}

#cslogin input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    line-height: 48px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#cslogin input[type="text"]::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

#cslogin input[type="text"]:focus {
    border-color: var(--cs-primary);
}

#CsLoginForm input[name="mobile"],
#CsOtpForm input[name="otp"] {
    direction: ltr;
    text-align: center;
    letter-spacing: 0.08em;
    word-spacing: 0.35em;
    padding-left: calc(14px + 0.08em);
    font-size: 18px;
    font-weight: 800;
}

#CsOtpForm input[name="otp"] {
    letter-spacing: 0.12em;
    word-spacing: 0.5em;
    padding-left: calc(14px + 0.12em);
    font-size: 20px;
}

#CsLoginForm input[name="mobile"]::placeholder,
#CsOtpForm input[name="otp"]::placeholder {
    letter-spacing: 0;
    word-spacing: normal;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
}

#CsLoginForm input[name="mobile"]:placeholder-shown,
#CsOtpForm input[name="otp"]:placeholder-shown {
    letter-spacing: 0;
    word-spacing: normal;
    font-size: 15px;
    font-weight: 500;
}

#cslogin button[type="submit"] {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--cs-primary);
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    box-shadow: 0 12px 22px color-mix(in srgb, var(--cs-primary) 28%, transparent);
}

#cslogin button[type="submit"]:hover {
    background: var(--cs-primary-dark);
    transform: translateY(-1px);
}

#cslogin button[type="submit"]:disabled,
#cslogin button[type="button"]:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

#CsToastMsg img {
    display: none;
}

#CsToastMsg img.active {
    display: inline-block;
}

div#CsToastMsg p {
    margin-bottom: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

div#CsToastMsg .wrapperToast {
    display: flex;
    gap: 8px;
    align-items: center;
}

#CsToastMsg.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

div#CsToastMsg {
    visibility: hidden;
    width: max-content;
    max-width: min(92vw, 420px);
    padding: 10px 12px;
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
    transition: all 0.25s ease;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    z-index: 9999;
}

#CsOtpForm {
    display: none;
}

#CsSendOtpBySms {
    display: none;
}

.cs-otp-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding-top: 2px;
}

#cslogin #CsSendOtpBySms.cs-secondary-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    min-height: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--cs-primary) 28%, #d1d5db);
    border-radius: 10px;
    padding: 0 14px;
    background: color-mix(in srgb, var(--cs-primary) 8%, #ffffff);
    color: var(--cs-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

#cslogin #CsSendOtpBySms.cs-secondary-button:hover,
#editMobleNumber:hover,
#countdownText:hover {
    color: var(--cs-primary-dark);
}

#cslogin #CsSendOtpBySms.cs-secondary-button:hover {
    border-color: var(--cs-primary);
    background: color-mix(in srgb, var(--cs-primary) 12%, #ffffff);
    transform: translateY(-1px);
}

#cslogin #CsSendOtpBySms.cs-secondary-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--cs-ring);
}

#editMobleNumber,
#countdownText {
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

#countdownText {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0 12px;
    background: #f9fafb;
    color: #4b5563;
    white-space: nowrap;
}

#countdownText.is-ready {
    border-color: color-mix(in srgb, var(--cs-primary) 30%, #d1d5db);
    background: color-mix(in srgb, var(--cs-primary) 8%, #ffffff);
    color: var(--cs-primary);
}

.cs-wrapper-text.side-by-side {
    justify-content: flex-start;
}

.cs-wrapper-text {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

@media (max-width: 480px) {
    #cslogin {
        max-width: 100%;
    }

    .cs-auth-card {
        padding: 22px;
        border-radius: 14px;
    }

    .cs-auth-header h2 {
        font-size: 20px;
    }

    .cs-otp-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #countdownText,
    #cslogin #CsSendOtpBySms.cs-secondary-button {
        width: 100%;
    }
}
