/**
 * Ministère des Droits Humains — Authentification
 * Stylesheet Dédiée (Admin & Portail Client)
 * Auteur : Ir. Roland MANTAMA
 */

:root {
    --bop-bg-dark: #040814;
    --bop-bg-surface: #0a1326;
    --bop-bg-card: rgba(10, 20, 42, 0.92);
    --bop-border-card: rgba(255, 255, 255, 0.12);
    --bop-border-focus: #38bdf8;
    --bop-primary: #0284c7;
    --bop-primary-hover: #0369a1;
    --bop-primary-glow: rgba(56, 189, 248, 0.4);
    --bop-gold: #f59e0b;
    --bop-gold-glow: rgba(245, 158, 11, 0.35);
    --bop-crimson: #dc2626;
    --bop-text-main: #f8fafc;
    --bop-text-muted: #94a3b8;
    --bop-text-dim: #64748b;
    --bop-success: #10b981;
    --bop-radius: 16px;
    --bop-radius-sm: 8px;
}

/* ============================================================
   --- BASE COMMUNE & FOND IMMERSIF (ZERO-SCROLL) ---
   ============================================================ */
body.bop-auth-body,
body.customers.authentication {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: var(--bop-bg-dark) !important;
    background: radial-gradient(ellipse at 50% 0%, #0a1b38 0%, var(--bop-bg-dark) 75%) !important;
    color: var(--bop-text-main) !important;
    min-height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 16px !important;
    margin: 0;
    box-sizing: border-box;
}

#wrapper {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

.bop-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #0a1b38 0%, var(--bop-bg-dark) 75%);
}

.bop-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    will-change: transform;
    animation: bopFloat 16s ease-in-out infinite alternate;
}

.bop-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #0284c7 0%, rgba(2,132,199,0) 70%);
    top: -120px;
    left: -120px;
}

.bop-orb-2 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #f59e0b 0%, rgba(245,158,11,0) 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -6s;
    animation-duration: 20s;
}

.bop-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #dc2626 0%, rgba(220,38,38,0) 70%);
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    animation: bopPulse 12s ease-in-out infinite;
}

.bop-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 50%, black 50%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 50%, transparent 85%);
}

@keyframes bopFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(50px, 35px, 0) scale(1.08); }
    100% { transform: translate3d(-35px, 50px, 0) scale(0.96); }
}

@keyframes bopPulse {
    0%, 100% { transform: translate3d(-50%, -50%, 0) scale(1); opacity: 0.16; }
    50% { transform: translate3d(-50%, -50%, 0) scale(1.22); opacity: 0.28; }
}

/* ============================================================
   --- CARTE ADMIN (DOUBLE PANNEAU GLASSMORPHISM) ---
   ============================================================ */
.bop-auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1080px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--bop-bg-card);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--bop-border-card);
    border-radius: var(--bop-radius);
    box-shadow: 
        0 25px 60px -15px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 45px rgba(2, 132, 199, 0.16);
    overflow: hidden;
    animation: bopCardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bopCardAppear {
    0% { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.97); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.bop-auth-side {
    background: linear-gradient(150deg, rgba(12, 24, 52, 0.94) 0%, rgba(6, 14, 30, 0.98) 100%);
    border-right: 1px solid var(--bop-border-card);
    padding: 38px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.bop-auth-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #0284c7 0%, #f59e0b 50%, #dc2626 100%);
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.6);
}

.bop-inst-header {
    text-align: center;
}

.bop-inst-country {
    font-family: 'Cinzel', serif;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fbbf24;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bop-flag-star {
    color: #f59e0b;
    font-size: 12px;
    animation: bopStarTwinkle 3s ease-in-out infinite alternate;
}

@keyframes bopStarTwinkle {
    0% { transform: scale(0.85); opacity: 0.7; filter: drop-shadow(0 0 2px #f59e0b); }
    100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px #fbbf24); }
}

.bop-inst-ministry {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1.6px;
    color: #e2e8f0;
    text-transform: uppercase;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #38bdf8, #ffffff, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bop-crest-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    animation: bopCrestFloat 5s ease-in-out infinite alternate;
}

.bop-crest-aura {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.55) 0%, rgba(245, 158, 11, 0.22) 60%, transparent 80%);
    border-radius: 50%;
    filter: blur(20px);
    z-index: 1;
    animation: bopAuraPulse 4s ease-in-out infinite alternate;
}

@keyframes bopCrestFloat {
    0% { transform: translate3d(0, 0, 0); filter: drop-shadow(0 8px 18px rgba(2, 132, 199, 0.35)); }
    100% { transform: translate3d(0, -5px, 0); filter: drop-shadow(0 14px 24px rgba(245, 158, 11, 0.45)); }
}

@keyframes bopAuraPulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.25); opacity: 0.9; }
}

.bop-crest-svg {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.bop-inst-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.bop-inst-subtitle {
    font-size: 12px;
    color: var(--bop-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.bop-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

.bop-pillar-item {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px 12px;
    border-radius: var(--bop-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bop-pillar-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.2);
    transform: translate3d(0, -2px, 0);
}

.bop-pillar-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform 0.25s ease;
}

.bop-pillar-item:hover .bop-pillar-icon {
    transform: scale(1.1);
    color: #7dd3fc;
}

.bop-pillar-text {
    font-size: 11.5px;
    font-weight: 600;
    color: #e2e8f0;
}

.bop-side-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--bop-text-dim);
}

.bop-location-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #94a3b8;
}

