:root {
    --primary: var(--qc-primary);
    --secondary: var(--qc-secondary);
    --deep: var(--qc-deep);
    --dark: var(--qc-dark);
    --text: var(--qc-text);
    --muted: var(--qc-muted);
    --bg: #f4f8fc;
    --card: rgba(255, 255, 255, 0.92);
    --line: var(--qc-line);
    --danger: var(--qc-danger);
    --shadow: 0 20px 58px rgba(36, 56, 75, 0.13);
    --shadow-sm: 0 12px 32px rgba(36, 56, 75, 0.08);
}

/* =========================================================
   GENERAL
   ========================================================= */

* {
    box-sizing: border-box;
    font-family: "Cairo", sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

html {
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient( circle at top right, rgba(79, 172, 254, 0.18), transparent 32% ), radial-gradient( circle at bottom left, rgba(0, 242, 254, 0.13), transparent 32% ), linear-gradient( 135deg, rgba(0, 242, 254, 0.10) 0%, rgba(79, 172, 254, 0.10) 52%, #ffffff 100% );
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

/* =========================================================
   AUTH PAGE
   ========================================================= */

.auth-page {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    align-items: stretch;
    position: relative;
    overflow: hidden;
}

    /* Decorative background circles */

    .auth-page::before,
    .auth-page::after {
        content: "";
        position: absolute;
        border-radius: 999px;
        background: linear-gradient( 135deg, rgba(79, 172, 254, 0.12), rgba(0, 242, 254, 0.08) );
        pointer-events: none;
        z-index: 0;
    }

    .auth-page::before {
        width: 280px;
        height: 280px;
        top: 95px;
        right: -85px;
    }

    .auth-page::after {
        width: 360px;
        height: 360px;
        bottom: -140px;
        left: -120px;
    }

/* =========================================================
   TWO MAIN SIDES
   ========================================================= */

.auth-visual,
.auth-panel {
    position: relative;
    z-index: 1;
    min-width: 0;
}

/* =========================================================
   VISUAL SIDE
   ========================================================= */

.auth-visual {
    padding: 38px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    overflow: hidden;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--dark);
    font-weight: 900;
    width: fit-content;
    max-width: 100%;
}

.brand-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    background: linear-gradient( 135deg, var(--primary), var(--secondary) );
    box-shadow: 0 12px 28px rgba(79, 172, 254, 0.28);
    position: relative;
    overflow: hidden;
}

    .brand-icon::after {
        content: "";
        position: absolute;
        width: 86px;
        height: 86px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.18);
        top: -46px;
        left: -46px;
    }

.brand-text {
    min-width: 0;
}

    .brand-text strong {
        display: block;
        font-size: 1.45rem;
        line-height: 1.15;
        background: linear-gradient( 135deg, var(--deep), var(--primary) );
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        overflow-wrap: anywhere;
    }

    .brand-text span {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        margin-top: 2px;
    }

/* =========================================================
   HERO
   ========================================================= */

.hero-copy {
    width: 100%;
    max-width: 650px;
    padding: 50px 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    color: var(--deep);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(79, 172, 254, 0.18);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(36, 56, 75, 0.06);
    margin-bottom: 18px;
    line-height: 1.6;
}

.hero-copy h1 {
    margin: 0 0 18px;
    color: var(--dark);
    font-size: clamp(2.15rem, 4vw, 4rem);
    line-height: 1.24;
    font-weight: 900;
    letter-spacing: -0.8px;
    overflow-wrap: anywhere;
}

    .hero-copy h1 span {
        background: linear-gradient( 135deg, var(--primary), var(--secondary) );
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.hero-copy p {
    margin: 0;
    color: #244966;
    font-size: 1.08rem;
    line-height: 2;
    font-weight: 700;
}

/* =========================================================
   VISUAL CARDS
   ========================================================= */

.visual-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 32px;
    width: 100%;
}

