/* Auth login — card layout + left panel matching design */

:root {
    --qc-main: #1a314c;
    --qc-brand: #234e7a;
    --qc-surface: #ffffff;
    --qc-input-bg: #f3f5f7;
    --qc-stroke: #e2e8f0;
    --qc-text: #1a202c;
    --qc-para: #718096;
    --qc-error: #c70036;
    --qc-radius-m: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
    width: 100%;
    min-height: 100%;
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.qc-body {
    background: #dce3ea;
    color: var(--qc-text);
    min-height: 100vh;
}

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

.qc-auth-shell {
    width: min(1120px, 100%);
    min-height: min(680px, calc(100vh - 48px));
    display: flex;
    flex-direction: row;
    direction: ltr;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.qc-auth-sidebar {
    flex: 1.08;
    position: relative;
    color: #fff;
    background-color: #0f2744;
    background-image: var(--qc-login-bg, none);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.qc-auth-sidebar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(12, 28, 48, 0.88) 0%, rgba(12, 28, 48, 0.72) 42%, rgba(12, 28, 48, 0.28) 100%);
    pointer-events: none;
}

.qc-auth-sidebar-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 44px 28px 36px 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* keep cards on physical left */
    justify-content: flex-start;
    gap: 28px;
    direction: ltr;
    text-align: left;
    align-self: stretch;
    overflow: hidden;
}

/* Main card: logo only — stays LEFT, LTR positioning */
.qc-auth-promo-card {
    width: max-content;
    max-width: 100%;
    margin: 0;
    margin-left: 0;
    margin-right: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    direction: ltr;
    flex: 0 0 auto;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/*
  Content card: everything from "جودة أعلى" through dots.
  Width is driven by the wider "جودة أعلى" line; other text wraps inside.
*/
.qc-auth-content-card {
    width: max-content;
    max-width: 100%;
    margin: 0;
    margin-left: 0;
    margin-right: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    direction: ltr;
    flex: 1;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.qc-auth-content-card > .qc-auth-features,
.qc-auth-content-card > .qc-auth-dots,
.qc-auth-content-card .qc-auth-hero-lead {
    width: 0;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.qc-auth-content-card > .qc-auth-hero {
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
}

/* Arabic text inside both left cards */
.qc-auth-promo-card h2,
.qc-auth-promo-card p,
.qc-auth-content-card h1,
.qc-auth-content-card h3,
.qc-auth-content-card p {
    margin: 0;
    direction: rtl;
    text-align: right;
    unicode-bidi: isolate;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.qc-auth-logo-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    direction: ltr; /* logo stays on left of brand text */
    justify-content: flex-start;
}

.qc-auth-logo-copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: max-content;
    flex: 0 0 auto;
    direction: rtl;
    text-align: right;
}

.qc-auth-logo-img {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.qc-auth-logo-img--dark,
.qc-auth-logo-img--color {
    filter: none;
}

.qc-auth-logo-img--dark {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
}

.qc-auth-logo-sidebar h2,
.qc-auth-brand h2 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.qc-auth-logo-sidebar p,
.qc-auth-brand p {
    font-size: 12px;
    opacity: 1;
    font-weight: 500;
    white-space: nowrap;
}

.qc-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--qc-main);
    text-align: center;
}

.qc-auth-brand > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    direction: rtl;
}

.qc-auth-brand p {
    color: inherit;
    opacity: 1;
}

.qc-auth-hero {
    direction: rtl;
    text-align: right;
    margin-top: 72px;
}

.qc-auth-hero h1 {
    font-size: clamp(1.5rem, 2.8vw + 1rem, 2.625rem);
    font-weight: 700;
    line-height: 1.28;
    margin-bottom: 14px !important;
    width: max-content;
    max-width: 100%;
    text-align: right;
}

.qc-auth-hero-line1,
.qc-auth-hero-line2 {
    display: inline-block;
    font-weight: inherit;
    line-height: inherit;
    max-width: 100%;
}