.bop-live-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(2, 132, 199, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.bop-live-dot {
    width: 6px;
    height: 6px;
    background-color: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
    animation: bopLivePulse 1.5s infinite;
}

@keyframes bopLivePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

/* --- Form Panel --- */
.bop-auth-main {
    padding: 38px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: rgba(7, 14, 28, 0.65);
}

.bop-form-header {
    margin-bottom: 22px;
}

.bop-badge-security {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 30px;
    font-size: 10.5px;
    font-weight: 700;
    color: #34d399;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.bop-security-pulse {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
    animation: bopLivePulse 2s infinite;
}

.bop-form-title {
    font-size: 23px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.bop-form-subtitle {
    font-size: 12.5px;
    color: var(--bop-text-muted);
}

.alert {
    padding: 10px 14px;
    border-radius: var(--bop-radius-sm);
    margin-bottom: 16px;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.18) !important;
    border-color: rgba(220, 38, 38, 0.45) !important;
    color: #fca5a5 !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
    color: #6ee7b7 !important;
}

.bop-input-group {
    margin-bottom: 16px;
    position: relative;
    width: 100%;
}

.bop-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.bop-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.bop-input-icon {
    position: absolute;
    left: 15px;
    color: #38bdf8 !important;
    font-size: 15px;
    transition: color 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.bop-input {
    width: 100% !important;
    height: 46px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: var(--bop-radius-sm) !important;
    padding: 0 40px 0 44px !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-family: inherit !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-sizing: border-box;
}

.bop-input:focus {
    background: rgba(15, 23, 42, 0.98) !important;
    border-color: var(--bop-border-focus) !important;
    box-shadow: 0 0 0 3px var(--bop-primary-glow), 0 0 15px rgba(56, 189, 248, 0.15) !important;
}

.bop-input-wrapper:focus-within .bop-input-icon {
    color: #7dd3fc !important;
    transform: scale(1.1);
}

.bop-input::placeholder {
    color: #64748b !important;
}

/* Custom Styled Select Dropdown (Langue) */
select.bop-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2338bdf8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
}

select.bop-input option {
    background-color: #0b172e;
    color: #ffffff;
    padding: 10px;
}

.bop-pwd-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}

.bop-pwd-toggle:hover {
    color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
}

.bop-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 12.5px;
}

.bop-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bop-text-muted);
    cursor: pointer;
    user-select: none;
}

.bop-checkbox-label:hover {
    color: #e2e8f0;
}

.bop-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.bop-checkbox-label input[type="checkbox"]:checked {
    background: var(--bop-primary);
    border-color: var(--bop-primary);
}

.bop-checkbox-label input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #ffffff;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bop-forgot-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bop-forgot-link:hover {
    color: #7dd3fc;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    text-decoration: underline;
}

.bop-btn-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: var(--bop-radius-sm) !important;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.bop-btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: bopShimmer 3.5s infinite;
}

@keyframes bopShimmer {
    0% { left: -100%; }
    30%, 100% { left: 100%; }
}

.bop-btn-submit:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    box-shadow: 0 6px 26px rgba(2, 132, 199, 0.65), 0 0 15px rgba(56, 189, 248, 0.4);
    transform: translate3d(0, -2px, 0);
}

.bop-btn-arrow {
    transition: transform 0.2s ease;
}

.bop-btn-submit:hover .bop-btn-arrow {
    transform: translateX(4px);
}

.bop-btn-submit:active {
    transform: translate3d(0, 0, 0);
}

.bop-auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 11px;
    color: var(--bop-text-dim);
    line-height: 1.5;
}

.bop-security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #94a3b8;
}

/* ============================================================
   --- ESPACE CLIENT (PORTAIL USAGERS — ZERO SCROLL UX) ---
   ============================================================ */
.bop-client-container {
    width: 100%;
    max-width: 480px;
    margin: 10px auto 20px !important;
    padding: 0 10px;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

.bop-client-card {
    background: linear-gradient(150deg, rgba(10, 20, 42, 0.96) 0%, rgba(6, 14, 30, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--bop-radius) !important;
    padding: 28px 28px 24px !important;
    box-shadow: 
        0 20px 45px -10px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 35px rgba(2, 132, 199, 0.2) !important;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    color: #ffffff !important;
    animation: bopCardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bop-client-header {
    text-align: center;
    margin-bottom: 18px;
}

.bop-client-country {
    font-family: 'Cinzel', serif !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    letter-spacing: 1.8px !important;
    color: #fbbf24 !important;
    text-transform: uppercase !important;
    margin-bottom: 3px !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
}

.bop-client-ministry {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    letter-spacing: 1.4px !important;
    color: #cbd5e1 !important;
    text-transform: uppercase !important;
    margin-bottom: 12px !important;
}

.bop-client-crest {
    display: inline-block;
    width: 68px;
    height: 68px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.4));
    animation: bopCrestFloat 5s ease-in-out infinite alternate;
}

.bop-client-title {
    font-family: 'Cinzel', serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 4px !important;
}

.bop-client-subtitle {
    font-size: 12px !important;
    color: var(--bop-text-muted) !important;
    line-height: 1.45 !important;
}

.bop-client-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 11px;
    color: var(--bop-text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.bop-client-footer-highlight {
    color: #cbd5e1;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 900px) {
    .bop-auth-wrapper {
        grid-template-columns: 1fr;
        max-width: 520px;
    }
    .bop-auth-side {
        border-right: none;
        border-bottom: 1px solid var(--bop-border-card);
        padding: 28px 24px;
    }
    .bop-pillars {
        display: none;
    }
    .bop-crest-wrapper {
        width: 105px;
        height: 105px;
        margin-bottom: 12px;
    }
    .bop-inst-title {
        font-size: 16px;
    }
    .bop-auth-main {
        padding: 30px 24px;
    }
}