.visual-card {
    min-width: 0;
    background: rgba(255, 255, 255, 0.80);
    border: 1px solid rgba(79, 172, 254, 0.14);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    min-height: 120px;
}

    .visual-card i {
        width: 44px;
        height: 44px;
        border-radius: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        background: linear-gradient( 135deg, rgba(79, 172, 254, 0.15), rgba(0, 242, 254, 0.08) );
        margin-bottom: 12px;
        font-size: 19px;
    }

    .visual-card strong {
        display: block;
        color: var(--dark);
        font-weight: 900;
        margin-bottom: 5px;
        overflow-wrap: anywhere;
    }

    .visual-card span {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

/* =========================================================
   MOCKUP
   ========================================================= */

.mockup {
    width: min(520px, 100%);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(79, 172, 254, 0.18);
    border-radius: 34px;
    padding: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-top: 30px;
    position: relative;
}

.mockup-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 4px 16px;
}

.dots {
    display: flex;
    gap: 7px;
    flex: 0 0 auto;
}

    .dots span {
        width: 11px;
        height: 11px;
        border-radius: 50%;
        display: inline-block;
        background: rgba(79, 172, 254, 0.16);
    }

        .dots span:nth-child(1) {
            background: #dc3545;
        }

        .dots span:nth-child(2) {
            background: #ffc107;
        }

        .dots span:nth-child(3) {
            background: #28a745;
        }

.mockup-search {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 999px;
    background: #f4f8fc;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mockup-grid {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
}

.mock-sidebar {
    border-radius: 24px;
    padding: 12px;
    background: linear-gradient( 180deg, var(--deep), #24384b );
    display: grid;
    align-content: start;
    gap: 9px;
}

.mock-link {
    height: 36px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
}

.mock-content {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mock-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 14px;
    min-height: 116px;
}

.mock-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient( 135deg, rgba(79, 172, 254, 0.18), rgba(0, 242, 254, 0.10) );
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 11px;
}

.mock-line {
    height: 10px;
    border-radius: 999px;
    background: rgba(79, 172, 254, 0.10);
    margin-bottom: 8px;
}

    .mock-line.short {
        width: 65%;
    }

/* =========================================================
   FOOTER
   ========================================================= */

.auth-footer {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-top: 26px;
}

/* =========================================================
   LOGIN SIDE
   ========================================================= */

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
    min-height: 100vh;
}

/* =========================================================
   LOGIN CARD
   ========================================================= */

.login-card {
    width: min(100%, 500px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(79, 172, 254, 0.16);
    border-radius: 34px;
    box-shadow: var(--shadow);
    padding: 34px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}

    .login-card::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 6px;
        background: linear-gradient( 135deg, var(--primary), var(--secondary) );
    }

/* =========================================================
   LOGIN HEADER
   ========================================================= */

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    width: 78px;
    height: 78px;
    border-radius: 25px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    background: linear-gradient( 135deg, var(--primary), var(--secondary) );
    box-shadow: 0 15px 34px rgba(79, 172, 254, 0.27);
}

.login-header h2 {
    margin: 0 0 8px;
    color: var(--dark);
    font-size: 1.85rem;
    font-weight: 900;
}

.login-header p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.8;
}

/* =========================================================
   FORM
   ========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: var(--dark);
    font-weight: 900;
}

    .form-label i {
        color: var(--primary);
    }

.input-wrap {
    position: relative;
    width: 100%;
}

.form-control {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    border: 1px solid rgba(79, 172, 254, 0.16);
    border-radius: 18px;
    padding: 13px 16px;
    outline: none;
    background: #fff;
    color: #24384b;
    font-size: 15px;
    font-weight: 700;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 0.22rem rgba(79, 172, 254, 0.16);
    }

/*
   في RTL:
   أيقونة إظهار كلمة المرور موضوعة في اليسار،
   لذلك نترك مساحة داخل الحقل من جهة اليسار.
*/

