body {
    background-image: url('/build/assets/imgs/login-background.png') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: "IBMPlexSansArabic", 'Segoe UI', Tahoma, sans-serif;
    overflow: auto;
}

#aspnetForm {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

#mainPage {
    width: 100%;
    max-width: 1440px;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: center;
    padding: 40px;
    position: relative;
    z-index: 1;
    gap: 0;
    direction: rtl;
    margin: 0 auto;
}

/* ========== Login Card ========== */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 480px;
    min-width: 340px;
    padding: 40px 36px;
    text-align: right;
    position: relative;
    z-index: 2;
    transition: box-shadow 0.3s ease;
    direction: rtl;
}

    .login-card:hover {
        box-shadow: 0 4px 32px rgba(0, 0, 0, 0.09);
    }

/* ========== Municipality Logo (Left Side in RTL) ========== */
.login-brand {
    display: flex;
    justify-content: center;
    flex-direction: column;
    color: white;
    max-width: 500px;

    h1{
        font-weight: bold;
        margin: 0;
    }
}

    .login-brand img {
        width: 180px;
        max-width: 100%;
        height: auto;
        display: block;
    }

/* ========== Nafath SSO Banner ========== */
.nafath-banner {
    background: #eef7f2;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

    .nafath-banner:hover {
        background-color: #e2f0e8;
        transform: translateY(-1px);
    }

    .nafath-banner img {
        width: 70px;
        height: auto;
        margin-bottom: 10px;
    }

.nafath-banner-text {
    font-size: 15px;
    font-weight: 600;
    color: #21885b;
    margin: 0;
}

/* ========== Divider with "أو" ========== */
.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 12px;
}

    .login-divider::before,
    .login-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #e0e0e0;
    }

    .login-divider span {
        font-size: 14px;
        color: #888;
        font-weight: 500;
        white-space: nowrap;
    }

/* ========== Form Elements ========== */
.form-group {
    margin-bottom: 18px;
    text-align: right;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
    display: block;
}

    .form-label .required {
        color: #e53935;
        margin-right: 2px;
    }

.input-wrapper {
    position: relative;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-align: right;
    font-family: inherit;
    box-sizing: border-box;
}

    .form-control-custom:focus {
        border-color: #21885b;
        outline: none;
        box-shadow: 0 0 0 3px rgba(33, 136, 91, 0.1);
        background-color: #fff;
    }

.toggle-password {
    position: absolute;
    left: 12px;
    top: 40%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    font-size: 16px;
    background: none;
    border: none;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}

    .toggle-password:hover {
        color: #666;
    }

/* ========== Buttons ========== */
.btn-login {
    background-color: #21885b;
    color: #fff;
    border: none;
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 6px;
}

    .btn-login:hover {
        background-color: #1a6e4a;
    }

    .btn-login:active {
        transform: scale(0.99);
    }

/* ========== Links ========== */
.reset-password {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #21885b;
    font-weight: 600;
    margin-bottom: 20px;
    text-decoration: none;
    transition: color 0.2s;
}

    .reset-password:hover {
        color: #166a3e;
        text-decoration: underline;
    }

.create-account {
    text-align: center;
    font-size: 14px;
    color: #777;
    margin-top: 22px;
}

    .create-account a {
        color: #21885b;
        font-weight: 600;
        text-decoration: none;
        transition: color 0.2s;
    }

        .create-account a:hover {
            color: #166a3e;
            text-decoration: underline;
        }

/* ========== Screen Views (Login / OTP / Nafath) ========== */
.login-view {
    display: none;
    animation: viewFadeIn 0.35s ease-out;
}

    .login-view.active {
        display: block;
    }

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Back Button ========== */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #f5f5f5;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.2s;
    float: right;
}

    .back-btn:hover {
        background: #ddd;
        border-color: #f5f5f5;
        color: #333;
    }

/* ========== Nafath Verification Screen ========== */
.nafath-header {
    text-align: center;
    margin-bottom: 16px;
}

    .nafath-header img {
        width: 64px;
        margin-bottom: 12px;
    }

.nafath-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

    .nafath-title .green {
        color: #21885b;
    }

.nafath-subtitle {
    font-size: 13px;
    color: #888;
    line-height: 1.8;
    text-align: center;
    margin: 10px 0 24px;
}

/* ========== OTP Screen ========== */
.otp-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 16px;
}

/* ========== App Download Section ========== */
.app-download-section {
    border-top: 1px solid #e5e5e5;
    margin-top: 28px;
    padding-top: 20px;
    text-align: center;
}

.app-download-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
}

.app-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.app-badge-img {
    height: 40px;
    width: auto;
    border-radius: 6px;
    transition: transform 0.15s ease, opacity 0.2s;
}

    .app-badge-img:hover {
        transform: scale(1.04);
        opacity: 0.9;
    }

/* ========== Nafath Logo SVG (inline) ========== */
.nafath-logo-svg {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
}

.nafath-logo-lg {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
}

/* ========== Nafath Dynamic Details ========== */
.nafath-number-box {
    font-size: 36px;
    font-weight: 700;
    color: #21885b;
    background: #eef7f2;
    border: 2px dashed #21885b;
    border-radius: 12px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 16px;
}

.nafath-instruction {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    text-align: center;
}

    .nafath-instruction .green {
        color: #e53935;
        /* Using red for countdown looks good, or green */
        font-weight: 700;
    }

/* ========== Clearfix ========== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
    #mainPage {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
        padding: 40px 20px !important;
        justify-content: center !important;
    }
    
    .login-brand{
        align-items: center;
  text-align: center;

  h1{
    font-size: 30px;
  }
    }

    .login-brand img {
        max-width: 200px;
    }

    .login-card {
        max-width: 460px;
    }
}

@media (max-width: 576px) {
    #mainPage {
        padding: 20px 16px;
        gap: 24px;
    }

    .login-card {
        min-width: 0;
        padding: 28px 20px;
        border-radius: 12px;
    }

    .login-brand img {
        max-width: 130px;
    }

    .nafath-banner {
        padding: 18px 14px;
    }

    .btn-login {
        padding: 12px;
        font-size: 15px;
    }
}


.alert {
    padding: 15px;
    margin-bottom: 20px;
    vertical-align: middle;
}

.alert-danger {
    background: #FEF3F2;
    border-bottom: 2px solid #B42318;
    color: #B42318 !important;
    display: flex;
    align-items: center;
    gap: 5px;
}

#lblMessage {
    color: #B42318 !important;
}

.alert-danger::before {
    content: "ⓘ";
    font-size: 16px;
    
}

    .alert-danger span {
        font-weight: bold;
    }


.error {
    color: #b42318 !important;
    font-size: 13px;
}

    .error::before {
        content: "ⓘ";
        font-size: 16px;
        margin-left: 5px;
    }