/* Main width driver of the card — scales down on smaller screens */
.qc-auth-hero-line1 {
    font-size: clamp(1.75rem, 3.5vw + 0.75rem, 3.125rem);
    letter-spacing: clamp(0.06em, 0.6vw, 0.36em);
    white-space: nowrap;
}

.qc-auth-hero-line2 {
    font-size: clamp(1.5rem, 3vw + 0.6rem, 2.625rem);
    letter-spacing: clamp(0.04em, 0.45vw, 0.28em);
    white-space: nowrap;
}

.qc-auth-hero-lead,
.qc-auth-hero p {
    font-size: clamp(0.75rem, 0.4vw + 0.7rem, 0.8125rem);
    line-height: 1.7;
    opacity: 0.92;
    font-weight: 400;
}

.qc-auth-features {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin-top: auto;
    direction: ltr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/*
  Horizontal item: icon (left column) | Arabic text (right column).
  Grid keeps physical left→right order regardless of page RTL.
*/
.qc-auth-feature {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    direction: ltr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.qc-auth-feature-icon {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    margin-top: 1px;
    box-sizing: border-box;
}

.qc-auth-feature-svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Arabic text block immediately to the right of the icon (LTR row layout) */
.qc-auth-feature-copy {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    direction: rtl;
    text-align: left;
    box-sizing: border-box;
}

.qc-auth-feature-copy h3,
.qc-auth-feature-copy p,
.qc-auth-feature-desc {
    direction: rtl;
    text-align: left;
    unicode-bidi: isolate;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 100%;
}

.qc-auth-feature h3 {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;
    margin: 0;
}

.qc-auth-feature-desc,
.qc-auth-feature p {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.45;
    white-space: normal;
    margin: 0;
}

.qc-auth-dots {
    display: flex;
    gap: 7px;
    justify-content: flex-start; /* stay on left of card */
    align-items: center;
    width: 100%;
    direction: ltr;
}

.qc-auth-dots .dot {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
}

.qc-auth-dots .dot.active {
    width: 28px;
    background: #fff;
}
.qc-auth-form-container {
    flex: 0.92;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px 28px;
    background: #fff;
    direction: rtl;
    text-align: right;
    position: relative;
}

.qc-auth-lang {
    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 2;
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    height: 42px;
    border: 1.2px solid #b3b3b3;
    border-radius: 999px;
    background: #fff;
    direction: ltr;
    overflow: hidden;
}

.qc-auth-lang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    height: 100%;
    padding: 0 16px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    color: #565656;
    box-sizing: border-box;
}

.qc-auth-lang a:first-child {
    border-radius: 999px 0 0 999px;
}

.qc-auth-lang a:last-child {
    border-radius: 0 999px 999px 0;
}

.qc-auth-lang a[lang="ar"] {
    font-size: 17px;
    min-width: 55px;
    padding: 0 16px;
    transform: translateY(-1px);
}

.qc-auth-lang a.on {
    background: #17324c;
    color: #fff;
}

.qc-auth-lang a.off:hover {
    background: rgba(36, 108, 167, .15);
    color: #17324c;
}

.qc-auth-card {
    width: 100%;
    max-width: none;
    padding: 0 8px;
}

.qc-auth-card h1 {
    font-size: clamp(1.35rem, 1.5vw + 1rem, 1.75rem);
    font-weight: 700;
    color: #1b2537;
    margin-bottom: 10px;
    text-align: right;
    line-height: 1.35;
}

.qc-auth-lead {
    font-size: clamp(0.8rem, 0.5vw + 0.7rem, 0.875rem);
    font-weight: 500;
    color: #7d8592;
    margin-bottom: 28px !important;
    text-align: right;
    line-height: 1.7;
}

.qc-auth-card > p:not(.qc-auth-lead) {
    font-size: 13px;
    color: var(--qc-para);
    margin-bottom: 24px;
    text-align: center;
}

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

.qc-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1b2537;
    margin-bottom: 8px;
}

.qc-form-control-group { position: relative; }

