/*
Theme Name: Bridges Mortgages
Theme URI: https://bridgesmortgages.com
Author: Bridges Mortgages Team
Author URI: https://bridgesmortgages.com
Description: A professional WordPress theme for mortgage broker services featuring a clean blue and white design, mortgage calculator, rate displays, and application forms.
Version: 1.0
License: GPL v2 or later
Text Domain: bridges-mortgages
*/

:root {
    --primary-blue: #1e4d8b;
    --secondary-blue: #2c6fb7;
    --light-blue: #e8f2ff;
    --accent-blue: #4a90e2;
    --text-dark: #333333;
    --text-gray: #666666;
    --border-gray: #e0e0e0;
    --success-green: #28a745;
    --warning-orange: #ffc107;
    --white: #ffffff;
    --off-white: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--white);
    font-weight: 400;
    letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
}

h1 { font-size: 2.75rem; font-weight: 700; }
h2 { font-size: 2.25rem; font-weight: 600; }
h3 { font-size: 1.875rem; font-weight: 600; }
h4 { font-size: 1.5rem; font-weight: 500; }
h5 { font-size: 1.25rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    font-family: 'Poppins', sans-serif;
    display: inline-block;
    padding: 14px 35px;
    background-color: var(--secondary-blue);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
}

.btn:hover {
    background-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 77, 139, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-blue);
    color: var(--secondary-blue);
}

.btn-outline:hover {
    background-color: var(--secondary-blue);
    color: var(--white);
}

header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-top {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 10px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.contact-info a {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--white);
    font-size: 18px;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
}

.custom-logo {
    max-height: 100px;
    width: auto;
    display: block;
    transition: max-height 0.3s ease, transform 0.3s ease;
}

.header-scrolled .custom-logo {
    max-height: 60px;
}

.custom-logo-link {
    display: inline-block;
    line-height: 1;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--secondary-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover {
    color: var(--secondary-blue);
}

nav a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-blue);
}

.hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-large {
    padding: 550px 0 240px;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    position: relative;
    background: transparent;
}

@media screen and (min-height: 1200px) {
    .hero-large {
        padding: 800px 0 240px !important;
    }
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    z-index: 2;
    position: relative;
    background: rgba(30, 77, 139, 0.75);
    padding: 20px 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--white);
    margin-bottom: 25px;
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
    letter-spacing: -1px;
}

.hero p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.375rem;
    font-weight: 300;
    margin-bottom: 40px;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.section {
    padding: 60px 0;
}

.section-alt {
    background-color: var(--off-white);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    margin-bottom: 15px;
}

.section-title p {
    font-size: 1.125rem;
    color: var(--text-gray);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.services-section .card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.services-section .card:hover {
    background-color: var(--white);
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.services-section .section-title {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 60px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.services-section .section-title h2,
.services-section .section-title p {
    text-shadow: none;
}

.icon-box {
    width: 60px;
    height: 60px;
    background-color: var(--light-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--primary-blue);
}

.rate-table {
    width: 100%;
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.rate-table th {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 15px;
    text-align: left;
}

.rate-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-gray);
}

.rate-table tr:last-child td {
    border-bottom: none;
}

.rate-table tr:hover {
    background-color: var(--light-blue);
}

.calculator {
    background-color: var(--white);
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 1px solid var(--border-gray);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-blue);
}

/* Financial Statement Table Styling */
.financial-statement-section {
    margin-bottom: 40px;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.financial-table th {
    background: var(--primary-blue);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid var(--secondary-blue);
}

.financial-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: white;
}

.financial-table input,
.financial-table select {
    width: 100%;
    padding: 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
}

.financial-table input:focus,
.financial-table select:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: -2px;
    background: #f8f9fa;
}

.financial-table .readonly-field {
    background: #f5f5f5 !important;
    color: #666;
    cursor: not-allowed;
}

.section-header th {
    background: var(--primary-blue) !important;
    color: white !important;
}

.sub-header th {
    background: var(--light-blue) !important;
    color: var(--primary-blue) !important;
    font-weight: 600;
}

/* Application Steps */
.application-step {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.application-step.hidden {
    display: none;
}

/* Pre-screening specific styling */
#pre-screening .card {
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Compact styling for dense tables */
.compact-input {
    padding: 4px 6px !important;
    font-size: 12px !important;
}

.compact-select {
    padding: 4px !important;
    font-size: 12px !important;
}

.compact-date {
    padding: 4px 6px !important;
    font-size: 12px !important;
}

#secured-loans-table td {
    padding: 4px 6px !important;
}

#secured-loans-table th {
    padding: 4px 6px !important;
}

/* Application Form Mobile Styles */
.application-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

