/* ============================================================
   BiblioSmart — Auth (Login + Register)
   Dizajn: Library / Akademike (bezh, bordo, kafe, krem)
   Pa framework-e, pa CDN. Vanilla CSS + variabla në :root.
   ============================================================ */

:root {
    --bs-bg:        #faf5ec;   /* krem i ngrohtë */
    --bs-bg-2:      #ffffff;
    --bs-paper:     #fdf8ef;   /* letër e vjetër */
    --bs-ink:       #1f1a14;   /* e zezë kafe */
    --bs-ink-2:     #3b322a;
    --bs-muted:     #7a6a58;
    --bs-border:    #e9dfce;
    --bs-border-2:  #d8c9ad;

    --bs-bordeaux:   #7a1f2b;  /* bordo deep */
    --bs-bordeaux-2: #9b2a3a;
    --bs-brown:      #5c3a1e;  /* kafe libri */
    --bs-brown-2:    #7a4b25;
    --bs-gold:       #b8883b;  /* flori akademik */
    --bs-sand:       #e8d9b8;

    --bs-danger:     #b42318;
    --bs-danger-bg:  #fdecea;
    --bs-success:    #2f6a3d;
    --bs-success-bg: #e9f5ec;

    --bs-radius-sm:  10px;
    --bs-radius:     14px;
    --bs-radius-lg:  22px;

    --bs-shadow-sm:  0 2px 6px rgba(92, 58, 30, 0.06);
    --bs-shadow:     0 12px 30px rgba(92, 58, 30, 0.10);
    --bs-shadow-lg:  0 28px 70px rgba(92, 58, 30, 0.18);
}

/* Reset i butë, i kufizuar te auth */
.bs-auth * { box-sizing: border-box; }

html, body { height: 100%; }
body.bs-auth-body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--bs-ink);
    background: var(--bs-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Sfond dekorativ me pattern librash (SVG i ngulitur përmes data URI) */
body.bs-auth-body::before {
    content: "";
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(122, 31, 43, 0.08), transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(184, 136, 59, 0.10), transparent 55%),
        linear-gradient(180deg, #faf5ec 0%, #f3e9d4 100%);
    z-index: 0;
    pointer-events: none;
}

/* ====== Shell split-screen ====== */
.bs-auth {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

/* ====== Paneli i majtë (hero / brand) ====== */
.bs-hero {
    position: relative;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #f4ead4;
    background:
        linear-gradient(160deg, #5c3a1e 0%, #7a1f2b 55%, #4a1219 100%);
    overflow: hidden;
}
.bs-hero::before {
    /* Pattern librash në raft - SVG inline, shumë i butë */
    content: "";
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='120' viewBox='0 0 160 120'>\
<g fill='none' stroke='%23f4ead4' stroke-opacity='0.07' stroke-width='1.2'>\
<rect x='10' y='18' width='10' height='84' rx='1'/>\
<rect x='22' y='10' width='12' height='92' rx='1'/>\
<rect x='36' y='24' width='9'  height='78' rx='1'/>\
<rect x='47' y='14' width='14' height='88' rx='1'/>\
<rect x='63' y='20' width='10' height='82' rx='1'/>\
<rect x='75' y='12' width='13' height='90' rx='1'/>\
<rect x='90' y='22' width='9'  height='80' rx='1'/>\
<rect x='101' y='16' width='12' height='86' rx='1'/>\
<rect x='115' y='24' width='10' height='78' rx='1'/>\
<rect x='127' y='14' width='13' height='88' rx='1'/>\
<line x1='0' y1='102' x2='160' y2='102'/>\
</g>\
</svg>");
    background-size: 260px 200px;
    opacity: 0.9;
    pointer-events: none;
}
.bs-hero::after {
    content: "";
    position: absolute;
    right: -120px; bottom: -140px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(184,136,59,0.28), transparent 65%);
    pointer-events: none;
}
.bs-hero > * { position: relative; z-index: 1; }

/* Brand në hero */
.bs-brand {
    display: flex; align-items: center; gap: 14px;
}
.bs-brand-mark {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #b8883b 0%, #7a1f2b 100%);
    display: grid; place-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(244,234,212,0.2);
    color: #fff;
}
.bs-brand-mark svg { width: 30px; height: 30px; }
.bs-brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #f7efd8;
}
.bs-brand-sub {
    display: block;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244,234,212,0.65);
    margin-top: 2px;
}

