/* ════════════════════════════════════════════════════
   LOGIN PAGE — CECF MICROFINANCE
   Layout : flexbox row (max compatibilité tous écrans)
   Chargé dans App.razor <head> — jamais dans le body
════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ════ CONTENEUR RACINE ════ */
.lk-root {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ════ PANNEAU GAUCHE — BRANDING ════ */
.lk-brand {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--kz-sidebar-bg, #0D1B12);
    padding: clamp(32px, 5vw, 72px) clamp(24px, 4vw, 56px);
}

/* Fond dégradé superposé */
.lk-brand-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(61,158,15,.18) 0%, transparent 60%);
    pointer-events: none;
}

/* Cercles décoratifs */
.lk-deco1 {
    position: absolute;
    width: 520px; height: 520px;
    border-radius: 50%;
    border: 1px solid rgba(61,158,15,.10);
    top: -18%; right: -22%;
    pointer-events: none;
}
.lk-deco2 {
    position: absolute;
    width: 380px; height: 380px;
    border-radius: 50%;
    border: 1px solid rgba(214,196,81,.08);
    bottom: -15%; left: -18%;
    pointer-events: none;
}
.lk-deco3 {
    position: absolute;
    width: 260px; height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(61,158,15,.06);
    top: 30%; left: -10%;
    pointer-events: none;
}
.lk-halo {
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(61,158,15,.09) 0%, transparent 70%);
    top: 10%; left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Contenu branding */
.lk-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 420px;
}

/* ── Logo ── */
.lk-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(130px, 18vw, 210px);
    height: clamp(130px, 18vw, 210px);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 100%);
    border: 2px solid rgba(61,158,15,.30);
    box-shadow:
        0 0 0 6px rgba(61,158,15,.05),
        0 0 0 14px rgba(61,158,15,.03),
        0 8px 40px rgba(0,0,0,.50),
        0 0 60px rgba(61,158,15,.15);
    margin-bottom: clamp(20px, 3vw, 36px);
    position: relative;
    overflow: hidden;
}
.lk-logo-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(214,196,81,.50);
    border-right-color: rgba(61,158,15,.30);
    animation: lk-spin 8s linear infinite;
}
.lk-logo-ring-2 {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: rgba(61,158,15,.25);
    border-left-color: rgba(214,196,81,.20);
    animation: lk-spin 12s linear infinite reverse;
}
.lk-spark {
    position: absolute;
    border-radius: 50%;
    background: var(--kz-secondary, #D6C451);
    opacity: .6;
    animation: lk-pulse 2.5s ease-in-out infinite;
}
.lk-spark-1 { width:5px;height:5px;top:12%;left:65%;animation-delay:0s; }
.lk-spark-2 { width:4px;height:4px;top:70%;left:78%;animation-delay:.8s; }
.lk-spark-3 { width:3px;height:3px;top:20%;left:22%;animation-delay:1.5s; }
.lk-spark-4 { width:4px;height:4px;top:75%;left:20%;animation-delay:.4s; }

@keyframes lk-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes lk-pulse {
    0%,100% { opacity:.3; transform:scale(.8); }
    50%      { opacity:.8; transform:scale(1.3); }
}

.lk-logo-img {
    width: 78%; height: 78%;
    object-fit: contain;
    position: relative; z-index: 1;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,.40));
}
.lk-logo-fallback {
    display: none;
    width: 78%; height: 78%;
    align-items: center; justify-content: center;
    position: relative; z-index: 1;
}