.password-input {
    padding-left: 58px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 12px;
    background: rgba(79, 172, 254, 0.10);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

    .password-toggle:hover {
        background: rgba(79, 172, 254, 0.16);
    }

    .password-toggle:active {
        transform: translateY(-50%) scale(0.96);
    }

/* =========================================================
   VALIDATION
   ========================================================= */

.field-validation-error,
.text-danger {
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
    margin-top: 7px;
}

/* =========================================================
   REMEMBER / FORGOT
   ========================================================= */

.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 20px;
    flex-wrap: wrap;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-weight: 800;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.forgot-link,
.forgot-password-link {
    color: var(--primary) !important;
    font-weight: 900;
    font-size: 14px;
    transition: color 0.2s ease;
}

    .forgot-link:hover,
    .forgot-password-link:hover {
        color: var(--deep) !important;
    }

/* =========================================================
   LOGIN BUTTON
   ========================================================= */

.btn-login {
    width: 100%;
    border: 0;
    min-height: 54px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient( 135deg, var(--primary), var(--secondary) );
    box-shadow: 0 14px 30px rgba(79, 172, 254, 0.28);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 40px rgba(79, 172, 254, 0.36);
    }

    .btn-login:active {
        transform: translateY(0);
    }

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    border-radius: 18px;
    padding: 13px 15px;
    margin: 16px 0 0;
    font-weight: 800;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.alert-danger {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.10);
    border: 1px solid rgba(220, 53, 69, 0.18);
}

.alert p {
    margin: 0 0 5px;
}

    .alert p:last-child {
        margin-bottom: 0;
    }

/* =========================================================
   REGISTER LINK
   ========================================================= */

.register-link {
    text-align: center;
    margin-top: 22px;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.8;
}

    .register-link a {
        color: var(--primary);
        font-weight: 900;
    }

/* =========================================================
   BACK HOME
   ========================================================= */

.back-home {
    margin-top: 14px;
    text-align: center;
}

    .back-home a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        color: var(--deep);
        font-weight: 900;
        padding: 9px 12px;
        border-radius: 999px;
        transition: background-color 0.22s ease, color 0.22s ease;
    }

        .back-home a:hover {
            background: rgba(79, 172, 254, 0.10);
            color: var(--primary);
        }

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .auth-page {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-visual {
        min-height: auto;
        padding: 30px clamp(20px, 5vw, 44px) 18px;
    }

    .hero-copy {
        padding-top: 36px;
        max-width: 760px;
    }

        .hero-copy h1 {
            font-size: clamp(2rem, 7vw, 3.2rem);
        }

    .auth-footer {
        display: none;
    }

    .auth-panel {
        min-height: auto;
        padding: 20px clamp(20px, 5vw, 44px) 42px;
    }

    .login-card {
        width: min(100%, 620px);
    }

    .visual-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mockup {
        width: min(620px, 100%);
    }
}

/* =========================================================
   MOBILE / SMALL TABLET
   ========================================================= */

