/* ═══════════════════════════════════════════════════════════
   Styles Juslead — Admin Auth Pages (login, forgot, reset)
   Split-screen layout with news panel
   Light theme by default, dark theme via html.dark-mode
   ═══════════════════════════════════════════════════════════ */

:root {
    --jl-teal-light: #34BFBF; /* primary-400 */
    --jl-teal: #2D9AA6; /* primary-500 */
    --jl-teal-dark: #1E557C; /* primary-800 */
    --jl-blue-dark: #1E3A4F;
    --jl-charcoal: #1E293B;
    --jl-white: #FFFFFF;
    --jl-gray-50: #F8FAFC;
    --jl-gray-100: #F1F5F9;
    --jl-gray-200: #E2E8F0;
    --jl-gray-300: #CBD5E1;
    --jl-gray-400: #94A3B8;
    --jl-gray-500: #64748B;
    --jl-gray-600: #475569;
    --jl-gray-700: #334155;
    --jl-border: #E2E8F0;
    --jl-radius: 10px;
    --jl-radius-lg: 16px;
    --jl-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --jl-shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --jl-gradient: linear-gradient(135deg, var(--jl-teal-light) 0%, var(--jl-teal-dark) 100%);
}

/* ═══════════════════════════════════════════════════════════
   LIGHT THEME (default)
   ═══════════════════════════════════════════════════════════ */

