/**
 * PixeeHub Authentication Styles
 * Modern, clean design with best practices
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Force override Elementor containers */
.elementor-widget-shortcode .elementor-widget-container,
.elementor-element .elementor-widget-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main wrapper - SIMPLE CLEAN */
.pixeehub-auth-wrapper {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    min-height: auto;
}

/* Auth container - OLD LAYOUT */
.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
}

/* Auth container - SIMPLE CLEAN */
.auth-container-simple {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    min-width: 400px;
    padding: 36px;
    box-sizing: border-box;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: visible;
}

/* Left side - Branding */
.auth-brand {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('https://files.pixeehub.com/2025/05/ChatGPT-Image-10_05_2025-11_26_08.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 400px;
}

.brand-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Brand features */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.feature .icon {
    font-size: 1.2rem;
}

/* Brand stats */
.brand-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat {
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat span {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Brand security */
.brand-security {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.security-item .icon {
    font-size: 1.2rem;
}

/* Right side - Form */
.auth-form {
    flex: 1;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* New simple form styling */
.auth-form-simple {
    width: 100%;
}

.auth-form-simple .form-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form-simple .logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.auth-form-simple h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.auth-form-simple p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 30px 0;
}

/* Form header - SIMPLE */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-link {
    display: inline-block;
    margin-bottom: 16px;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    height: 32px;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.form-header p {
    color: #718096;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
}

/* Form elements */
.auth-form-element {
    width: 100%;
}

.field-group {
    margin-bottom: 20px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.field-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    color: #2d3748;
    box-sizing: border-box;
    font-weight: 400;
}

.field-group input:focus {
    outline: none;
    border-color: #007cf0;
    box-shadow: 0 0 0 3px rgba(0, 124, 240, 0.1);
}

.field-group input:hover:not(:focus) {
    border-color: #cbd5e1;
}

.field-group small {
    display: block;
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Checkbox - IMPROVED ALIGNMENT */
.checkbox-group {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    gap: 8px;
    text-align: left;
    max-width: 100%;
}

.checkbox-label input[type="checkbox"] {
    margin: 2px 0 0 0 !important;
    width: auto !important;
    height: auto !important;
    accent-color: #3b82f6;
}

.checkbox-label a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit button - SIMPLE GRADIENT */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #007cf0 0%, #00dfd8 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 24px;
    margin-top: 8px;
    position: relative;
    min-height: 48px;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0066cc 0%, #00c4b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 124, 240, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: inline;
}

.btn-loading {
    display: none;
}

/* Google OAuth Button */
.google-btn {
    width: 100%;
    background: #fff;
    border: 2px solid #e5e7eb;
    color: #374151;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    font-family: inherit;
    margin-bottom: 16px;
}

.google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    text-decoration: none;
    color: #374151;
}

.google-btn:active {
    transform: translateY(1px);
}

.google-btn svg {
    flex-shrink: 0;
}

/* Auth divider - FIXED */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0 16px 0;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    color: #6b7280;
    font-size: 0.875rem;
    position: relative;
    z-index: 2;
}

/* reCAPTCHA - CLEAN NO BOX */
.g-recaptcha {
    display: block;
    margin: 8px auto 8px auto;
    width: 304px;
    max-width: none;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: none;
    min-height: 78px;
    overflow: visible;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.g-recaptcha > div {
    margin: 0 auto !important;
}

/* Force reCAPTCHA iframe to center */
.g-recaptcha iframe {
    margin: 0 auto !important;
    display: block !important;
    border-radius: 8px !important;
}

/* Center reCAPTCHA in field group */
.field-group .g-recaptcha {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px auto;
}

/* Real Google Button Styling */
.real-google-btn {
    width: 100%;
    display: flex;
    justify-content: stretch;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 48px;
}

.real-google-btn > div {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}

.real-google-btn iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    border: none !important;
}

/* Force Google button to expand */
.real-google-btn div[role="button"] {
    width: 100% !important;
    min-width: 100% !important;
}

/* Google auth section styling - CENTERED */
.google-auth-section,
.auth-form-simple .google-auth-section {
    width: 100% !important;
    margin-bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.google-auth-section .real-google-btn {
    margin-bottom: 20px;
}

.google-auth-section .custom-google-btn,
.auth-form-simple .google-auth-section .custom-google-btn {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex !important;
}

/* Custom Google button - SIMPLE STYLE */
.custom-google-btn,
#custom-google-login,
#custom-google-register,
.auth-form .custom-google-btn,
.auth-form-simple .custom-google-btn,
.google-auth-section .custom-google-btn,
.auth-form-simple .google-auth-section .custom-google-btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 20px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    transition: all 0.2s ease !important;
    background: white !important;
    color: #2d3748 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    margin: 0 auto !important;
    margin-bottom: 20px !important;
    position: relative !important;
    min-height: 48px !important;
}

.custom-google-btn:hover,
#custom-google-login:hover,
#custom-google-register:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    text-decoration: none !important;
    color: #2d3748 !important;
}

.custom-google-btn:focus,
#custom-google-login:focus,
#custom-google-register:focus {
    outline: none !important;
    border-color: #007cf0 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 240, 0.1) !important;
}

.custom-google-btn svg {
    width: 20px;
    height: 20px;
}

/* Form links */
.form-links {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.form-links .link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.form-links .link:hover {
    text-decoration: underline;
}

.form-links .separator {
    margin: 0 8px;
    color: #d1d5db;
}

/* Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-message.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .auth-brand {
        min-height: 200px;
        padding: 40px 20px;
    }
    
    .brand-content h2 {
        font-size: 2rem;
    }
    
    .brand-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .auth-form {
        padding: 40px 20px;
    }
}

@media (max-width: 640px) {
    .auth-container-simple {
        padding: 28px 20px;
        min-width: 320px;
    }
    
    .form-header {
        margin-bottom: 28px;
    }
    
    .form-header h1 {
        font-size: 1.75rem;
    }
    
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .field-group input[type="text"],
    .field-group input[type="email"],
    .field-group input[type="password"] {
        padding: 14px 16px;
    }
    
    .submit-btn {
        padding: 14px 20px;
    }
    
    .custom-google-btn,
    #custom-google-login,
    #custom-google-register {
        padding: 14px 16px !important;
    }
    
    #login-recaptcha .g-recaptcha,
    #register-recaptcha .g-recaptcha,
    .g-recaptcha {
        width: 304px !important;
        max-width: none !important;
        transform: translateX(-50%) scale(0.9) !important;
        transform-origin: center !important;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form {
    animation: fadeInUp 0.5s ease-out;
}

/* Focus states for accessibility */
.submit-btn:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* RECAPTCHA CENTER FIX - NO CROP */
#login-recaptcha,
#register-recaptcha,
.field-group #login-recaptcha,
.field-group #register-recaptcha {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    margin: 8px auto 8px auto !important;
    padding: 0 !important;
    overflow: visible !important;
    min-height: 78px !important;
    position: relative !important;
}

#login-recaptcha .g-recaptcha,
#register-recaptcha .g-recaptcha,
.field-group #login-recaptcha .g-recaptcha,
.field-group #register-recaptcha .g-recaptcha {
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
    width: 304px !important;
    max-width: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

#login-recaptcha .g-recaptcha > div,
#register-recaptcha .g-recaptcha > div,
.field-group #login-recaptcha .g-recaptcha > div,
.field-group #register-recaptcha .g-recaptcha > div {
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
}