/* Përmbajtja qendrore e hero */
.bs-hero-body { margin: 48px 0; max-width: 520px; }
.bs-hero-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(244,234,212,0.12);
    border: 1px solid rgba(244,234,212,0.22);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f0e2bf;
    margin-bottom: 22px;
}
.bs-hero-kicker svg { width: 12px; height: 12px; }

.bs-hero-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    color: #fbf4df;
}
.bs-hero-title em {
    font-style: italic;
    color: #f0c97a;
}
.bs-hero-lead {
    font-size: 15.5px;
    line-height: 1.65;
    color: rgba(244,234,212,0.82);
    max-width: 460px;
    margin: 0 0 28px;
}

/* Pika tiparesh */
.bs-hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 480px; }
.bs-hero-points li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px;
    color: rgba(244,234,212,0.88);
}
.bs-hero-points .dot {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(244,234,212,0.10);
    border: 1px solid rgba(244,234,212,0.18);
    display: grid; place-items: center;
    color: #f0c97a;
    flex-shrink: 0;
}
.bs-hero-points .dot svg { width: 14px; height: 14px; }

/* Fund i hero */
.bs-hero-foot {
    display: flex; justify-content: space-between; align-items: center;
    gap: 20px; font-size: 12px;
    color: rgba(244,234,212,0.55);
    border-top: 1px solid rgba(244,234,212,0.12);
    padding-top: 18px;
}

/* ====== Paneli i djathtë (forma) ====== */
.bs-form-side {
    padding: 48px 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bs-card {
    width: 100%;
    max-width: 460px;
    background: var(--bs-bg-2);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-shadow-lg);
    padding: 38px 38px 32px;
    position: relative;
}
.bs-card::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bs-brown), var(--bs-bordeaux), var(--bs-gold));
    border-radius: var(--bs-radius-lg) var(--bs-radius-lg) 0 0;
}

.bs-card-head { text-align: center; margin-bottom: 24px; }
.bs-card-head h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--bs-ink);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.bs-card-head p {
    margin: 0;
    font-size: 13.5px;
    color: var(--bs-muted);
}

/* Alert */
.bs-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--bs-radius-sm);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
}
.bs-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.bs-alert-danger {
    background: var(--bs-danger-bg);
    color: var(--bs-danger);
    border: 1px solid rgba(180, 35, 24, 0.2);
}
.bs-alert-success {
    background: var(--bs-success-bg);
    color: var(--bs-success);
    border: 1px solid rgba(47, 106, 61, 0.2);
}

/* Forma */
.bs-field { margin-bottom: 16px; }
.bs-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bs-ink-2);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}
.bs-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.bs-input-wrap svg.bs-input-icon {
    position: absolute;
    left: 14px;
    width: 16px; height: 16px;
    color: var(--bs-muted);
    pointer-events: none;
    transition: color 0.2s;
}
.bs-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bs-paper);
    border: 1px solid var(--bs-border-2);
    border-radius: var(--bs-radius-sm);
    font: inherit;
    font-size: 14px;
    color: var(--bs-ink);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.bs-input::placeholder { color: #a89b89; }
.bs-input:hover { border-color: var(--bs-gold); }
.bs-input:focus {
    border-color: var(--bs-bordeaux);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(122, 31, 43, 0.15);
}
.bs-input:focus + svg.bs-input-icon,
.bs-input-wrap:focus-within svg.bs-input-icon { color: var(--bs-bordeaux); }

/* Toggle fjalëkalimi */
.bs-pw-toggle {
    position: absolute; right: 10px;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--bs-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bs-pw-toggle:hover { color: var(--bs-bordeaux); background: rgba(122,31,43,0.06); }
.bs-pw-toggle svg { width: 16px; height: 16px; }

/* Password strength */
.bs-pw-strength {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--bs-muted);
}
.bs-pw-strength .bar {
    height: 4px;
    width: 100%;
    background: var(--bs-border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
}
.bs-pw-strength .bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--bs-bordeaux);
    transition: width 0.25s, background 0.25s;
    border-radius: 99px;
}

