/* Login presentation. Authentication is handled by the existing login view. */
:root {
    --login-ink: #4f3b37;
    --login-ink-hover: #3e2e2a;
    --login-muted: #786e6a;
    --login-border: #e8e2dc;
    --login-paper: #fcfbf9;
}

body.bg-gradient-dark {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--login-paper);
    color: var(--login-ink);
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.ql-login, .ql-login * { box-sizing: border-box; }
.ql-login {
    display: grid;
    grid-template-columns: minmax(380px, .86fr) minmax(0, 1.14fr);
    height: 100vh;
    height: 100dvh;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
    direction: rtl;
}
.ql-form-panel { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-y: auto; scrollbar-width: thin; padding: 38px 64px 32px; }
.ql-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.ql-brand-logo { width: 68px; height: 68px; object-fit: contain; flex-shrink: 0; }
.ql-brand-name { display: block; font-size: 17px; font-weight: 700; line-height: 1.8; }
.ql-brand-description { display: block; color: var(--login-muted); font-size: 11px; line-height: 1.8; }
.ql-form-body { width: 100%; max-width: 374px; margin: auto; padding: clamp(16px, 3vh, 32px) 0; flex-shrink: 0; }
.ql-welcome-mark {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin-bottom: 24px;
    background: var(--app-surface-warm-soft); color: var(--app-primary-hover);
    border: 1px solid var(--app-border-warm); border-radius: 14px;
}
.ql-title { margin: 0 0 12px; font-size: 29px; font-weight: 700; line-height: 1.6; color: var(--login-ink); }
.ql-subtitle { margin: 0 0 32px; color: var(--login-muted); font-size: 13px; line-height: 2; }
.ql-field { margin-bottom: 22px; }
.ql-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.ql-input-wrap { position: relative; }
.ql-input-icon { position: absolute; right: 17px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: #9b9086; pointer-events: none; }
.ql-input {
    width: 100%; height: 56px; padding: 0 48px 0 16px;
    border: 1px solid var(--login-border); border-radius: 11px;
    background: var(--app-surface); color: var(--login-ink);
    font: inherit; font-size: 13px; direction: rtl;
    transition: border-color .18s, box-shadow .18s;
}
.ql-input::placeholder { color: #948b85; opacity: 1; }
.ql-input:focus { outline: none; border-color: var(--app-primary); box-shadow: 0 0 0 3px rgb(201 162 39 / 14%); }
.ql-input[type="password"], #password { padding-left: 52px; }
.ql-eye {
    position: absolute; left: 6px; top: 6px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: 8px; background: transparent;
    color: var(--login-muted); cursor: pointer;
}
.ql-eye:hover { color: var(--login-ink); background: var(--login-paper); }
.ql-remember { display: flex; align-items: center; gap: 9px; margin: 2px 0 25px; min-height: 24px; }
.ql-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--login-ink); cursor: pointer; }
.ql-remember label { margin: 0; font-size: 12px; color: var(--login-muted); cursor: pointer; }
.ql-btn {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 55px;
    padding: 12px 16px; border: 0; border-radius: 11px; background: var(--login-ink);
    color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 5px 12px rgb(79 59 55 / 10%); transition: background .18s;
}
.ql-btn:hover { background: var(--login-ink-hover); }
.ql-btn:disabled { opacity: .7; cursor: wait; }
#qlBtnTxt { display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.ql-eye:focus-visible, .ql-btn:focus-visible, .ql-photo-choice:focus-visible, .ql-slideshow-toggle:focus-visible, .ql-remember input:focus-visible {
    outline: 3px solid var(--app-primary); outline-offset: 4px;
}
.ql-note { display: flex; align-items: flex-start; justify-content: center; gap: 7px; margin: 22px 0 0; color: var(--login-muted); font-size: 11px; line-height: 1.9; }
.ql-note svg { flex-shrink: 0; margin-top: 3px; color: var(--app-primary-hover); }
.ql-footer { margin: 0; text-align: center; font-size: 11px; color: var(--login-muted); line-height: 2; flex-shrink: 0; }
.ql-footer::before { content: ''; display: block; width: 28px; height: 2px; margin: 0 auto 13px; background: var(--app-primary); }
.ql-alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #f0caca; border-right: 3px solid #b83535; border-radius: 10px; background: #fff3f3; color: #922626; font-size: 12px; line-height: 1.9; }
.ql-field-error { display: block; margin-top: 6px; color: #922626; font-size: 11px; }
.ql-visual { grid-column: 2; grid-row: 1; position: relative; isolation: isolate; min-height: 0; overflow: hidden; background: var(--login-ink); }
.ql-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.ql-visual::after { content: ''; position: absolute; z-index: 0; inset: 0; background: linear-gradient(180deg, rgb(32 29 26 / 12%) 0%, transparent 38%, rgb(38 29 26 / 12%) 53%, rgb(38 29 26 / 92%) 100%); pointer-events: none; }
.ql-visual-label { position: absolute; z-index: 1; top: 30px; right: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgb(255 255 255 / 45%); border-radius: 30px; background: rgb(38 29 26 / 38%); color: #fff; font-size: 11px; backdrop-filter: blur(8px); }
.ql-visual-label svg { color: #f0d77e; }
.ql-story { position: absolute; z-index: 1; bottom: 37px; right: 40px; left: 40px; color: #fff; }
.ql-story-rule { width: 42px; height: 3px; margin-bottom: 18px; background: var(--app-primary); }
.ql-story h2 { margin: 0 0 12px; color: #fff; font-size: clamp(28px, 2.65vw, 43px); line-height: 1.65; font-weight: 700; }
.ql-story h2 span { display: block; }
.ql-story p { max-width: 420px; margin: 0; color: rgb(255 255 255 / 86%); font-size: 13px; line-height: 2; }
.ql-photo-controls { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.ql-photo-choices { display: flex; gap: 10px; }
.ql-slideshow-toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; background: rgb(38 29 26 / 35%); color: #fff; cursor: pointer; flex-shrink: 0; }
.ql-slideshow-toggle:hover { background: rgb(255 255 255 / 18%); }
.ql-photo-choice { position: relative; width: 48px; height: 38px; padding: 3px; border: 1px solid rgb(255 255 255 / 45%); border-radius: 8px; background: transparent; cursor: pointer; opacity: .65; transition: opacity .18s, border-color .18s; }
.ql-photo-choice img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.ql-photo-choice:hover, .ql-photo-choice[aria-pressed="true"] { opacity: 1; }
.ql-photo-choice[aria-pressed="true"] { border: 2px solid #efd378; padding: 2px; }
.ql-dots { display: inline-flex; gap: 3px; align-items: center; }
.ql-dots span { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: ql-pulse .9s ease-in-out infinite; }
.ql-dots span:nth-child(2) { animation-delay: .15s; }
.ql-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ql-pulse { 0%,80%,100% { opacity: .4; } 40% { opacity: 1; } }

@media (min-width: 1600px) {
    .ql-form-panel { padding-right: 60px; padding-left: 60px; }
    .ql-form-body { max-width: 410px; }
}
@media (max-width: 1100px) {
    .ql-login { grid-template-columns: minmax(350px, 1fr) minmax(0, 1fr); }
    .ql-form-panel { padding: 28px 38px 24px; }
    .ql-story { right: 28px; left: 28px; bottom: 30px; }
    .ql-visual-label { right: 24px; top: 24px; }
}
@media (max-width: 760px) {
    .ql-login { grid-template-columns: minmax(0, 1fr); }
    .ql-form-panel { grid-column: 1; padding: 24px 22px; }
    .ql-brand { justify-content: center; gap: 11px; }
    .ql-brand-logo { width: 58px; height: 58px; }
    .ql-brand-name { font-size: 16px; }
    .ql-brand-description { font-size: 10px; }
    .ql-form-body { padding: 24px 0; }
    .ql-welcome-mark { margin-bottom: 18px; }
    .ql-title { font-size: 26px; }
    .ql-subtitle { margin-bottom: 26px; }
    .ql-input { font-size: 16px; }
    .ql-visual { display: none; }
    .ql-photo { object-position: center 40%; }
    .ql-story { right: 24px; left: 24px; bottom: 24px; }
    .ql-story h2 { font-size: 27px; }
    .ql-story p { font-size: 12px; }
    .ql-photo-controls { margin-top: 18px; }
}
/* Keep the complete form visible on laptop and shorter phone screens. */
@media (max-height: 820px) {
    .ql-form-panel { padding-top: 16px; padding-bottom: 16px; }
    .ql-brand-logo { width: 54px; height: 54px; }
    .ql-form-body { padding-top: 16px; padding-bottom: 16px; }
    .ql-welcome-mark { width: 38px; height: 38px; margin-bottom: 12px; }
    .ql-title { font-size: 26px; margin-bottom: 6px; }
    .ql-subtitle { margin-bottom: 20px; }
    .ql-field { margin-bottom: 16px; }
    .ql-label { margin-bottom: 6px; }
    .ql-input { height: 50px; }
    .ql-eye { top: 3px; }
    .ql-remember { margin-bottom: 18px; }
    .ql-btn { min-height: 50px; }
    .ql-note { margin-top: 16px; }
    .ql-footer::before { margin-bottom: 8px; }
}
@media (max-height: 650px) {
    .ql-form-panel { padding-top: 12px; padding-bottom: 12px; }
    .ql-form-body { padding-top: 12px; padding-bottom: 12px; }
    .ql-welcome-mark { display: none; }
    .ql-subtitle { margin-bottom: 12px; line-height: 1.8; }
    .ql-field { margin-bottom: 12px; }
    .ql-remember { margin-bottom: 12px; }
    .ql-note { margin-top: 10px; }
    .ql-alert { padding: 9px 12px; margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .ql-login *, .ql-login *::before, .ql-login *::after { animation: none !important; transition: none !important; }
}