#login-recaptcha iframe,
#register-recaptcha iframe,
.g-recaptcha iframe {
    margin: 0 auto !important;
    display: block !important;
    width: 304px !important;
    max-width: none !important;
    overflow: visible !important;
    position: relative !important;
}

/* GOOGLE SECTION CENTER */
.google-auth-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
}

.google-auth-section .custom-google-btn,
.google-auth-section #custom-google-login,
.google-auth-section #custom-google-register {
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* FORCE TIGHT SPACING - ULTRA SPECIFIC */
.auth-form-simple .field-group:has(#login-recaptcha),
.auth-form-simple .field-group:has(#register-recaptcha),
.field-group:has(#login-recaptcha),
.field-group:has(#register-recaptcha) {
    margin-bottom: 8px !important;
    margin-top: 8px !important;
}

.auth-form-simple #login-form .submit-btn,
.auth-form-simple #register-form .submit-btn {
    margin-top: 8px !important;
    margin-bottom: 16px !important;
}

/* FORCE RECAPTCHA TIGHT */
.auth-form-simple .g-recaptcha,
.auth-form-simple #login-recaptcha,
.auth-form-simple #register-recaptcha {
    margin: 8px auto 4px auto !important;
    padding: 0 !important;
}

.auth-form-simple .g-recaptcha + * {
    margin-top: 4px !important;
}

/* BRUTAL FORCE - LAST RESORT */
.pixeehub-auth-wrapper .auth-container-simple .auth-form-simple .field-group {
    margin-bottom: 20px !important;
}

.pixeehub-auth-wrapper .auth-container-simple .auth-form-simple .field-group:has(.g-recaptcha) {
    margin-bottom: 8px !important;
    margin-top: 8px !important;
}

.pixeehub-auth-wrapper .auth-container-simple .auth-form-simple .submit-btn {
    margin-top: 8px !important;
}

/* SPECIFIC FORM TARGETING */
#login-form .field-group:last-of-type {
    margin-bottom: 8px !important;
}

