/*
 Theme Name:   Xpro Child
 Description:  Xpro Child Theme for Horfield Primary School Assocation
 Author:       Luke Hart 
 Template:     xpro
 Version:      1.0.0
*/


/* Hide page titles globally */
.page .entry-title, 
.page .page-title, 
.page .post-title-container {
    display: none !important;
}

/* =========================================
   LOGIN MODAL STYLES
   ========================================= */

/* Backdrop (covers the entire screen and is hidden by default) */
#front-end-login-modal {
    position: fixed;
    z-index: 99999; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none; /* CRITICAL: Must be 'none' when inactive */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Modal Content Box */
#front-end-login-modal .login-modal-content {
    background-color: #fefefe;
    padding: 40px 30px 30px; 
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease-in-out;
}

/* Close button */
.login-modal-close-btn {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    line-height: 1;
}
.login-modal-close-btn:hover {
    color: #333;
}

/* Class to make the modal visible (This needs 'display: flex;') */
#front-end-login-modal.modal-active {
    display: flex !important; /* CRITICAL: Show the backdrop */
    opacity: 1 !important;
	visibility: visible !important;
}
/* Move the content into position when active */
#front-end-login-modal.modal-active .login-modal-content {
    transform: translateY(0) !important;
}


/* ==========================================================
   B. CONSOLIDATED FORM & FLOATING LABEL STYLES
   ========================================================== */

/* 1. Base Layout and Sizing */
#custom_login_form p {
    display: block; 
    margin-bottom: 25px; /* Increase spacing to account for floating label */
    clear: both; 
}

/* 2. Input Field Styling */
#custom_login_form input[type="text"],
#custom_login_form input[type="password"],
#custom_login_form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 50px; /* Consistent height for the floating effect */
    transition: all 0.2s ease;
}

/* 3. Floating Label Group Structure */
#custom_login_form .floating-label-group {
    position: relative;
    padding-top: 25px; /* Space for the label to float up */
}

/* 4. Label Styling (The Floating Part) */
#custom_login_form .floating-label-group label {
    /* REMOVE display: block; from here */
    position: absolute;
    top: 0;
    left: 12px;
    opacity: 0; 
    font-size: 12px;
    color: #888;
    transition: all 0.2s ease;
    pointer-events: none; 
    transform: translateY(35px); /* Starts inside the box (below the input padding) */
    font-weight: normal; /* Override bold if it was inherited */
}

/* 5. Floating Logic: When the parent paragraph is focused or has content */
#custom_login_form p.field-focused label {
    top: 5px; /* Moves up to the padding area */
    opacity: 1;
    transform: translateY(0);
    font-size: 12px;
    color: #333; /* Darker color when focused */
    font-weight: bold;
}

/* 6. Remember Me / Checkbox Fix */
#custom_login_form .forgetmenot {
    float: none; 
    display: flex;
    align-items: center;
    font-size: 14px;
    /* Reset padding-top from floating-label-group */
    padding-top: 0; 
    margin-bottom: 10px;
}
#custom_login_form .forgetmenot input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    height: auto;
}

/* 7. Submit Button (Make it full width like the AliExpress example) */
#custom_login_form #wp-submit {
    width: 100%;
    height: 50px;
    line-height: 1;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 16px;
    margin-top: 15px;
}


/* ==========================================================
   VALIDATION AND BUTTON STYLES
   ========================================================== */

/* Highlight invalid fields (used by JS) */
.input-invalid input[type="text"],
.input-invalid input[type="password"] {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 1px #ff0000;
}

/* Tooltip/Error Message for Email Field */
.login-username .field-error-message {
    display: none;
    color: #ff0000;
    font-size: 12px;
    margin-top: 5px;
    /* Position the tooltip below the input field */
    position: absolute; 
    bottom: -20px; 
    left: 0;
    width: 100%;
    z-index: 10; /* Ensure it is above other elements */
}
/* Show the error message when the container is marked invalid by JS */
.login-username.input-invalid .field-error-message {
    display: block;
}

/* Disabled Submit Button */
#custom_login_form #wp-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #0073aa; /* Keep original color but dimmed */
}


/* ==========================================================
   SSO PROVIDERS (CLEAN FONT AWESOME STYLES)
   ========================================================= */
.custom-sso-providers {
    margin: 20px 0;
}
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 13px;
    color: #999;
}
.sso-line {
    flex-grow: 1;
    height: 1px;
    background-color: #eee;
    margin: 0 10px;
}
.sso-icon-container {
    text-align: center;
    margin-top: 15px;
}
.sso-icon-group {
    display: inline-flex;
    gap: 15px;
}
.sso-icon-btn {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
/* Style the container link */
.sso-icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px; 
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 50%;
    transition: border-color 0.2s;
}
.sso-icon-link:hover {
    border-color: #333;
}
/* Style the Font Awesome icons themselves */
.sso-icon-link i {
    font-size: 18px; /* Icon size */
}
/* Specific colors for icons */
.fa-google { color: #DB4437; }
.fa-facebook-f { color: #1877F2; }
.fa-apple { color: #000; }
.fa-twitter { color: #1DA1F2; }


/* ==========================================================
   REGISTRATION LINK
   ========================================================= */
.register-link-container {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #555;
    padding-top: 15px; /* Space above the link */
    border-top: 1px solid #eee; /* Separator line */
}
.register-link-container a {
    font-weight: bold;
    color: #0073aa; 
    text-decoration: none;
}
.register-link-container a:hover {
    text-decoration: underline;
}

/* ==========================================================
   OVERRIDE NEXTEND STYLES FOR CUSTOM ICONS
   ========================================================== */

/* Target the NSL classes added to our custom link and neutralize them */
.sso-icon-link.nsl-button {
    /* Reset Button container properties */
    padding: 0 !important;
    margin: 0 !important;
    line-height: initial !important; 
    border-radius: 50% !important; /* Ensure the circle shape is kept */
    width: 40px !important;
    height: 40px !important;
    display: flex !important; /* Re-apply flex to center the icon */
    justify-content: center !important;
    align-items: center !important;
    border: 1px solid #ccc !important; /* Re-apply your custom border */
}

/* Hide any text/logo container NSL might try to add inside our custom link */
.sso-icon-link .nsl-button-svg-container, 
.sso-icon-link .nsl-button-label-container {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure the Font Awesome icon inside our link is visible and correctly styled */
.sso-icon-link i.fab {
    display: block !important;
    visibility: visible !important;
    color: inherit !important; /* Use the specific color set for each provider (e.g., .fa-google) */
}


/* Re-apply the hiding of the original button set in step 1 */
#nextend-login-wrapper .nsl-container-buttons,
#nextend-login-wrapper .nsl-container {
    display: none !important; 
    visibility: hidden !important; 
    height: 0 !important;
    overflow: hidden !important;
}


/* =================== 
 * Checkout page 
 * ======================== */
/* 1. Hide the standard checkbox and its original placeholder */
#ship-to-different-address, 
.woocommerce-shipping-fields h3#ship-to-different-address-placeholder {
    display: none !important;
}

/* 2. Style the NEW title we just added via PHP */
#custom-delivery-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #333;
    display: block !important;
}

/* 3. Style the box containing the fields */
.woocommerce-shipping-fields__field-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* 4. Ensure fields are full width */
.woocommerce-shipping-fields__field-wrapper .form-row {
    width: 100% !important;
}

.custom-delivery-header {
    display: block !important;
    visibility: visible !important;
}

.woocommerce-shipping-fields__field-wrapper select {
    width: 100%;
    height: 45px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 10px;
    background-color: #fff;
}