/* Responsive table styling - Portrait and Landscape */
@media (max-width: 1024px) {
    /* Move Application Process sidebar to bottom on all mobile/tablet devices */
    .application-form-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .application-process-sidebar {
        order: 2;
        margin-top: 40px;
    }
    
    .application-process-sidebar .card {
        position: static !important;
    }
    
    .application-form-content {
        order: 1;
    }
}

/* Specifically target landscape orientation on mobile */
@media (orientation: landscape) and (max-height: 768px) {
    /* Ensure sidebar stays at bottom even in landscape */
    .application-form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .application-process-sidebar {
        order: 2;
        margin-top: 40px;
    }
    
    .application-process-sidebar .card {
        position: static !important;
    }
    
    .application-form-content {
        order: 1;
    }
}

/* Additional mobile-specific styles */
@media (max-width: 768px) {
    
    /* Make bankruptcy section stack vertically on mobile */
    .bankruptcy-section {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .bankruptcy-section > * {
        width: 100%;
    }
    
    .bankruptcy-section strong {
        min-width: auto !important;
    }
    
    /* Convert tables to stacked layout on mobile */
    .financial-table {
        display: block;
        border: none;
        width: 100%;
    }
    
    .financial-table thead {
        display: none;
    }
    
    .financial-table tbody {
        display: block;
    }
    
    .financial-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px;
        background: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .financial-table td {
        display: block;
        padding: 10px 0;
        border: none;
        width: 100%;
    }
    
    .financial-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: var(--primary-blue);
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    /* Ensure full width for colspan cells */
    .financial-table td[colspan] {
        width: 100%;
    }
    
    .financial-table td[colspan]:before {
        content: attr(data-label);
    }
    
    /* Keep section headers visible */
    .financial-table tr.section-header {
        display: table-row;
        padding: 0;
        margin-bottom: 10px;
    }
    
    .financial-table tr.section-header th {
        display: table-cell;
        padding: 10px;
        background: var(--primary-blue);
        color: white;
        text-align: center;
        border-radius: 8px 8px 0 0;
    }
    
    .financial-table tr.sub-header {
        display: none;
    }
    
    /* Special handling for input fields */
    .financial-table input[type="text"],
    .financial-table input[type="number"],
    .financial-table input[type="email"],
    .financial-table input[type="tel"],
    .financial-table input[type="date"],
    .financial-table select {
        width: 100%;
        font-size: 14px;
        padding: 8px;
        box-sizing: border-box;
    }
    
    /* Hide empty cells */
    .financial-table td:empty {
        display: none;
    }
    
    /* Special styling for totals */
    .financial-table .total-row td {
        font-weight: bold;
        background: var(--light-blue);
        padding: 10px;
        border-radius: 4px;
    }
    
    /* Stack form groups on mobile */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Optimize pre-screening section */
    #pre-screening .form-row {
        flex-direction: column;
    }
    
    #pre-screening .form-group {
        width: 100%;
    }
    
    /* Full width buttons on mobile */
    .btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
    
    .financial-table input,
    .financial-table select {
        padding: 6px;
        font-size: 12px;
    }
    
    .compact-input,
    .compact-select,
    .compact-date {
        padding: 2px 4px !important;
        font-size: 10px !important;
    }
}

.calculator-results {
    background-color: var(--light-blue);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.result-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.testimonial {
    background-color: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

.testimonial-content {
    font-style: italic;
    margin-bottom: 20px;
    color: var(--text-gray);
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-blue);
}

.testimonial-location {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-top: 5px;
}

.testimonials-section .testimonial {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.testimonials-section .testimonial:hover {
    background-color: var(--white);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.testimonials-section .section-title {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 60px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.testimonials-section .section-title h2,
.testimonials-section .section-title p {
    text-shadow: none;
}

.team-member {
    text-align: center;
    background-color: var(--white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
}

.team-member h4 {
    margin-bottom: 5px;
}

.team-member-title {
    color: var(--text-gray);
    margin-bottom: 15px;
}

footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

/* Office Hours Styling */
.office-hours {
    margin-top: 15px;
}

.office-hours .hours-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
}

.office-hours .hours-row:last-child {
    border-bottom: none;
}

.office-hours .day {
    font-weight: 500;
}

.office-hours .time {
    color: rgba(255,255,255,0.8);
}

/* Footer CTA Button Spacing */
.footer-cta {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero-large {
        padding: 310px 0 120px;
        min-height: 80vh;
    }
    
    .hero h1 {
        font-size: 2.75rem;
    }
    
    .hero-large h1 {
        font-size: 3.25rem;
        letter-spacing: -0.5px;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-large p {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .hero-content {
        max-width: 90%;
        padding: 15px;
    }
    
    .hero h1 {
        white-space: normal;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .calculator {
        padding: 20px;
    }
    
    .calculator-form {
        grid-template-columns: 1fr;
    }
    
    .custom-logo {
        max-height: 70px;
    }
    
    .header-scrolled .custom-logo {
        max-height: 45px;
    }
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}