.qc-form-leading-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--qc-para);
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.qc-form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--qc-stroke);
    border-radius: var(--qc-radius-m);
    background: var(--qc-input-bg);
    color: var(--qc-text);
    transition: border-color .2s ease, box-shadow .2s ease;
    font-family: inherit;
}

.qc-form-control--icon { padding-right: 42px; }
.qc-form-control--toggle { padding-left: 42px; }

.qc-form-control:focus {
    outline: none;
    border-color: var(--qc-brand);
    box-shadow: 0 0 0 3px rgba(26, 49, 76, 0.12);
    background: #fff;
}

.qc-form-control::placeholder { color: #a0aec0; transition: opacity .12s ease; }
.qc-form-control:focus::placeholder,
.qc-form-control:not(:placeholder-shown)::placeholder {
    opacity: 0;
    color: transparent;
}

.qc-form-control-icon {
    position: absolute;
    left: 12px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5568;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    font-size: 18px;
    border-radius: 8px;
}
.qc-form-control-icon:hover,
.qc-form-control-icon.on {
    color: var(--qc-brand, #1a314c);
    background: rgba(26, 49, 76, 0.08);
}
.qc-form-control-icon i.fe { pointer-events: none; line-height: 1; }
.qc-form-control-group input[type="password"]::-ms-reveal,
.qc-form-control-group input[type="password"]::-ms-clear {
    display: none;
}

.qc-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.qc-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0;
}

.qc-form-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1b304a;
}

.qc-forgot {
    font-size: 13px;
    color: #3a5b80;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.qc-forgot:hover { color: #1b304a; text-decoration: underline; }

.qc-auth-signup {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    direction: rtl;
}

.qc-auth-signup a {
    color: #3a5b80;
    font-weight: 600;
    text-decoration: none;
    margin-right: 4px;
}

.qc-auth-signup a:hover {
    color: #1b304a;
    text-decoration: underline;
}

.qc-auth-sep {
    margin: 0 6px;
    color: #a0aec0;
}

.qc-auth-email-highlight {
    display: inline-block;
    color: var(--qc-main);
    font-weight: 700;
    direction: ltr;
    unicode-bidi: plaintext;
}

.qc-otp-dev-hint {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: var(--qc-radius-m);
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
}

.qc-otp-dev-hint strong {
    display: inline-block;
    letter-spacing: 0.28em;
    font-size: 1.25rem;
    margin-inline-start: 6px;
}

.qc-otp-dev-hint span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    opacity: 0.9;
}

.qc-form-control--otp {
    text-align: center;
    letter-spacing: 0.35em;
    font-size: 18px;
    font-weight: 600;
}

.qc-auth-resend-form {
    margin-top: 12px;
    text-align: center;
}

.qc-auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #3a5b80;
    cursor: pointer;
    text-decoration: none;
}

.qc-auth-link-btn:hover {
    color: #1b304a;
    text-decoration: underline;
}

.qc-btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--qc-radius-m);
    cursor: pointer;
    transition: all .2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qc-btn-primary {
    background: var(--qc-main);
    color: #fff;
}
.qc-btn-primary:hover {
    background: var(--qc-brand);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(26, 49, 76, 0.28);
}

.qc-form-error {
    font-size: 12px;
    color: var(--qc-error);
    margin-top: 6px;
}

.qc-form-link {
    text-align: center;
    font-size: 13px;
    margin-top: 14px;
    color: var(--qc-para);
}
.qc-form-link a {
    color: var(--qc-main);
    text-decoration: none;
    font-weight: 600;
}

.qc-session-status {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: var(--qc-radius-m);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid #a7f3d0;
}

.qc-auth-footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--qc-para);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .qc-auth-hero-line1,
    .qc-auth-hero-line2 {
        white-space: normal;
    }

    .qc-auth-feature h3 { font-size: 13px; }
    .qc-auth-feature-desc,
    .qc-auth-feature p { font-size: 11px; }
}

