/**
 * Oz Reez Auth Modal - Styles
 * Dark theme with brand blue accents
 * Matches existing License Modal styling
 */

/* ============================================
   MODAL OVERLAY
   ============================================ */
.oz-auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(4px);
}

.oz-auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ============================================
   MODAL CONTAINER
   ============================================ */
.oz-auth-modal-container {
    position: relative;
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    background-color: #111;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin: auto;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.oz-auth-modal-overlay.active .oz-auth-modal-container {
    transform: translateY(0);
}

/* Mobile: Slide up from bottom */
@media (max-width: 768px) {
    .oz-auth-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .oz-auth-modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        transform: translateY(100%);
    }
    
    .oz-auth-modal-overlay.active .oz-auth-modal-container {
        transform: translateY(0);
    }
}

/* ============================================
   MODAL HEADER
   ============================================ */
.oz-auth-modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.oz-auth-modal-header-content {
    flex: 1;
    min-width: 0;
    padding-right: 16px;
}

.oz-auth-modal-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #d8d8d8 !important;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

/* Ensure embedded form title on my-account page is also #d8d8d8 */
.oz-auth-embedded .oz-auth-modal-title,
.woocommerce-account .oz-auth-modal-title,
h2.oz-auth-modal-title {
    color: #d8d8d8 !important;
}

.oz-auth-modal-subtext {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

.oz-auth-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.oz-auth-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.oz-auth-modal-close:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* ============================================
   MODAL BODY
   ============================================ */
.oz-auth-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    position: relative;
}

/* ============================================
   TABS
   ============================================ */
.oz-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.oz-auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oz-auth-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
}

.oz-auth-tab.active {
    color: #3176CE;
}

.oz-auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3176CE;
}

.oz-auth-tab:focus {
    outline: 2px solid #3176CE;
    outline-offset: -2px;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.oz-auth-tab-content {
    display: none;
}

.oz-auth-tab-content.active {
    display: block;
}

/* ============================================
   GOOGLE SIGN-IN BUTTON
   Full width, #d8d8d8 background, black text
   FIXED: Proper alignment of icon and text
   ============================================ */
.oz-auth-google-btn {
    width: 100% !important;
    max-width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background-color: #d8d8d8 !important;
    border: none !important;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #000000 !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none !important;
    outline: none !important;
    box-sizing: border-box;
    margin: 0 !important;
    /* CRITICAL FIX 4a: Ensure proper vertical alignment */
    line-height: 1;
    text-align: center;
    position: relative;
}

.oz-auth-google-btn:hover {
    background-color: #c0c0c0 !important;
    border: none !important;
    box-shadow: none;
    color: #000000 !important;
}

.oz-auth-google-btn:focus {
    background-color: #d8d8d8 !important;
    border: none !important;
    box-shadow: none;
    outline: none !important;
    color: #000000 !important;
}

.oz-auth-google-btn:active {
    background-color: #b8b8b8 !important;
    border: none !important;
    color: #000000 !important;
}

/* CRITICAL FIX 4c: Google button loading state - show spinner replacing content */
.oz-auth-google-btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.oz-auth-google-btn.loading .oz-auth-google-icon {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide the text content when loading */
.oz-auth-google-btn.loading {
    font-size: 0 !important;
}

.oz-auth-google-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 5px solid rgba(0, 0, 0, 0.2);
    border-top-color: #333;
    border-radius: 50%;
    animation: oz-auth-spin 0.8s linear infinite;
    /* CRITICAL FIX 4c: Full opacity for spinner */
    opacity: 1 !important;
}

.oz-auth-google-btn:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

.oz-auth-google-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.oz-auth-google-icon {
    width: 20px;
    height: 20px;
    /* CRITICAL FIX 4a: Ensure icon is vertically centered with text */
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   DIVIDER
   ============================================ */
.oz-auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 16px;
}

.oz-auth-divider::before,
.oz-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.oz-auth-divider-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   FORM STYLES
   ============================================ */
.oz-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.oz-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.oz-auth-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.oz-auth-input {
    width: 100%;
    padding: 14px 16px;
    background: #141414;
    border: 1px solid #383838;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    color: #D8D8D8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.oz-auth-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.oz-auth-input:focus {
    outline: none;
    border-color: #3176CE;
    box-shadow: 0 0 0 3px rgba(49, 118, 206, 0.15);
}

.oz-auth-input.error {
    border-color: #dc2626;
}

/* ============================================
   CHECKBOX
   ============================================ */
.oz-auth-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.oz-auth-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #3176CE;
    flex-shrink: 0;
    margin-top: 2px;
}

