/**
 * PWA E-Commerce – Modern Login Page Styles  v3.2.3
 * Two-column split layout: branded left panel + clean right form.
 * Loaded via login_enqueue_scripts hook.
 */

/* ═══════════════════════════════════════════════════════════════
   WEB FONT – loaded @import as safety fallback if wp_enqueue fails
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════════════════════
   UNIVERSAL FONT OVERRIDE — eliminates Bengali/system font fallback
   Must come before any other rule so specificity wins everywhere.
   ═══════════════════════════════════════════════════════════════ */
body.login,
body.login *,
body.login input,
body.login button,
body.login label,
body.login a,
body.login select,
body.login textarea,
body.login h1,
body.login h2,
body.login h3,
body.login p,
body.login li,
body.login span,
body.login div {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Arial, Helvetica, sans-serif !important;
}

/* ═══════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
   ═══════════════════════════════════════════════════════════════ */
:root {
    --lp-red:      #e8192c;
    --lp-red-dk:   #c0111f;
    --lp-dark:     #0d0d0d;
    --lp-dark2:    #1a0306;
    --lp-white:    #ffffff;
    --lp-gray-50:  #f9fafb;
    --lp-gray-100: #f3f4f6;
    --lp-gray-200: #e5e7eb;
    --lp-gray-400: #9ca3af;
    --lp-gray-600: #6b7280;
    --lp-gray-700: #374151;
    --lp-gray-900: #111827;
    --lp-radius:   12px;
    --lp-shadow:   0 20px 60px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    --lp-trans:    all .25s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   BODY – two-column flex container
   ═══════════════════════════════════════════════════════════════ */
body.login {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: var(--lp-gray-50);
    /* font-family forced above via universal rule */
    color: var(--lp-gray-900);
}

/* ── Hide WordPress logo completely ── */
#login h1 {
    display: none !important;
}

/* Main Login Container */
#login {
    padding: 0;
    width: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 32px;
}

/* ── Site badge shown above the welcome message ── */
#login::before {
    content: attr(data-site);
    display: none; /* hidden — we use a PHP-injected badge instead */
}

/* Custom site-name badge injected via PHP above the form */
.pwa-login-site-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    align-self: flex-start;
    width: 100%;
    max-width: 420px;
}
.pwa-login-site-badge__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lp-red);
    box-shadow: 0 0 0 3px rgba(232,25,44,.20);
    flex-shrink: 0;
}
.pwa-login-site-badge__name {
    font-size: 15px;
    font-weight: 800;
    color: var(--lp-gray-900);
    letter-spacing: -.2px;
}

/* ═══════════════════════════════════════════════════════════════
   LEFT DECORATIVE PANEL  (.pwa-lp-panel)
   ═══════════════════════════════════════════════════════════════ */
.pwa-lp-panel {
    position: relative;
    flex: 0 0 44%;
    min-height: 100vh;
    background: linear-gradient(145deg, var(--lp-dark) 0%, var(--lp-dark2) 55%, #2a0208 80%, var(--lp-red-dk) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pwa-lp-panel__inner {
    position: relative;
    z-index: 2;
    padding: 60px 48px;
    color: var(--lp-white);
    max-width: 400px;
}

/* Decorative floating circles (purely decorative) */
.pwa-lp-deco {
    position: absolute;
    border-radius: 50%;
    opacity: .12;
    animation: lpFloat 8s ease-in-out infinite;
}
.pwa-lp-deco--1 {
    width: 340px; height: 340px;
    background: var(--lp-red);
    bottom: -80px; right: -80px;
    animation-delay: 0s;
}
.pwa-lp-deco--2 {
    width: 200px; height: 200px;
    background: #ff6b7a;
    top: -40px; left: -40px;
    animation-delay: 3s;
}
@keyframes lpFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-16px) scale(1.05); }
}

/* Logo / Brand */
.pwa-lp-logo {
    max-height: 52px;
    max-width: 180px;
    width: auto;
    margin-bottom: 32px;
    display: block;
    filter: brightness(0) invert(1);
}
.pwa-lp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -.8px;
    margin-bottom: 8px;
    color: var(--lp-white);
}
.pwa-lp-brand__dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--lp-red);
    box-shadow: 0 0 0 4px rgba(232,25,44,.3);
    flex-shrink: 0;
}
.pwa-lp-brand__desc {
    font-size: 13px;
    color: rgba(255,255,255,.5);
    margin: 0 0 28px;
    font-weight: 400;
}

/* Panel headline */
.pwa-lp-title {
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 14px;
    color: var(--lp-white);
}

.pwa-lp-sub {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,.72);
    margin: 0 0 32px;
}