/* Row me dy kolona */
.bs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 520px) {
    .bs-row { grid-template-columns: 1fr; }
}

/* Buton primar */
.bs-btn {
    width: 100%;
    padding: 13px 16px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff8e6;
    background: linear-gradient(135deg, var(--bs-bordeaux) 0%, var(--bs-brown) 100%);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--bs-radius-sm);
    box-shadow: 0 10px 24px rgba(122, 31, 43, 0.28),
                inset 0 1px 0 rgba(255,255,255,0.12);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    margin-top: 6px;
}
.bs-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(122, 31, 43, 0.36),
                inset 0 1px 0 rgba(255,255,255,0.15);
    filter: brightness(1.05);
}
.bs-btn:active { transform: translateY(0); filter: brightness(0.97); }
.bs-btn:focus-visible {
    outline: 3px solid var(--bs-gold);
    outline-offset: 2px;
}
.bs-btn svg { width: 16px; height: 16px; }

/* Buton sekondar (outline) */
.bs-btn-outline {
    width: 100%;
    padding: 12px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--bs-bordeaux);
    background: transparent;
    border: 1.5px solid var(--bs-border-2);
    border-radius: var(--bs-radius-sm);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.15s;
}
.bs-btn-outline:hover {
    background: var(--bs-paper);
    border-color: var(--bs-bordeaux);
    color: var(--bs-bordeaux-2);
}
.bs-btn-outline svg { width: 15px; height: 15px; }

/* Ndarës */
.bs-divider {
    position: relative;
    text-align: center;
    margin: 20px 0 14px;
    color: var(--bs-muted);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.bs-divider::before, .bs-divider::after {
    content: "";
    position: absolute; top: 50%;
    width: calc(50% - 26px);
    height: 1px; background: var(--bs-border);
}
.bs-divider::before { left: 0; }
.bs-divider::after { right: 0; }

/* Këmbëza e kartës */
.bs-card-foot {
    text-align: center;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--bs-border);
    font-size: 12px;
    color: var(--bs-muted);
}
.bs-card-foot a {
    color: var(--bs-bordeaux);
    text-decoration: none;
    font-weight: 600;
}
.bs-card-foot a:hover { text-decoration: underline; }

/* Ndihmëse */
.bs-help {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: -6px; margin-bottom: 14px;
    font-size: 12px;
}
.bs-help label { display: inline-flex; align-items: center; gap: 8px; color: var(--bs-muted); cursor: pointer; }
.bs-help input[type="checkbox"] { accent-color: var(--bs-bordeaux); }
.bs-help a { color: var(--bs-bordeaux); text-decoration: none; font-weight: 600; }
.bs-help a:hover { text-decoration: underline; }

/* ====== Responsive ====== */
@media (max-width: 960px) {
    .bs-auth { grid-template-columns: 1fr; }
    .bs-hero {
        padding: 36px 28px 40px;
        min-height: auto;
    }
    .bs-hero-body { margin: 26px 0; }
    .bs-hero-foot { display: none; }
    .bs-form-side { padding: 28px 20px 44px; }
}
@media (max-width: 480px) {
    .bs-card { padding: 28px 22px 24px; border-radius: 18px; }
    .bs-card-head h1 { font-size: 22px; }
    .bs-hero-title { font-size: 28px; }
}

/* Reduco animacione për preferencë */
@media (prefers-reduced-motion: reduce) {
    .bs-btn, .bs-input, .bs-pw-strength .bar > span { transition: none !important; }
    .bs-btn:hover { transform: none; }
}

/* ============================================================
   DARK MODE + GLASSMORPHISM
   (Aktivizohet kur <html data-bs-theme="dark">)
   ============================================================ */
html[data-bs-theme="dark"] {
    --bs-bg:        #1a1410;
    --bs-bg-2:      #221a14;
    --bs-paper:     #2a1f17;
    --bs-ink:       #f4ead4;
    --bs-ink-2:     #e6d9b8;
    --bs-muted:     #b29e82;
    --bs-border:    #3a2e23;
    --bs-border-2:  #4a3a2b;

    --bs-shadow-sm:  0 2px 6px rgba(0,0,0,0.35);
    --bs-shadow:     0 12px 30px rgba(0,0,0,0.45);
    --bs-shadow-lg:  0 28px 70px rgba(0,0,0,0.6);
}