/* ── Reset body ── */
body.login_admin,
body.authentication.forgot-password,
body.authentication.reset-password {
    background: var(--jl-gray-50) !important;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

/* ── Split Screen Wrapper (injected by JS) ── */
.jl-split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ── Left Panel (form area) ── */
.jl-left-panel {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: var(--jl-white);
    background-image:
        linear-gradient(rgba(20, 184, 166, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    overflow-y: auto;
    position: relative;
}

/* Subtle radial glow */
.jl-left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 40% 30%, rgba(20, 184, 166, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(20, 184, 166, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Blur blob (ambient light) */
.jl-left-panel::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.jl-left-panel .authentication-form-wrapper,
.jl-left-panel .authentication-form-wrappe {
    max-width: 420px;
    width: 100%;
    padding-top: 0 !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
}

/* ── Right Panel (full background image) ── */
.jl-right-panel {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    background-color: var(--jl-charcoal);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Gradient overlay for text readability */
.jl-right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(42, 111, 122, 0.95) 0%,
        rgba(42, 111, 122, 0.7) 40%,
        rgba(42, 111, 122, 0.35) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.jl-right-panel::after {
    display: none;
}

/* ── News Content ── */
.jl-news-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    padding: 60px 48px;
}

.jl-news-headline {
    color: var(--jl-white);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.jl-news-subheadline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 40px;
}

/* ── Post Cards ── */
.jl-posts-container {
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 4px;
}

.jl-posts-container::-webkit-scrollbar {
    width: 3px;
}

.jl-posts-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.jl-posts-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.jl-post-card {
    cursor: default;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.jl-post-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.jl-post-card:first-child {
    padding-top: 0;
}

.jl-post-card a {
    text-decoration: none;
    color: inherit;
}

.jl-post-card-image {
    display: none;
}

.jl-post-card-overlay {
    display: flex;
    flex-direction: column;
}

.jl-post-card-title {
    color: var(--jl-white);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.jl-post-card-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.jl-post-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--jl-white);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 10px;
    opacity: 0.9;
    transition: gap 0.2s ease, opacity 0.2s ease;
}

.jl-post-card-link:hover {
    gap: 10px;
    opacity: 1;
}

.jl-post-card-link svg {
    width: 14px;
    height: 14px;
}

/* ── No posts placeholder ── */
.jl-no-posts {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    padding: 40px 0;
}

/* ── Form Styling Overrides (LIGHT) ── */
body.login_admin .company-logo img,
body.authentication .company-logo img {
    max-height: 96px;
}

body.login_admin .company-logo,
body.authentication .company-logo {
    padding: 0 0 24px 0;
    text-align: left;
}

body.login_admin h1,
body.authentication h1 {
    text-align: left !important;
    font-size: 24px !important;
    color: var(--jl-gray-700) !important;
    font-weight: 700 !important;
}

body.login_admin .tw-text-neutral-600,
body.authentication .tw-text-neutral-600 {
    text-align: left;
    color: var(--jl-gray-500) !important;
}

body.login_admin .tw-text-2xl + p,
body.authentication .tw-text-2xl + p {
    text-align: left;
}

/* Remove default card styling */
body.login_admin .tw-bg-white,
body.authentication .tw-bg-white {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* Input fields (light) */
body.login_admin .form-control,
body.authentication .form-control {
    height: 48px;
    border: 1px solid var(--jl-gray-200);
    border-radius: var(--jl-radius);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--jl-gray-700);
    background: var(--jl-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.login_admin .form-control:focus,
body.authentication .form-control:focus {
    border-color: var(--jl-teal-light);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
    outline: none;
    background: var(--jl-white);
}

body.login_admin .form-control::placeholder,
body.authentication .form-control::placeholder {
    color: var(--jl-gray-400);
}

/* Labels */
body.login_admin .control-label,
body.authentication .control-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--jl-gray-600);
}

/* Primary button (teal gradient) */
body.login_admin .btn-primary,
body.authentication .btn-primary {
    background: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 100%) !important;
    border: none !important;
    height: 48px;
    border-radius: var(--jl-radius) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #000 !important;
    letter-spacing: 0.01em;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3) !important;
}

body.login_admin .btn-primary:hover,
body.authentication .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4) !important;
    transform: translateY(-2px);
}

body.login_admin .btn-primary:active,
body.authentication .btn-primary:active {
    transform: translateY(0);
}

/* Checkbox */
body.login_admin .checkbox label,
body.authentication .checkbox label {
    color: var(--jl-gray-500);
    font-size: 14px;
}

/* Links */
body.login_admin a.text-muted,
body.authentication a.text-muted {
    color: var(--jl-teal) !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.login_admin a.text-muted:hover,
body.authentication a.text-muted:hover {
    color: var(--jl-teal-light) !important;
}

/* Alerts */
body.login_admin .alert,
body.authentication .alert {
    border-radius: var(--jl-radius);
    font-size: 14px;
}

body.login_admin .alert-danger,
body.authentication .alert-danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

body.login_admin .alert-success,
body.authentication .alert-success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

body.login_admin .alert-info,
body.authentication .alert-info {
    background: #F0F9FF;
    border-color: #BAE6FD;
    color: #075985;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .jl-split-screen {
        flex-direction: column;
    }

    .jl-left-panel {
        flex: 1;
        max-width: 100%;
        padding: 30px 20px;
        min-height: 100vh;
    }

    .jl-right-panel {
        display: none;
    }

    body.login_admin,
    body.authentication.forgot-password,
    body.authentication.reset-password {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
}

@media (max-width: 480px) {
    .jl-left-panel {
        padding: 20px 16px;
    }

    .jl-left-panel .authentication-form-wrapper,
    .jl-left-panel .authentication-form-wrappe {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — activated via html.dark-mode class
   (set by jl_dark_mode module via localStorage)
   ═══════════════════════════════════════════════════════════ */

/* Body background */
html.dark-mode body.login_admin,
html.dark-mode body.authentication.forgot-password,
html.dark-mode body.authentication.reset-password {
    background: #000 !important;
}

/* Left panel dark background with teal grid */
html.dark-mode .jl-left-panel {
    background-color: #000;
    background-image:
        linear-gradient(rgba(20, 184, 166, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.03) 1px, transparent 1px);
}

/* Stronger radial glow in dark mode */
html.dark-mode .jl-left-panel::before {
    background:
        radial-gradient(ellipse at 40% 30%, rgba(20, 184, 166, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(20, 184, 166, 0.08) 0%, transparent 50%);
}

html.dark-mode .jl-left-panel::after {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.07) 0%, transparent 70%);
}

/* Right panel — darken overlay in dark mode */
html.dark-mode .jl-right-panel::before {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* Post cards — subtler borders */
html.dark-mode .jl-post-card {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Logo — invert to white on dark bg */
html.dark-mode body.login_admin .company-logo img,
html.dark-mode body.authentication .company-logo img {
    filter: brightness(0) invert(1);
}

/* Heading — white text */
html.dark-mode body.login_admin h1,
html.dark-mode body.authentication h1 {
    color: #fafafa !important;
}

/* Subtitle text */
html.dark-mode body.login_admin .tw-text-neutral-600,
html.dark-mode body.authentication .tw-text-neutral-600 {
    color: #a1a1aa !important;
}

/* Input fields — glassmorphism on dark */
html.dark-mode body.login_admin .form-control,
html.dark-mode body.authentication .form-control {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
    background: rgba(255, 255, 255, 0.05);
}

html.dark-mode body.login_admin .form-control:focus,
html.dark-mode body.authentication .form-control:focus {
    border-color: rgba(20, 184, 166, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

html.dark-mode body.login_admin .form-control::placeholder,
html.dark-mode body.authentication .form-control::placeholder {
    color: #52525b;
}

/* Labels */
html.dark-mode body.login_admin .control-label,
html.dark-mode body.authentication .control-label {
    color: #a1a1aa;
}

/* Button — stronger glow on dark */
html.dark-mode body.login_admin .btn-primary,
html.dark-mode body.authentication .btn-primary {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.4) !important;
}

html.dark-mode body.login_admin .btn-primary:hover,
html.dark-mode body.authentication .btn-primary:hover {
    box-shadow: 0 0 40px rgba(20, 184, 166, 0.6) !important;
}

/* Checkbox */
html.dark-mode body.login_admin .checkbox label,
html.dark-mode body.authentication .checkbox label {
    color: #71717a;
}

/* Links — brighter teal on dark */
html.dark-mode body.login_admin a.text-muted,
html.dark-mode body.authentication a.text-muted {
    color: #5eead4 !important;
}

html.dark-mode body.login_admin a.text-muted:hover,
html.dark-mode body.authentication a.text-muted:hover {
    color: #99f6e4 !important;
}

/* Alerts — dark variants */
html.dark-mode body.login_admin .alert-danger,
html.dark-mode body.authentication .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

html.dark-mode body.login_admin .alert-success,
html.dark-mode body.authentication .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

html.dark-mode body.login_admin .alert-info,
html.dark-mode body.authentication .alert-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

/* ── Responsive — dark mode mobile ── */
@media (max-width: 991px) {
    html.dark-mode body.login_admin,
    html.dark-mode body.authentication.forgot-password,
    html.dark-mode body.authentication.reset-password {
        background: #000 !important;
    }
}
