/* =========================================
   GLOBAL JOURNALS AUTHENTICATION STYLES
   ========================================= */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --gj-primary: #1849c7;
    --gj-primary-dark: #123694;
    --gj-text-main: #0f172a;
    --gj-text-muted: #64748b;
    --gj-border: #e2e8f0;
    --gj-bg-light: #f8fafc;
    --gj-white: #ffffff;
    --gj-error: #ef4444;
    --gj-success: #10b981;
    --gj-radius: 12px;
}

/* =========================================
   SPLIT LAYOUT (Fullscreen Overlay)
   ========================================= */
.gj-split-layout {
    position: fixed;
    /* Force fullscreen, covering theme header/footer */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    /* Highest priority */
    display: flex;
    background-color: var(--gj-primary);

    /* Overlay Gradient: Solid Blue Left -> Semi-Transparent Blue Right (Tinting the image) */
    background:
        linear-gradient(90deg,
            #1849c7 0%,
            #1849c7 35%,
            rgba(24, 73, 199, 0.85) 60%,
            rgba(24, 73, 199, 0.4) 100%),
        url('https://images.globaljournals.org/login-scaled.jpg') no-repeat right center / cover;

    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    /* Allow scrolling if height is small */
}

.create-new-password header#qodef-page-header,
.create-new-password footer#qodef-page-footer {
    display: none !important;
}

.page-restore-password #qodef-page-content {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin Bar Adjustment */
body.admin-bar .gj-split-layout {
    top: 32px;
    height: calc(100vh - 32px);
}

/* Left Side - Form Card */
.gj-layout-left {
    flex: 0 0 45%;
    /* Fixed width 45% */
    display: flex;
    justify-content: center;
    /* Center card horizontally */
    align-items: center;
    /* Center card vertically */
    padding: 40px;
    position: relative;
    z-index: 20;
    background: transparent;
    /* Ensure transparent */
}

/* Right Side - Hero Text */
.gj-layout-right {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 80px;
    color: #ffffff;
    z-index: 10;
    position: relative;
}

.gj-hero-content {
    max-width: 700px;
}

.gj-hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gj-hero-subtitle {
    font-size: 20px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    max-width: 550px;
}

/* Mobile Responsive Layout */
@media (max-width: 1024px) {
    .gj-split-layout {
        position: relative;
        /* Reset for mobile flow */
        width: 100%;
        height: auto;
        min-height: 100vh;
        flex-direction: column;
        background: #f8fafc;
        z-index: 100;
        /* Lower z-index to behave normally */
    }

    /* Force hide theme header on mobile via CSS hiding since fixed pos is removed */
    body.login-page #masthead,
    body.login-page header,
    .page-template-default .site-header {
        display: none !important;
    }

    .gj-layout-left {
        order: 2;
        width: 100%;
        flex: auto;
        background: #f8fafc;
        padding: 40px 20px;
    }

    .gj-layout-right {
        order: 1;
        width: 100%;
        flex: 0 0 auto;
        padding: 60px 30px;
        background: var(--gj-primary);
        align-items: center;
        text-align: center;
    }

    .gj-hero-title {
        font-size: 36px;
    }
}

/* =========================================
   AUTH CARD CONTAINER (Floating White Card)
   ========================================= */
.gj-auth-container {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
}

.gj-auth-card {
    background: #ffffff;
    padding: 48px;
    border-radius: 28px;
    /* High radius */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    /* Optimal reading width */
    position: relative;
    overflow: visible;
}

/* =========================================
   TYPOGRAPHY & HEADERS
   ========================================= */
.gj-auth-header {
    margin-bottom: 36px;
}

/* Hide auth icon if present in markup but redundant with design */
.gj-auth-icon {
    display: none;
}

.gj-auth-logo {
    margin-bottom: 24px;
    display: block;
}

.gj-auth-title {
    font-size: 30px;
    font-weight: 800;
    /* Extra Bold */
    color: var(--gj-text-main);
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.gj-auth-subtitle {
    font-size: 15px;
    color: var(--gj-text-muted);
    font-weight: 500;
    margin: 0;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */
.gj-auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* More space between fields */
}

.gj-auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gj-auth-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-left: 2px;
}

.gj-auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.gj-auth-input {
    width: 100%;
    height: 52px;
    /* Taller input */
    padding: 0 16px;
    font-size: 15px;
    color: var(--gj-text-main);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
    font-weight: 500;
}

.gj-auth-input:focus {
    border-color: #000000;
    /* Black border focuses */
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.gj-auth-input::placeholder {
    color: #94a3b8;
}

/* Validation */
.gj-auth-input.is-invalid {
    border-color: var(--gj-error);
    background-color: #fff9f9;
}

.gj-auth-field-error {
    font-size: 13px;
    color: var(--gj-error);
    margin-top: 4px;
    font-weight: 500;
}

/* Password Toggle */
.gj-auth-password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    top: 17px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.gj-auth-password-toggle:hover {
    color: #0f172a;
}

.gj-auth-password-toggle .gj-eye-closed {
    display: none;
}

.gj-auth-password-toggle.active .gj-eye-closed {
    display: block;
}

.gj-auth-password-toggle.active .gj-eye-open {
    display: none;
}

/* =========================================
   BUTTONS (Pitch Black)
   ========================================= */
.gj-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    /* Big button */
    padding: 0 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    width: 100%;
    border: 1px solid !important;
}

/* PRIMARY: Pure Black */
.gj-auth-btn-primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

html body .gj-auth-btn-primary:hover {
    background: transparent !important;
    color: #0e202a !important;
    border: 1px solid #0e202a !important;
    box-shadow: none !important;
    transform: none !important;
}

.gj-auth-btn-primary svg {
    stroke: currentColor;
    transition: stroke 0.3s;
}

.gj-auth-btn-primary:hover svg {
    stroke: #0e202a;
}

/* Ensure anchor buttons work correctly */
a.gj-auth-btn-primary {
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
}

html body a.gj-auth-btn-primary:hover {
    background: transparent !important;
    color: #0e202a !important;
    border: 1px solid #0e202a !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Loaders */
.btn-loader {
    display: inline-flex;
    animation: spin 1s linear infinite;
}

.spinner {
    width: 22px;
    height: 22px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   UTILITIES
   ========================================= */
.gj-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -8px;
    margin-bottom: 24px;
    font-size: 13px;
}

.gj-auth-link {
    color: var(--gj-primary);
    text-decoration: none;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.gj-auth-link:hover {
    text-decoration: underline;
}

.gj-auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gj-text-muted);
}

.gj-auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.gj-auth-checkbox {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.gj-auth-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.gj-auth-checkbox:checked+.gj-auth-checkbox-custom {
    background: #000000;
    border-color: #000000;
}

.gj-auth-checkbox:checked+.gj-auth-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* User Badge */
.gj-auth-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gj-text-main);
    margin-top: 8px;
}

.gj-auth-edit-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--gj-text-muted);
    display: flex;
    align-items: center;
    border-radius: 50%;
}

.gj-auth-edit-btn:hover {
    background: #e2e8f0;
    color: var(--gj-text-main);
}

/* Alerts */
.gj-auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.gj-auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.gj-auth-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

/* =========================================
   PASSWORD REQUIREMENTS
   ========================================= */
.gj-reg-password-requirements {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gj-req-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s ease;
}

.gj-req-item svg {
    opacity: 0;
    color: #1769ff;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gj-req-item.met {
    color: #1769ff;
}

.gj-req-item.met svg {
    opacity: 1;
    transform: scale(1);
}

/* Animations */
.gj-auth-slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}