/* ── Textes branding ── */
.lk-brand-name {
    color: #ffffff;
    font-size: clamp(18px, 2.4vw, 28px);
    font-weight: 900;
    letter-spacing: .8px;
    line-height: 1.2;
    margin-bottom: 6px;
}
.lk-brand-sub {
    color: rgba(255,255,255,.48);
    font-size: clamp(11px, 1.2vw, 14px);
    letter-spacing: .4px;
    margin-bottom: 20px;
}
.lk-divider {
    width: 52px; height: 3px;
    background: linear-gradient(90deg, var(--kz-secondary,#D6C451), rgba(214,196,81,.15));
    border-radius: 2px;
    margin: 0 auto 20px;
}
.lk-desc {
    color: rgba(255,255,255,.52);
    font-size: clamp(11px, 1.1vw, 13px);
    line-height: 1.85;
    max-width: 300px;
    margin: 0 auto 24px;
}
.lk-desc strong { color: var(--kz-secondary,#D6C451); font-weight: 700; }
.lk-badges {
    display: flex; gap: 8px;
    justify-content: center; flex-wrap: wrap;
}
.lk-badge {
    border-radius: 20px;
    padding: 4px 13px;
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 700; letter-spacing: .4px;
}
.lk-badge-gold  { background:rgba(214,196,81,.12); border:1px solid rgba(214,196,81,.30); color:var(--kz-secondary,#D6C451); }
.lk-badge-green { background:rgba(61,158,15,.12);  border:1px solid rgba(61,158,15,.30);  color:#7AC943; }
.lk-badge-blue  { background:rgba(144,202,249,.10);border:1px solid rgba(144,202,249,.25);color:#90caf9; }
.lk-copy {
    position: absolute;
    bottom: 16px; left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,.20);
    font-size: clamp(9px, 1vw, 11px);
    z-index: 1; padding: 0 16px;
}

/* ════ PANNEAU DROIT — FORMULAIRE ════ */
.lk-form-panel {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f7fc;
    position: relative;
    padding: clamp(28px, 4vw, 60px) clamp(20px, 4vw, 56px);
}
.lk-form-panel-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(61,158,15,.06) 0%, transparent 70%);
    pointer-events: none;
}
.lk-form-box {
    width: 100%; max-width: 430px;
    position: relative; z-index: 1;
}

/* ── Header formulaire ── */
.lk-form-header { text-align: center; margin-bottom: clamp(24px, 3vw, 36px); }
.lk-avatar {
    width: clamp(64px, 8vw, 84px);
    height: clamp(64px, 8vw, 84px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kz-primary,#3D9E0F) 0%, var(--kz-primary-dark,#1F6B0A) 100%);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 28px rgba(61,158,15,.35), 0 0 0 6px rgba(61,158,15,.08);
    margin-bottom: clamp(14px, 2vw, 22px);
}
.lk-title {
    color: #0d1b0a;
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 800; letter-spacing: .2px; margin-bottom: 6px;
}
.lk-sub { color: #9e9e9e; font-size: clamp(12px, 1.1vw, 13.5px); }
.lk-form-footer {
    text-align: center;
    margin-top: clamp(20px, 2.5vw, 32px);
    color: #bdbdbd;
    font-size: clamp(10px, 1vw, 11.5px);
}

/* ═══════════════════════════════════════════
   MOBILE  (< 640px) — colonne unique
═══════════════════════════════════════════ */
@media (max-width: 639px) {
    .lk-root {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    .lk-brand {
        flex: none; width: 100%; height: auto;
        padding: 24px 20px 20px;
    }
    .lk-form-panel {
        flex: none; width: 100%; height: auto;
        overflow-y: visible;
        align-items: flex-start;
        padding: 28px 16px 36px;
    }
    .lk-logo-wrap { width:88px; height:88px; margin-bottom:12px; }
    .lk-brand-name { font-size:16px; }
    .lk-brand-sub  { font-size:11px; margin-bottom:10px; }
    .lk-divider    { display:none; }
    .lk-desc       { display:none; }
    .lk-deco1      { display:none; }
    .lk-deco3      { display:none; }
    .lk-badge      { padding:3px 8px; font-size:9px; }
    .lk-copy       { position:static; margin-top:14px; }
    .lk-avatar     { width:58px; height:58px; }
    .lk-title      { font-size:20px; }
}

/* ═══════════════════════════════════════════
   TABLETTE PORTRAIT  (640px – 767px)
═══════════════════════════════════════════ */
@media (min-width: 640px) and (max-width: 767px) {
    .lk-brand      { flex:0 0 38%; width:38%; }
    .lk-form-panel { flex:0 0 62%; width:62%; }
    .lk-logo-wrap  { width:100px; height:100px; }
    .lk-brand-name { font-size:15px; }
    .lk-divider    { display:none; }
    .lk-desc       { display:none; }
    .lk-form-box   { max-width:340px; }
    .lk-avatar     { width:56px; height:56px; }
    .lk-title      { font-size:18px; }
}

/* ═══════════════════════════════════════════
   TABLETTE PAYSAGE  (768px – 1023px)
═══════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
    .lk-brand      { flex:0 0 40%; width:40%; }
    .lk-form-panel { flex:0 0 60%; width:60%; }
    .lk-logo-wrap  { width:120px; height:120px; }
    .lk-brand-name { font-size:19px; }
    .lk-desc       { font-size:11.5px; }
    .lk-form-box   { max-width:380px; }
    .lk-avatar     { width:62px; height:62px; }
    .lk-title      { font-size:21px; }
}

/* ═══════════════════════════════════════════
   LAPTOP  (1024px – 1279px)
═══════════════════════════════════════════ */
@media (min-width: 1024px) and (max-width: 1279px) {
    .lk-brand      { flex:0 0 44%; width:44%; }
    .lk-form-panel { flex:0 0 56%; width:56%; }
    .lk-logo-wrap  { width:150px; height:150px; }
    .lk-brand-name { font-size:20px; }
    .lk-desc       { font-size:12px; max-width:280px; }
    .lk-form-box   { max-width:390px; }
    .lk-avatar     { width:66px; height:66px; }
    .lk-title      { font-size:22px; }
    .lk-form-panel { padding:24px 36px; }
}

/* ═══════════════════════════════════════════
   LAPTOP STANDARD  (1280px – 1439px)
═══════════════════════════════════════════ */
@media (min-width: 1280px) and (max-width: 1439px) {
    .lk-logo-wrap  { width:170px; height:170px; }
    .lk-brand-name { font-size:22px; }
    .lk-form-box   { max-width:410px; }
}

/* ═══════════════════════════════════════════
   GRAND ÉCRAN  (>= 1800px)
═══════════════════════════════════════════ */
@media (min-width: 1800px) {
    .lk-logo-wrap  { width:230px; height:230px; }
    .lk-brand-name { font-size:32px; }
    .lk-brand-sub  { font-size:16px; }
    .lk-desc       { font-size:15px; max-width:360px; }
    .lk-form-box   { max-width:500px; }
    .lk-title      { font-size:32px; }
    .lk-sub        { font-size:15px; }
}

/* ═══════════════════════════════════════════
   ÉCRAN BAS (hauteur < 650px — laptop zoomé)
═══════════════════════════════════════════ */
@media (max-height: 649px) and (min-width: 640px) {
    .lk-brand      { justify-content:flex-start; padding-top:16px; }
    .lk-logo-wrap  { width:80px; height:80px; margin-bottom:8px; }
    .lk-brand-name { font-size:14px; }
    .lk-divider    { display:none; }
    .lk-desc       { display:none; }
    .lk-badges     { display:none; }
    .lk-form-panel { align-items:flex-start; padding-top:16px; padding-bottom:16px; }
    .lk-avatar     { width:50px; height:50px; margin-bottom:8px; }
    .lk-form-header { margin-bottom:12px; }
    .lk-title      { font-size:18px; }
    .lk-form-footer { margin-top:10px; }
}