/* Feature bullet list */
.pwa-lp-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pwa-lp-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
}
.pwa-lp-features li::before {
    content: '';
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--lp-red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.485 1.929a1 1 0 0 1 0 1.414L6.343 10.485a1 1 0 0 1-1.414 0L1.515 7.071a1 1 0 0 1 1.414-1.414L5.636 8.364 12.07 1.929a1 1 0 0 1 1.415 0z'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ═══════════════════════════════════════════════════════════════
   RIGHT FORM PANEL  (#login)
   ═══════════════════════════════════════════════════════════════ */

/* Welcome message (login_message filter) */
/* Welcome / action message block */
.pwa-login-welcome {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    max-width: 420px;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
}
.pwa-lw-title {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--lp-gray-900);
    line-height: 1.2;
    letter-spacing: -.4px;
}
.pwa-lw-sub {
    display: block;
    font-size: 13.5px;
    color: var(--lp-gray-400);
    font-weight: 400;
    line-height: 1.5;
}

/* Form card wrapper */
#loginform,
#registerform,
#lostpasswordform {
    background: var(--lp-white) !important;
    border: 1px solid var(--lp-gray-200) !important;
    border-top: 3px solid var(--lp-red) !important;
    border-radius: var(--lp-radius) !important;
    box-shadow: var(--lp-shadow) !important;
    padding: 32px 28px 28px !important;
    margin-bottom: 0 !important;
    position: relative;
    width: 100%;
    max-width: 420px;
}

/* Animated top accent */
#loginform::after,
#registerform::after,
#lostpasswordform::after {
    content: '';
    position: absolute;
    top: -3px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lp-red), #ff6b7a, var(--lp-red));
    background-size: 200% 100%;
    animation: lpAccent 3s ease infinite;
    border-radius: var(--lp-radius) var(--lp-radius) 0 0;
}
@keyframes lpAccent {
    0%, 100% { background-position: 0%; }
    50%       { background-position: 100%; }
}

/* Form Labels */
#loginform label,
#registerform label,
#lostpasswordform label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--lp-gray-700);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}
/* Remove any ::before icon pseudo-elements */
#loginform label::before,
#registerform label::before,
#lostpasswordform label::before { display: none; }

/* Input Fields */
#loginform input[type="text"],
#loginform input[type="password"],
#loginform input[type="email"],
#registerform input[type="text"],
#registerform input[type="password"],
#registerform input[type="email"],
#lostpasswordform input[type="text"],
#lostpasswordform input[type="email"] {
    display: block;
    width: 100% !important;
    border: 1.5px solid var(--lp-gray-200) !important;
    border-radius: 10px !important;
    padding: 11px 15px !important;
    font-size: 14.5px !important;
    font-weight: 500;
    background: var(--lp-gray-50) !important;
    color: var(--lp-gray-900) !important;
    box-shadow: none !important;
    transition: var(--lp-trans) !important;
    outline: none !important;
    margin-bottom: 2px;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
#loginform input[type="email"]:focus,
#registerform input[type="text"]:focus,
#registerform input[type="password"]:focus,
#registerform input[type="email"]:focus,
#lostpasswordform input[type="text"]:focus,
#lostpasswordform input[type="email"]:focus {
    border-color: var(--lp-red) !important;
    background: var(--lp-white) !important;
    box-shadow: 0 0 0 3px rgba(232, 25, 44, .10) !important;
}

/* Password visibility toggle */
.wp-hide-pw,
.wp-pwd button {
    color: var(--lp-gray-400) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: color .2s !important;
    cursor: pointer;
}
.wp-hide-pw:hover,
.wp-pwd button:hover { color: var(--lp-red) !important; }

/* Remember Me */
.forgetmenot { margin: 2px 0 4px !important; }
.forgetmenot label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--lp-gray-600) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}
.forgetmenot input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--lp-red);
    cursor: pointer;
    flex-shrink: 0;
}

/* Forgot Password link */
#login #nav a[href*="lostpassword"] {
    color: #3b82f6 !important;
    font-weight: 600;
}
#login #nav a[href*="lostpassword"]:hover {
    color: var(--lp-red) !important;
    text-decoration: underline;
}

/* ── Submit Button ── */
.wp-core-ui #login .button-primary,
.wp-core-ui #login .button-large {
    width: 100%;
    padding: 13px 20px !important;
    height: auto !important;
    background: linear-gradient(130deg, var(--lp-red) 0%, var(--lp-red-dk) 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(232, 25, 44, .30) !important;
    color: var(--lp-white) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: .2px;
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
    transition: var(--lp-trans) !important;
    cursor: pointer;
    margin-top: 10px;
}
.wp-core-ui #login .button-primary:hover {
    background: linear-gradient(130deg, var(--lp-red-dk) 0%, #9a0e18 100%) !important;
    box-shadow: 0 6px 22px rgba(232, 25, 44, .40) !important;
    transform: translateY(-2px);
}
.wp-core-ui #login .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(232, 25, 44, .28) !important;
}
.wp-core-ui #login .button-primary.disabled,
.wp-core-ui #login .button-primary:disabled {
    opacity: .6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ── Divider between form and footer ── */