html[data-bs-theme="dark"] body.bs-auth-body {
    color: var(--bs-ink);
    background: var(--bs-bg);
}
html[data-bs-theme="dark"] body.bs-auth-body::before {
    background:
        radial-gradient(ellipse at 15% 20%, rgba(217, 119, 119, 0.12), transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(247, 201, 72, 0.10), transparent 55%),
        linear-gradient(180deg, #1a1410 0%, #0f0a07 100%);
}

html[data-bs-theme="dark"] .bs-card {
    background: rgba(42, 31, 23, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-color: rgba(244, 234, 212, 0.12);
}

html[data-bs-theme="dark"] .bs-card-head h1 { color: var(--bs-ink); }
html[data-bs-theme="dark"] .bs-card-head p { color: var(--bs-muted); }
html[data-bs-theme="dark"] .bs-field label { color: var(--bs-ink-2); }

html[data-bs-theme="dark"] .bs-input {
    background: rgba(26, 20, 16, 0.65);
    color: var(--bs-ink);
    border-color: var(--bs-border-2);
}
html[data-bs-theme="dark"] .bs-input::placeholder { color: #8a7a66; }
html[data-bs-theme="dark"] .bs-input:focus {
    background: rgba(26, 20, 16, 0.9);
    border-color: #d97777;
    box-shadow: 0 0 0 3px rgba(217, 119, 119, 0.2);
}

html[data-bs-theme="dark"] .bs-help label,
html[data-bs-theme="dark"] .bs-help span { color: var(--bs-muted); }

html[data-bs-theme="dark"] .bs-divider { color: var(--bs-muted); }
html[data-bs-theme="dark"] .bs-divider::before,
html[data-bs-theme="dark"] .bs-divider::after { background: var(--bs-border); }

html[data-bs-theme="dark"] .bs-btn-outline {
    color: #f0c97a;
    border-color: var(--bs-border-2);
}
html[data-bs-theme="dark"] .bs-btn-outline:hover {
    background: rgba(255,255,255,0.04);
    border-color: #d97777;
    color: #f0a1a1;
}

html[data-bs-theme="dark"] .bs-card-foot {
    color: var(--bs-muted);
    border-top-color: var(--bs-border);
}

/* Toggle i temës (butoni lundrues) — për login & register */
.bs-theme-float {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--bs-border-2);
    color: var(--bs-ink-2);
    cursor: pointer;
    display: grid; place-items: center;
    transition: transform 0.15s, background 0.15s, color 0.15s;
    box-shadow: var(--bs-shadow-sm);
}
.bs-theme-float:hover {
    transform: scale(1.06);
    color: var(--bs-bordeaux);
}
.bs-theme-float svg { width: 18px; height: 18px; }
html[data-bs-theme="dark"] .bs-theme-float {
    background: rgba(42, 31, 23, 0.75);
    border-color: rgba(244, 234, 212, 0.2);
    color: #f0c97a;
}
html[data-bs-theme="dark"] .bs-theme-float:hover { color: #f7c948; }

/* Polish i butonit primar në dark */
html[data-bs-theme="dark"] .bs-btn {
    background: linear-gradient(135deg, #9b2a3a 0%, #7a4b25 100%);
    box-shadow: 0 10px 24px rgba(155, 42, 58, 0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* Linkim pastër me landing page */
.bs-back-home {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-ink-2);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--bs-border-2);
    border-radius: 999px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, transform 0.15s;
    box-shadow: var(--bs-shadow-sm);
}
.bs-back-home:hover {
    color: var(--bs-bordeaux);
    transform: translateX(-2px);
}
.bs-back-home svg { width: 14px; height: 14px; }
html[data-bs-theme="dark"] .bs-back-home {
    background: rgba(42, 31, 23, 0.75);
    color: #f0c97a;
    border-color: rgba(244, 234, 212, 0.2);
}
html[data-bs-theme="dark"] .bs-back-home:hover { color: #f7c948; }

