.mortgage-application-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Hide any "Application" text that might be added by themes or other plugins */
.mortgage-application-form::before {
    content: none !important;
}

.mortgage-application-form::after {
    content: none !important;
}

/* Hide any element that contains the word "Application" */
.mortgage-application-form *:contains("Application") {
    display: none !important;
}

/* Alternative approach - hide any text node containing "Application" */
.mortgage-application-form {
    position: relative;
}

.mortgage-application-form::before {
    content: none !important;
}

.form-logo {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo-image {
    max-width: 200px;
    height: auto;
}

.form-main-title {
    text-align: center;
    color: #2E3A8C;
    margin: 20px 0 30px 0;
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
    color: #2E3A8C;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFD700;
}

.applicant-1 {
    background: #f0f4ff; /* Light blue for Applicant 1 */
    border-left: 4px solid #2E3A8C;
}

.applicant-2 {
    background: #fff8e6; /* Light yellow for Applicant 2 */
    border-left: 4px solid #FFD700;
}

.shared-section {
    background: #f0f8f0; /* Pastel green for shared sections */
    border-left: 4px solid #2d5a2d;
}

.sole-joint-section {
    background: #f0f8f0; /* Pastel green for sole/joint sections */
    border-left: 4px solid #2d5a2d;
}

.applicant-1 h3 {
    color: #2E3A8C;
}

.applicant-2 h3 {
    color: #FFD700;
}

.shared-section h3 {
    color: #2d5a2d;
}

.sole-joint-section h3 {
    color: #2d5a2d;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2E3A8C;
}

.mortgage-application-form h2 {
    color: #2E3A8C;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: #2E3A8C;
    outline: none;
    box-shadow: 0 0 5px rgba(46, 58, 140, 0.2);
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    margin-right: 8px;
}

.time-at-address {
    display: flex;
    gap: 15px;
}

.time-at-address input {
    flex: 1;
}

.time-at-address input[type="number"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
}

.consent-label input[type="checkbox"] {
    margin-top: 4px;
}

.submit-button {
    background: #2E3A8C;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background: #1e2a6c;
}

/* Error states */
.form-group input:invalid,
.form-group select:invalid {
    border-color: #dc3232;
}

.error-message {
    color: #dc3232;
    font-size: 14px;
    margin-top: 5px;
}

/* Responsive design */
@media (max-width: 600px) {
    .mortgage-application-form {
        padding: 10px;
    }

    .form-section {
        padding: 15px;
    }

    .checkbox-group,
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .time-at-address {
        flex-direction: column;
        gap: 10px;
    }
}

.profit-years {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profit-year {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profit-year label {
    font-weight: 600;
    color: #444;
}

.profit-year input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.profit-year input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.2);
}

/* Responsive design */
@media (max-width: 600px) {
    .profit-years {
        gap: 10px;
    }
}

/* Income Fields */
.income-field {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.income-field {
    position: relative;
    display: flex;
    align-items: center;
}

.income-field::before {
    content: '£';
    color: #666;
    font-size: 16px;
    font-weight: 500;
    margin-right: 8px;
    flex-shrink: 0;
}

.income-field input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fff;
}

.income-field input::placeholder {
    color: #999;
}

.income-field input:focus {
    border-color: #2E3A8C;
    outline: none;
    box-shadow: 0 0 5px rgba(46,58,140,0.2);
}

.application-type-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.application-type-group span {
    display: inline-block;
}

.application-type-group input[type="radio"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

.application-type-group label {
    display: inline-block;
    padding: 20px 50px;
    border: 3px solid #2E3A8C;
    border-radius: 10px;
    background: #f0f4ff;
    color: #2E3A8C;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.application-type-group input[type="radio"]:checked + label {
    background: #2E3A8C;
    color: #fff;
    border-color: #1e2a6c;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.application-type-group label:hover {
    background: #e6f0ff;
    color: #1e2a6c;
    border-color: #1e2a6c;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Address Lookup Styles */
.address-lookup-container {
    margin-bottom: 15px;
}

.postcode-lookup {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.postcode-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.lookup-button {
    background: #2E3A8C;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.lookup-button:hover {
    background: #1e2a6c;
}

.lookup-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.address-dropdown {
    margin-bottom: 15px;
}

.address-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

.address-select:focus {
    border-color: #2E3A8C;
    outline: none;
    box-shadow: 0 0 5px rgba(46, 58, 140, 0.2);
}

.manual-address {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.manual-address input {
    margin-bottom: 10px;
}

/* Loading state for address lookup */
.lookup-button.loading {
    background: #ccc;
    cursor: not-allowed;
}

.lookup-button.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error message for address lookup */
.address-error {
    color: #dc3232;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Success message for address lookup */
.address-success {
    color: #46b450;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Responsive design for address lookup */
@media (max-width: 600px) {
    .postcode-lookup {
        flex-direction: column;
        gap: 10px;
    }
    
    .lookup-button {
        width: 100%;
    }
}

/* Added to hide title from the page */
h1.wp-block-post-title {
    display: none !important;
}

/* Progress Bar Styles */
.form-progress-bar {
    position: relative;
    width: 100%;
    height: 16px;
    background-color: #e0e0e0;
    border-radius: 8px;
    margin: 50px 0;
    overflow: visible;
}

.form-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #2E3A8C, #FFD700);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.form-progress-bar-steps {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    pointer-events: auto;
}

.progress-step.active {
    background-color: #2E3A8C;
    color: white;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
}

/* When only Next button is showing (step 1), align it to the right */
.form-navigation:has(.form-prev:not(:visible)) {
    justify-content: flex-end;
}

/* Alternative approach for browsers that don't support :has() */
.form-navigation.next-only {
    justify-content: flex-end;
}

.form-prev,
.form-next,
.form-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.form-prev {
    background-color: #6c757d;
    color: white;
}

.form-prev:hover {
    background-color: #5a6268;
}

.form-next {
    background-color: #2E3A8C;
    color: white;
}

.form-next:hover {
    background-color: #1e2a6c;
}

.form-submit {
    background-color: #28a745;
    color: white;
}

.form-submit:hover {
    background-color: #218838;
}

.form-prev:disabled,
.form-next:disabled,
.form-submit:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Input error styling */
.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.2) !important;
}

/* Credit Commitment Styles */
.credit-commitment-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.credit-commitment-item h4 {
    color: #2E3A8C;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.remove-credit-commitment-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.remove-credit-commitment-btn:hover {
    background: #c82333;
}

.add-credit-commitment-btn:hover,
.add-applicant2-credit-commitment-btn:hover {
    background: #218838;
}

/* Responsive design for credit commitments */
@media (max-width: 600px) {
    .credit-commitment-item {
        padding: 15px;
    }
    
    .remove-credit-commitment-btn {
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}

/* Insurance options styling */
.insurance-option {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #f9f9f9;
}

.insurance-option label {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
}

.insurance-option input[type="checkbox"] {
    margin-right: 10px;
}

.insurance-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.insurance-details textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.insurance-details textarea:focus {
    outline: none;
    border-color: #2E3A8C;
    box-shadow: 0 0 5px rgba(46, 58, 140, 0.2);
}

/* Step with errors styling */
.step-with-errors {
    border: 2px solid #dc3545;
    border-radius: 5px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Existing Mortgage Items */
.existing-mortgage-item {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.existing-mortgage-item h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.remove-existing-mortgage-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.remove-existing-mortgage-btn:hover {
    background: #c82333;
}

.add-existing-mortgage-btn:hover {
    background: #218838;
}

/* Responsive design for existing mortgages */
@media (max-width: 600px) {
    .existing-mortgage-item {
        padding: 15px;
    }
    
    .remove-existing-mortgage-btn {
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}

/* Validation Summary Styles */
.validation-summary {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-size: 14px;
    position: relative;
}

.validation-summary h4 {
    margin: 0 0 15px 0 !important;
    color: #721c24 !important;
    font-size: 16px;
    font-weight: bold;
}

.validation-summary ul {
    margin: 10px 0 0 20px !important;
    padding: 0 !important;
    list-style-type: disc;
}

.validation-summary li {
    margin-bottom: 5px !important;
    color: #721c24 !important;
}

.validation-summary .step-section {
    margin-bottom: 15px;
}

.validation-summary .step-section strong {
    color: #721c24 !important;
    font-weight: bold;
}

.validation-summary .button-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f5c6cb;
}

.go-to-step-btn {
    background: #0073aa !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-right: 10px !important;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.go-to-step-btn:hover {
    background: #0056b3 !important;
}

.close-validation-summary {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.close-validation-summary:hover {
    background: #545b62 !important;
}

/* Dynamic Previous Address Styling */
.previous-addresses-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.previous-address {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 5px;
    position: relative;
}

.previous-address:last-child {
    margin-bottom: 0;
}

.previous-address label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.previous-address .time-at-address {
    margin-top: 10px;
}

.previous-address .time-at-address label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

/* Animation for new previous addresses */
.previous-address {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}