/**
 * Custom Login Page Styles
 * 
 * Glassmorphism design with uniform spacing
 * Portrait orientation glass container
 * Heading: Bebas Neue Bold
 * Text color: #23275f
 * 
 * SPACING SYSTEM (8px base unit):
 * - Container padding: 40px (5 units)
 * - Section gaps: 24px (3 units)
 * - Input height: 52px
 * - Button height: 52px
 * - Border radius: 26px (half of height for pill shape)
 */

/* Reset and base styles */
body.login {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('/wp-content/uploads/2026/01/portaldesktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mobile background */
@media screen and (max-width: 768px) {
    body.login {
        background-image: url('/wp-content/uploads/2026/01/portal-mobile.png');
    }
}

/* Hide default WordPress elements */
body.login #backtoblog,
body.login #nav,
body.login .privacy-policy-page-link,
body.login h1,
body.login .language-switcher {
    display: none !important;
}

/* Login wrapper - Portrait orientation */
body.login #login {
    width: 380px;
    max-width: 90%;
    padding: 0;
    margin: 0;
}

/* Main login form container - Glassmorphism Portrait */
body.login #loginform {
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 0;
}

/* Form labels - hide them */
body.login #loginform label[for="user_login"],
body.login #loginform label[for="user_pass"] {
    display: none !important;
}

/* Username input wrapper */
body.login #loginform > p:first-of-type {
    margin: 0 0 24px 0 !important;
}

/* Password wrapper */
body.login #loginform .user-pass-wrap {
    margin: 0 0 24px 0 !important;
    position: relative;
}

body.login #loginform .wp-pwd {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
}

/* Input styling - uniform */
body.login #loginform .input,
body.login #loginform input[type="text"],
body.login #loginform input[type="password"] {
    background: rgba(255, 255, 255, 0.4) !important;
    width: 100% !important;
    height: 52px !important;
    border: 1.5px solid rgba(35, 39, 95, 0.15) !important;
    border-radius: 26px !important;
    padding: 0 48px 0 20px !important;
    font-size: 15px !important;
    font-family: 'Poppins', sans-serif !important;
    color: #23275f !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    line-height: normal !important;
}

body.login #loginform input::placeholder {
    color: #23275f !important;
    opacity: 0.6;
    font-size: 15px;
}

/* Focus state */
body.login #loginform input:focus {
    border-color: rgba(35, 39, 95, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(35, 39, 95, 0.08) !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Password toggle button - vertically centered */
body.login .wp-hide-pw {
    position: absolute !important;
    right: 16px !important;
    top: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 24px !important;
    height: 52px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #23275f !important;
    z-index: 10;
    opacity: 0.7;
}

body.login .wp-hide-pw:hover {
    background: transparent !important;
    opacity: 1;
}

body.login .wp-hide-pw .dashicons {
    color: #23275f !important;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

body.login .wp-hide-pw:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remember me checkbox - horizontal layout */
body.login #loginform .forgetmenot {
    margin: 0 0 24px 0 !important;
    float: none !important;
}

body.login #loginform .forgetmenot label {
    color: #23275f !important;
    font-size: 14px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

body.login #loginform input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #23275f;
    cursor: pointer;
    margin: 0 !important;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Submit button */
body.login #loginform .submit {
    margin: 0 !important;
    float: none !important;
}

body.login #loginform #wp-submit {
    display: block !important;
    background: #ffffff !important;
    color: #23275f !important;
    width: 100% !important;
    height: 52px !important;
    border-radius: 26px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none !important;
    text-shadow: none !important;
    transition: all 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}

body.login #loginform #wp-submit:hover {
    background: #23275f !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 39, 95, 0.3);
}

body.login #loginform #wp-submit:active {
    transform: translateY(0);
}

/* Error messages */
body.login #login_error,
body.login .message,
body.login .success {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(35, 39, 95, 0.15);
    border-left: 4px solid #dc3545;
    color: #23275f;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

body.login .message {
    border-left-color: #28a745;
}

body.login #login_error a,
body.login .message a {
    color: #23275f;
    text-decoration: underline;
    font-weight: 600;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

body.login.shake #loginform {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   RESPONSIVE - TABLET (max-width: 768px)
   ======================================== */
@media screen and (max-width: 768px) {
    body.login #login {
        width: 360px;
        max-width: 92%;
    }
    
    body.login #loginform {
        padding: 36px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (max-width: 480px)
   ======================================== */
@media screen and (max-width: 480px) {
    body.login #login {
        width: 100%;
        max-width: 94%;
    }
    
    body.login #loginform {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    body.login #loginform .input,
    body.login #loginform input[type="text"],
    body.login #loginform input[type="password"] {
        height: 48px !important;
        border-radius: 24px !important;
        padding: 0 44px 0 18px !important;
        font-size: 14px !important;
    }
    
    body.login #loginform .wp-pwd {
        height: 48px;
    }
    
    body.login #loginform #wp-submit {
        height: 48px !important;
        border-radius: 24px !important;
        font-size: 15px !important;
    }
    
    body.login .wp-hide-pw {
        right: 14px !important;
        height: 48px !important;
        width: 22px !important;
    }
    
    body.login .wp-hide-pw .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
    
    body.login #loginform > p:first-of-type,
    body.login #loginform .user-pass-wrap {
        margin: 0 0 20px 0 !important;
    }
    
    body.login #loginform .forgetmenot {
        margin: 0 0 20px 0 !important;
    }
}

/* Loading state */
body.login #loginform.loading #wp-submit {
    opacity: 0.7;
    cursor: wait;
}

/* Autofill styling for webkit browsers */
body.login input:-webkit-autofill,
body.login input:-webkit-autofill:hover,
body.login input:-webkit-autofill:focus {
    -webkit-text-fill-color: #23275f !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.4) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Clear floats */
body.login #loginform::after {
    content: '';
    display: table;
    clear: both;
}