#login #loginform + #nav,
#login #lostpasswordform + #nav {
    border-top: 1px solid var(--lp-gray-100);
    padding-top: 14px !important;
}

/* ── Footer links ── */
#login #nav,
#login #backtoblog {
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-top: 16px !important;
}
#login #nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 420px;
    margin-left: auto; margin-right: auto;
}
#login #backtoblog {
    margin-top: 0 !important;
    border-top: 1px solid var(--lp-gray-100);
    padding-top: 12px !important;
}

#login #nav a,
#login #backtoblog a {
    color: var(--lp-gray-500) !important;
    text-decoration: none;
    transition: color .2s, text-decoration .2s;
    font-size: 12.5px;
}
#login #nav a:hover,
#login #backtoblog a:hover {
    color: var(--lp-red) !important;
    text-decoration: underline !important;
}

#login #backtoblog a::before {
    content: '\2190\00a0';
    font-weight: 800;
    opacity: .65;
}

/* ── Trust strip (login_footer) ── */
.pwa-login-trust {
    display: none; /* removed per design */
}

/* ── Submit button loading state ── */
.wp-core-ui #login .button-primary.pwa-btn-loading {
    opacity: .75 !important;
    cursor: wait !important;
    position: relative;
}
.wp-core-ui #login .button-primary.pwa-btn-loading::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lpSpin .7s linear infinite;
}
@keyframes lpSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Shake animation on error ── */
@keyframes pwaShake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-6px); }
    40%     { transform: translateX(6px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(4px); }
}
.pwa-shake { animation: pwaShake .55s ease both; }

/* ── Error & notification messages ── */
#login_error,
#login .message,
#login .success {
    border-left: 4px solid var(--lp-red) !important;
    background: #fee2e2 !important;
    border-radius: 10px !important;
    padding: 13px 16px !important;
    margin-bottom: 18px !important;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none !important;
    max-width: 420px;
    width: 100%;
}
#login .message,
#login .success {
    border-left-color: #16a34a !important;
    background: #dcfce7 !important;
}

/* Privacy link */
#login .privacy-policy-page-link {
    text-align: center;
    margin-top: 14px;
    max-width: 420px;
    width: 100%;
}
#login .privacy-policy-page-link a {
    color: var(--lp-gray-400) !important;
    font-size: 12px;
    text-decoration: none;
}
#login .privacy-policy-page-link a:hover { color: var(--lp-gray-600) !important; }

/* Language Switcher */
#language-switcher {
    text-align: center;
    margin-top: 16px;
    max-width: 420px;
    width: 100%;
}
#language-switcher label { font-size: 12px; color: var(--lp-gray-400); font-weight: 500; }
#language-switcher select {
    border: 1.5px solid var(--lp-gray-200);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--lp-white);
    color: var(--lp-gray-700);
}

/* Interim / popup login */
.interim-login body.login { flex-direction: column; background: var(--lp-gray-50); }
.interim-login .pwa-lp-panel { display: none; }
.interim-login #login {
    padding: 24px;
    min-height: auto;
    width: auto;
    justify-content: flex-start;
}

/* ═══════════════════════════════════════════════════════════════
   FOCUS / ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
#login *:focus-visible {
    outline: 2px solid var(--lp-red) !important;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE – hide panel on small screens
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
    body.login { flex-direction: column; background: var(--lp-gray-50); }
    .pwa-lp-panel { display: none; }
    #login {
        flex: none;
        width: 100%;
        min-height: 100vh;
        padding: 48px 20px 40px;
    }
}

@media (max-width: 480px) {
    #login { padding: 32px 16px 32px; }
    #loginform,
    #registerform,
    #lostpasswordform { padding: 24px 18px 22px !important; }
    #login #nav { flex-direction: column; align-items: center; }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE  (prefers-color-scheme: dark)
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    body.login {
        background: #111827;
    }
    #login {
        background: #111827;
    }
    #loginform,
    #registerform,
    #lostpasswordform {
        background: #1f2937 !important;
        border-color: #374151 !important;
    }
    #loginform label,
    #registerform label,
    #lostpasswordform label { color: #d1d5db; }
    #loginform input[type="text"],
    #loginform input[type="password"],
    #loginform input[type="email"],
    #registerform input[type="text"],
    #registerform input[type="password"],
    #registerform input[type="email"],
    #lostpasswordform input[type="text"],
    #lostpasswordform input[type="email"] {
        background: #111827 !important;
        border-color: #374151 !important;
        color: #f9fafb !important;
    }
    .pwa-login-welcome { background: #1f2937; color: #9ca3af; }
    #login #nav a, #login #backtoblog a { color: #9ca3af !important; }
    #login_error { background: #350f0f !important; }
}