@media (max-width: 900px) {
    .qc-auth-shell {
        flex-direction: column;
        min-height: auto;
    }

    .qc-auth-sidebar {
        min-height: 300px;
    }

    .qc-auth-sidebar-content {
        padding: 28px 20px 24px 24px;
        gap: 20px;
    }

    .qc-auth-promo-card,
    .qc-auth-content-card {
        max-width: 100%;
    }

    .qc-auth-content-card {
        gap: 18px;
    }

    .qc-auth-features,
    .qc-auth-dots {
        display: none;
    }

    .qc-auth-logo-sidebar h2,
    .qc-auth-brand h2 { font-size: 14px; }

    .qc-auth-logo-sidebar p,
    .qc-auth-brand p { font-size: 11px; }

    .qc-auth-form-container {
        padding: 32px 22px 24px;
    }

    .qc-form-group label { font-size: 12px; }
    .qc-form-control { font-size: 13px; padding: 11px 12px; }
    .qc-btn { font-size: 14px; }
}

@media (max-width: 480px) {
    .qc-auth-page { padding: 12px; }
    .qc-auth-sidebar-content { padding: 24px 16px; }
    .qc-auth-logo-sidebar h2,
    .qc-auth-brand h2 { font-size: 13px; }
    .qc-auth-lead { margin-bottom: 20px !important; }
    .qc-form-row { flex-wrap: wrap; }
    .qc-forgot,
    .qc-form-checkbox,
    .qc-auth-signup { font-size: 12px; }
    .qc-auth-footer { font-size: 11px; }
}

/* ---------- English (LTR) login page only ---------- */
html[dir="ltr"].qc-auth .qc-auth-promo-card h2,
html[dir="ltr"].qc-auth .qc-auth-promo-card p,
html[dir="ltr"].qc-auth .qc-auth-content-card h1,
html[dir="ltr"].qc-auth .qc-auth-content-card h3,
html[dir="ltr"].qc-auth .qc-auth-content-card p,
html[dir="ltr"].qc-auth .qc-auth-logo-copy,
html[dir="ltr"].qc-auth .qc-auth-brand > div,
html[dir="ltr"].qc-auth .qc-auth-hero,
html[dir="ltr"].qc-auth .qc-auth-hero h1,
html[dir="ltr"].qc-auth .qc-auth-feature-copy,
html[dir="ltr"].qc-auth .qc-auth-feature-copy h3,
html[dir="ltr"].qc-auth .qc-auth-feature-copy p,
html[dir="ltr"].qc-auth .qc-auth-feature-desc,
html[dir="ltr"].qc-auth .qc-auth-form-container,
html[dir="ltr"].qc-auth .qc-auth-signup {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"].qc-auth .qc-auth-card h1,
html[dir="ltr"].qc-auth .qc-auth-lead {
    text-align: left;
}

html[dir="ltr"].qc-auth .qc-auth-feature-copy {
    align-items: flex-start;
}

html[dir="ltr"].qc-auth .qc-form-group label {
    text-align: left;
}

html[dir="ltr"].qc-auth .qc-form-leading-icon {
    right: auto;
    left: 14px;
}

/* Lock on left, eye on right — keep padding on both sides when both classes apply */
html[dir="ltr"].qc-auth .qc-form-control--icon {
    padding-left: 42px;
    padding-right: 14px;
}

html[dir="ltr"].qc-auth .qc-form-control--toggle {
    padding-right: 42px;
}

html[dir="ltr"].qc-auth .qc-form-control--icon.qc-form-control--toggle {
    padding-left: 42px;
    padding-right: 42px;
}

html[dir="ltr"].qc-auth .qc-form-control-icon {
    left: auto;
    right: 12px;
}

html[dir="ltr"].qc-auth .qc-auth-signup a {
    margin-right: 0;
    margin-left: 4px;
}

html[dir="ltr"].qc-auth .qc-auth-hero-line1 {
    letter-spacing: 0.08em;
}

html[dir="ltr"].qc-auth .qc-auth-hero-line2 {
    letter-spacing: 0.06em;
}