@media (max-width: 720px) {

    body {
        background: radial-gradient( circle at top right, rgba(79, 172, 254, 0.16), transparent 34% ), radial-gradient( circle at bottom left, rgba(0, 242, 254, 0.10), transparent 36% ), #f7fbff;
    }

    .auth-page {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

        .auth-page::before {
            width: 190px;
            height: 190px;
            top: 60px;
            right: -95px;
        }

        .auth-page::after {
            width: 220px;
            height: 220px;
            left: -120px;
            bottom: 120px;
        }

    .auth-visual {
        width: 100%;
        padding: 20px 16px 12px;
    }

    .auth-panel {
        width: 100%;
        padding: 10px 16px 28px;
        align-items: flex-start;
    }

    .brand {
        gap: 10px;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 15px;
        font-size: 21px;
    }

    .brand-text strong {
        font-size: 1.25rem;
    }

    .hero-copy {
        padding: 28px 0 8px;
    }

    .hero-badge {
        font-size: 12px;
        padding: 8px 12px;
        margin-bottom: 14px;
    }

    .hero-copy h1 {
        font-size: clamp(1.85rem, 8vw, 2.35rem);
        line-height: 1.35;
        margin-bottom: 13px;
        letter-spacing: -0.3px;
    }

    .hero-copy p {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    .visual-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 20px;
    }

    .visual-card {
        min-height: auto;
        padding: 14px;
        border-radius: 18px;
    }

        .visual-card i {
            width: 40px;
            height: 40px;
            border-radius: 13px;
            margin-bottom: 9px;
        }

    .mockup {
        margin-top: 18px;
        padding: 14px;
        border-radius: 24px;
    }

    .mockup-grid {
        grid-template-columns: 1fr;
    }

    .mock-sidebar {
        display: none;
    }

    .mock-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-card {
        width: 100%;
        max-width: 540px;
        padding: 28px 20px;
        border-radius: 26px;
    }

    .login-header {
        margin-bottom: 22px;
    }

    .login-icon {
        width: 66px;
        height: 66px;
        border-radius: 21px;
        font-size: 26px;
        margin-bottom: 13px;
    }

    .login-header h2 {
        font-size: 1.55rem;
    }

    .login-header p {
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-control {
        min-height: 52px;
        border-radius: 15px;
        font-size: 14px;
    }

    .btn-login {
        min-height: 52px;
        border-radius: 15px;
    }

    .remember-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .auth-visual {
        padding: 16px 14px 8px;
    }

    .auth-panel {
        padding: 8px 14px 24px;
    }

    .brand-text span {
        display: none;
    }

    .brand-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 14px;
        font-size: 19px;
    }

    .brand-text strong {
        font-size: 1.18rem;
    }

    .hero-copy {
        padding-top: 22px;
    }

        .hero-copy h1 {
            font-size: clamp(1.7rem, 9vw, 2.05rem);
            margin-bottom: 11px;
        }

        .hero-copy p {
            font-size: 0.90rem;
            line-height: 1.85;
        }

    /*
       في شاشة الهاتف لا نحتاج العناصر الزخرفية الكبيرة.
       إبقاؤها مخفية يجعل نموذج الدخول هو العنصر الأساسي
       ويمنع طول الصفحة الزائد.
    */

    .visual-cards {
        display: none;
    }

    .mockup {
        display: none;
    }

    .login-card {
        padding: 25px 17px 22px;
        border-radius: 23px;
    }

        .login-card::before {
            height: 5px;
        }

    .login-icon {
        width: 60px;
        height: 60px;
        border-radius: 19px;
        font-size: 23px;
    }

    .login-header h2 {
        font-size: 1.42rem;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 7px;
    }

    .form-control {
        min-height: 50px;
        padding: 11px 13px;
        font-size: 14px;
    }

    .password-input {
        padding-left: 54px;
    }

    .password-toggle {
        width: 34px;
        height: 34px;
        left: 10px;
    }

    .btn-login {
        min-height: 50px;
        font-size: 15px;
    }

    .register-link {
        font-size: 13px;
        margin-top: 18px;
    }

    .back-home {
        margin-top: 10px;
    }
}

/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .auth-visual {
        padding-left: 12px;
        padding-right: 12px;
    }

    .auth-panel {
        padding-left: 10px;
        padding-right: 10px;
    }

    .login-card {
        padding: 23px 14px 20px;
    }

    .hero-copy h1 {
        font-size: 1.62rem;
    }

    .hero-copy p {
        font-size: 0.86rem;
    }

    .login-header h2 {
        font-size: 1.32rem;
    }

    .remember-row {
        font-size: 12px;
    }
}

/* =========================================================
   LANDSCAPE PHONE
   ========================================================= */

@media (max-height: 600px) and (orientation: landscape) {

    .auth-page {
        min-height: auto;
    }

    .auth-visual,
    .auth-panel {
        min-height: auto;
    }

    .hero-copy {
        padding-top: 20px;
    }

    .visual-cards,
    .mockup {
        display: none;
    }

    .auth-panel {
        padding-bottom: 24px;
    }
}
