/* Sign-in pages: split screen (brand panel + form). Loaded after style.css. */

.auth-body { margin: 0; background: #f8fafc; min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; }

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative; overflow: hidden; color: #e2e8f0;
    background: var(--panel-art) center / cover no-repeat, linear-gradient(145deg, #0b1530 0%, #101a33 45%, #172554 100%);
}
.auth-brand-inner {
    position: relative; z-index: 1; height: 100%; box-sizing: border-box;
    display: flex; flex-direction: column; gap: 32px; padding: 44px 56px 32px; max-width: 640px;
    animation: auth-rise .6s ease-out both;
}
.auth-logo { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: .3px; }
.auth-logo span { color: #60a5fa; }
.auth-hero { margin-top: 36px; }
.auth-hero h1 { font-size: 40px; line-height: 1.15; font-weight: 800; color: #fff; margin: 0 0 14px; letter-spacing: -.5px; }
.auth-hero p { font-size: 16px; line-height: 1.6; color: #cbd5e1; margin: 0; max-width: 460px; }

.auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: #94a3b8; }
.auth-features strong { color: #f1f5f9; font-weight: 600; font-size: 14.5px; }
.auth-feature-icon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: rgba(96, 165, 250, .14); border: 1px solid rgba(96, 165, 250, .28);
}
.auth-feature-icon svg { width: 18px; height: 18px; fill: none; stroke: #93c5fd; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Product preview card */
.auth-preview {
    margin-top: 4px; max-width: 420px; padding: 18px 20px; border-radius: 14px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 20px 40px rgba(2, 6, 23, .35);
}
.auth-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.auth-preview-title { color: #fff; font-weight: 700; font-size: 14px; }
.auth-preview-sub { color: #94a3b8; font-size: 12px; margin-top: 2px; }
.auth-preview-badge { font-size: 11px; font-weight: 700; color: #fcd34d; background: rgba(251, 191, 36, .15); border: 1px solid rgba(251, 191, 36, .35); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.auth-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 14px; }
.auth-steps span { position: relative; font-size: 11px; font-weight: 600; color: #64748b; padding-top: 10px; text-align: center; }
.auth-steps span::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.auth-steps span.done { color: #86efac; }
.auth-steps span.done::before { background: #22c55e; }
.auth-steps span.active { color: #fff; }
.auth-steps span.active::before { background: linear-gradient(90deg, #60a5fa, #3b82f6); animation: auth-pulse 1.8s ease-in-out infinite; }
.auth-approvers { display: flex; align-items: center; gap: 0; }
.auth-avatar {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700;
    color: #fff; border: 2px solid #172554; margin-inline-end: -6px;
}
.auth-avatar.ok { background: #16a34a; }
.auth-avatar.wait { background: #475569; }
.auth-approvers-text { margin-inline-start: 16px; font-size: 12px; color: #cbd5e1; }

.auth-brand-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: #64748b; }
.auth-demo { color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); }
.auth-demo:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); }

/* ---------- Form side ---------- */
.auth-main {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 24px; background: var(--form-art) center / cover no-repeat, #f8fafc;
}
.auth-lang { position: absolute; top: 20px; inset-inline-end: 24px; }
.auth-lang select {
    width: auto; min-width: 0; padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
    border: 1px solid #e2e8f0; background: #fff; color: #334155;
}
.auth-card {
    width: 100%; max-width: 400px; box-sizing: border-box; background: #fff; border: 1px solid #eef2f7;
    border-radius: 16px; padding: 36px 36px 30px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 16px 40px rgba(15, 23, 42, .08);
    animation: auth-rise .5s ease-out .05s both;
}
.auth-logo-mobile { display: none; color: #0f172a; margin-bottom: 18px; }
.auth-title { font-size: 24px; font-weight: 800; color: #0f172a; margin: 0 0 6px; letter-spacing: -.2px; }
.auth-subtitle { font-size: 14px; color: #64748b; margin: 0 0 24px; line-height: 1.55; }
.auth-note { font-size: 13px; color: #94a3b8; margin: -10px 0 22px; }

.auth-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin: 0 0 6px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.auth-label-row .auth-label { margin-bottom: 6px; }
.auth-link { font-size: 13px; font-weight: 600; color: #2563eb; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-field { position: relative; }
.auth-field > svg {
    position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); pointer-events: none;
    width: 18px; height: 18px; fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.auth-field input {
    width: 100%; box-sizing: border-box; margin: 0; height: 46px; font-size: 15px; color: #0f172a;
    padding-inline: 42px 44px; border: 1px solid #dbe2ea; border-radius: 10px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input:hover { border-color: #c3ccd8; }
.auth-field input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.auth-field:focus-within > svg { stroke: #3b82f6; }
.auth-eye {
    position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%);
    background: none; border: none; padding: 6px; border-radius: 6px; cursor: pointer; line-height: 0; color: #94a3b8;
}
.auth-eye:hover { background: #f1f5f9; color: #475569; }
.auth-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-capslock { font-size: 12px; font-weight: 600; color: #b45309; margin-top: 6px; }
.auth-capslock::before { content: '\26A0\FE0E  '; }

.auth-remember { display: flex; align-items: center; gap: 8px; margin: 16px 0 22px; font-size: 13.5px; color: #475569; font-weight: normal; cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; margin: 0; accent-color: #2563eb; }

.auth-submit {
    position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 46px;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; text-decoration: none;
    background: linear-gradient(180deg, #2563eb, #1d4ed8); box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 8px 18px rgba(37, 99, 235, .25);
    transition: transform .08s, box-shadow .15s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 10px 22px rgba(37, 99, 235, .32); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: wait; filter: none; opacity: .9; }
.auth-submit-link { margin-top: 4px; }
.auth-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: auth-spin .7s linear infinite; }
.auth-submit.loading .auth-submit-text { visibility: hidden; }
.auth-submit.loading .auth-spinner { display: block; position: absolute; }

.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; margin-bottom: 18px; }
.auth-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.auth-rules { list-style: none; margin: 8px 0 16px; padding: 0; font-size: 12px; color: #64748b; display: flex; flex-direction: column; gap: 2px; }
.auth-rules li::before { content: '\2022  '; color: #94a3b8; }
.auth-state-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #eff6ff; margin-bottom: 16px; }
.auth-state-icon svg { width: 26px; height: 26px; fill: none; stroke: #2563eb; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-state-ok { background: #ecfdf5; }
.auth-state-ok svg { stroke: #16a34a; }
.auth-state-warn { background: #fffbeb; }
.auth-state-warn svg { stroke: #d97706; }
.auth-back { text-align: center; margin: 18px 0 0; }
.auth-main-foot { margin-top: 22px; font-size: 12.5px; color: #94a3b8; }
.auth-main-foot a { color: #64748b; text-decoration: none; font-weight: 600; }
.auth-main-foot a:hover { color: #2563eb; }

/* ---------- Motion ---------- */
@keyframes auth-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
    .auth-brand-inner, .auth-card, .auth-steps span.active::before { animation: none; }
}

/* ---------- Right-to-left (Arabic) ---------- */
[dir="rtl"] .auth-hero h1, [dir="rtl"] .auth-title { letter-spacing: 0; }
[dir="rtl"] .auth-demo, [dir="rtl"] .auth-back a { unicode-bidi: plaintext; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
    .auth-brand-inner { padding: 36px 40px 28px; }
    .auth-hero h1 { font-size: 34px; }
}
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: auto; }
    .auth-brand-inner { padding: 26px 24px; gap: 14px; max-width: none; }
    .auth-hero { margin-top: 6px; }
    .auth-hero h1 { font-size: 26px; margin-bottom: 6px; }
    .auth-hero p { font-size: 14px; }
    .auth-features, .auth-preview, .auth-brand-foot span { display: none; }
    .auth-brand-foot { margin-top: 4px; }
    .auth-main { padding: 28px 16px 40px; justify-content: flex-start; }
    .auth-lang { position: static; align-self: flex-end; margin-bottom: 14px; }
    .auth-card { padding: 28px 22px 24px; }
}