.oz-auth-checkbox-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    cursor: pointer;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.oz-auth-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background-color: #3176CE;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    /* CRITICAL FIX Issue #2: Only transition background-color, no other animations */
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* CRITICAL FIX Issue #2: Simple hover - only background color change, no transform/box-shadow */
.oz-auth-submit-btn:hover {
    background-color: #2A63AE;
}

.oz-auth-submit-btn:active {
    background-color: #2A63AE;
}

.oz-auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.oz-auth-submit-btn:focus {
    outline: 2px solid #3176CE;
    outline-offset: 2px;
}

/* CRITICAL FIX 4b: Loading state - hide text completely, show only spinner at FULL OPACITY */
.oz-auth-submit-btn.loading {
    position: relative;
    color: transparent !important;
    text-indent: -9999px;
    pointer-events: none;
}

.oz-auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    /* CRITICAL FIX 4b: Full opacity for spinner border */
    border: 5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: oz-auth-spin 0.8s linear infinite;
    text-indent: 0;
    /* CRITICAL FIX 4b: Ensure spinner is fully visible */
    opacity: 1 !important;
}

@keyframes oz-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ERROR/SUCCESS MESSAGES
   ============================================ */
.oz-auth-message {
    padding: 12px 16px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.oz-auth-message.error {
    display: block;
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.oz-auth-message.success {
    display: block;
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ============================================
   EMBEDDED FORM (MY ACCOUNT PAGE)
   ============================================ */
.oz-auth-embedded {
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
}

.oz-auth-embedded .oz-auth-modal-header {
    padding: 0 0 24px 0;
    border-bottom: none;
}

.oz-auth-embedded .oz-auth-modal-close {
    display: none;
}

.oz-auth-embedded .oz-auth-modal-body {
    padding: 0;
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .oz-auth-modal-header {
        padding: 20px;
    }
    
    .oz-auth-modal-title {
        font-size: 18px;
    }
    
    .oz-auth-modal-subtext {
        font-size: 13px;
    }
    
    .oz-auth-modal-body {
        padding: 20px;
    }
    
    .oz-auth-tab {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .oz-auth-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .oz-auth-submit-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .oz-auth-google-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.oz-auth-modal-body::-webkit-scrollbar {
    width: 8px;
}

.oz-auth-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.oz-auth-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.oz-auth-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   DOWNLOAD TRIGGER BUTTON STYLES
   ============================================ */
.oz-download-trigger {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.oz-download-trigger:hover {
    opacity: 0.8;
}

/* ============================================
   HIDE DEFAULT WOOCOMMERCE MY ACCOUNT FORMS
   ============================================ */
body.woocommerce-account:not(.logged-in) .woocommerce-form-login,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register,
body.woocommerce-account:not(.logged-in) .u-columns {
    display: none !important;
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */
.oz-auth-forgot-password {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 8px;
}

.oz-auth-forgot-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    color: #d8d8d8 !important;
    text-decoration: none;
    transition: none;
}

.oz-auth-forgot-link:hover,
.oz-auth-forgot-link:focus,
.oz-auth-forgot-link:active,
.oz-auth-forgot-link:visited {
    color: #d8d8d8 !important;
    text-decoration: underline;
}

/* ============================================
   OVERRIDE ANY PINK/ACCENT COLORS
   ============================================ */
.oz-auth-tab:hover,
.oz-auth-tab:focus,
.oz-auth-tab:active {
    background-color: transparent !important;
    border-color: transparent !important;
}

.oz-auth-submit-btn,
.oz-auth-submit-btn:link,
.oz-auth-submit-btn:visited,
.oz-auth-submit-btn:focus {
    background-color: #3176CE !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
}

.oz-auth-submit-btn:hover {
    background-color: #2A63AE !important;
    color: #ffffff !important;
}

.oz-auth-submit-btn:active {
    background-color: #2A63AE !important;
    color: #ffffff !important;
}

/* Google button - ensure styling is preserved */
.oz-auth-google-btn,
.oz-auth-google-btn:link,
.oz-auth-google-btn:visited {
    background-color: #d8d8d8 !important;
    border: none !important;
    color: #000000 !important;
    outline: none !important;
    width: 100% !important;
}

/* Remove any pink outlines or borders */
.oz-auth-modal-container *:focus {
    outline-color: #3176CE !important;
}

.oz-auth-embedded *:focus {
    outline-color: #3176CE !important;
}

/* ============================================
   AUTOFILL BACKGROUND FIX FOR DARK THEME
   Override browser autofill styles
   ============================================ */
.oz-auth-input:-webkit-autofill,
.oz-auth-input:-webkit-autofill:hover,
.oz-auth-input:-webkit-autofill:focus,
.oz-auth-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #141414 inset !important;
    -webkit-text-fill-color: #D8D8D8 !important;
    box-shadow: 0 0 0 1000px #141414 inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #D8D8D8 !important;
}

/* WooCommerce form autofill overrides for dark theme */
.woocommerce-form input:-webkit-autofill,
.woocommerce-form input:-webkit-autofill:hover,
.woocommerce-form input:-webkit-autofill:focus,
.woocommerce-form input:-webkit-autofill:active,
.woocommerce input:-webkit-autofill,
.woocommerce input:-webkit-autofill:hover,
.woocommerce input:-webkit-autofill:focus,
.woocommerce input:-webkit-autofill:active,
.woocommerce-page input:-webkit-autofill,
.woocommerce-page input:-webkit-autofill:hover,
.woocommerce-page input:-webkit-autofill:focus,
.woocommerce-page input:-webkit-autofill:active,
.woocommerce-checkout input:-webkit-autofill,
.woocommerce-checkout input:-webkit-autofill:hover,
.woocommerce-checkout input:-webkit-autofill:focus,
.woocommerce-checkout input:-webkit-autofill:active,
.woocommerce-cart input:-webkit-autofill,
.woocommerce-cart input:-webkit-autofill:hover,
.woocommerce-cart input:-webkit-autofill:focus,
.woocommerce-cart input:-webkit-autofill:active,
.woocommerce-account input:-webkit-autofill,
.woocommerce-account input:-webkit-autofill:hover,
.woocommerce-account input:-webkit-autofill:focus,
.woocommerce-account input:-webkit-autofill:active,
#billing_email:-webkit-autofill,
#billing_email:-webkit-autofill:hover,
#billing_email:-webkit-autofill:focus,
#billing_first_name:-webkit-autofill,
#billing_first_name:-webkit-autofill:hover,
#billing_first_name:-webkit-autofill:focus,
#billing_last_name:-webkit-autofill,
#billing_last_name:-webkit-autofill:hover,
#billing_last_name:-webkit-autofill:focus,
#billing_phone:-webkit-autofill,
#billing_phone:-webkit-autofill:hover,
#billing_phone:-webkit-autofill:focus,
#billing_address_1:-webkit-autofill,
#billing_address_1:-webkit-autofill:hover,
#billing_address_1:-webkit-autofill:focus,
#billing_city:-webkit-autofill,
#billing_city:-webkit-autofill:hover,
#billing_city:-webkit-autofill:focus,
#billing_postcode:-webkit-autofill,
#billing_postcode:-webkit-autofill:hover,
#billing_postcode:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #141414 inset !important;
    -webkit-text-fill-color: #D8D8D8 !important;
    box-shadow: 0 0 0 1000px #141414 inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #D8D8D8 !important;
}

/* ============================================
   SHOW PASSWORD ICON COLOR FIX
   Force password toggle to be visible on dark theme
   ============================================ */
.woocommerce-form .show-password-input,
.woocommerce .show-password-input,
.show-password-input,
.oz-auth-form .show-password-input,
.password-input .show-password-toggle,
.woocommerce-password-toggle,
button[type="button"].password-toggle,
.show-password-button {
    color: #d8d8d8 !important;
    fill: #d8d8d8 !important;
    opacity: 1 !important;
}

.woocommerce-form .show-password-input::after,
.woocommerce .show-password-input::after,
.show-password-input::after,
.password-input .show-password-toggle::after {
    color: #d8d8d8 !important;
    opacity: 1 !important;
}

/* Hover state for password toggle */
.woocommerce-form .show-password-input:hover,
.woocommerce .show-password-input:hover,
.show-password-input:hover,
.password-input .show-password-toggle:hover,
.woocommerce-password-toggle:hover,
button[type="button"].password-toggle:hover,
.show-password-button:hover {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* If it's an SVG icon */
.show-password-input svg,
.show-password-toggle svg,
.woocommerce-password-toggle svg,
.password-toggle svg {
    fill: #d8d8d8 !important;
    color: #d8d8d8 !important;
}

.show-password-input svg:hover,
.show-password-toggle svg:hover,
.woocommerce-password-toggle svg:hover,
.password-toggle svg:hover {
    fill: #ffffff !important;
    color: #ffffff !important;
}

/* WooCommerce specific password field wrapper */
.woocommerce-form__input-wrapper .show-password-input,
.woocommerce-Input-wrapper .show-password-input {
    color: #d8d8d8 !important;
}

/* Auth modal specific */
.oz-auth-modal-container .show-password-input,
.oz-auth-embedded .show-password-input {
    color: #d8d8d8 !important;
}