#register-form .field-group:nth-last-of-type(2) {
    margin-bottom: 8px !important;
}

/* EMERGENCY FIX - ZERO MARGINS EVERYWHERE */
div#login-recaptcha,
div#register-recaptcha {
    margin: 0px !important;
    padding: 0px !important;
}

div#login-recaptcha .g-recaptcha,
div#register-recaptcha .g-recaptcha {
    margin: 0px auto 0px auto !important;
    padding: 0px !important;
}

div#login-recaptcha .g-recaptcha > div,
div#register-recaptcha .g-recaptcha > div {
    margin: 0px !important;
    padding: 0px !important;
}

/* FORCE BUTTON CLOSER */
#login-form .submit-btn,
#register-form .submit-btn {
    margin-top: 4px !important;
    margin-bottom: 16px !important;
}

/* NUCLEAR OPTION - IFRAME DIRECT */
.pixeehub-auth-wrapper iframe[src*="recaptcha"] {
    margin: 0px !important;
    padding: 0px !important;
    display: block !important;
}

/* FIELD GROUP NUCLEAR */
.pixeehub-auth-wrapper .field-group[style*="text-align: center"] {
    margin: 0px !important;
    padding: 0px !important;
    min-height: auto !important;
}

/* SPECIFIC NUCLEAR TARGETING */
.pixeehub-auth-wrapper .auth-form-simple form .field-group:has(.g-recaptcha) {
    margin: 0px 0px 0px 0px !important;
    padding: 0px !important;
    height: auto !important;
    min-height: auto !important;
}

/* BUTTON OPTIMAL SPACING */
.pixeehub-auth-wrapper .auth-form-simple form .submit-btn {
    margin: 12px 0px 24px 0px !important;
    margin-top: 12px !important;
}

/* FINAL NUCLEAR SOLUTION */
.g-recaptcha {
    margin: 0px auto !important;
    padding: 0px !important;
    display: block !important;
    height: 78px !important;
    max-height: 78px !important;
    overflow: hidden !important;
}

.g-recaptcha * {
    margin: 0px !important;
    padding: 0px !important;
}

.g-recaptcha iframe {
    margin: 0px !important;
    padding: 0px !important;
    display: block !important;
}

/* REMOVE ALL SPACING FROM RECAPTCHA CONTAINERS */
.field-group:has(.g-recaptcha),
div[id*="recaptcha"] {
    margin: 0px !important;
    padding: 0px !important;
    height: 78px !important;
    max-height: 78px !important;
    overflow: hidden !important;
}

/* OPTIMAL SPACING FOR SUBMIT BUTTON - UX BEST PRACTICES */
.submit-btn {
    margin-top: 12px !important;
}