@font-face {
    font-family: 'Greycliff';
    src: url('./GreycliffCF-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Base styles */
:root {
    --primary-blue: #301F8C;
    --primary-blue-hover: #241673;
    --primary-blue-active: #261870;
    --primary-blue-disabled: #B8B2D9;    
    --secondary-blue: #3484A4;
    --secondary-blue-hover: #2E748F;
    --secondary-blue-active: #28647A;
    --secondary-blue-disabled: #B8B2D9;
    --primary-pink: #DD1D93;
    --primary-pink-hover: #c41a83;
    --primary-pink-active: #ab1672;
    --primary-pink-disabled: #F2B5D9;
    --untouchable-bg: #dd1d9318;
    --text-gray: #666;
    --light-gray: #f5f5f5;
    --border-gray: #ddd;
    --error-red: #DC2626;
    --warning-yellow: #CC6B2C;
    --success-green: #008000;
    --spacing-xs: 0.3rem;
    --spacing-sm: 0.6rem;
    --spacing-md: 0.9rem;
    --spacing-lg: 1.2rem;
    --spacing-xl: 1.8rem;
    --info-tooltip-spacing: 0.25rem;
    --border-radius-sm: 0.33rem;
    --border-radius-base: 0.66rem;
    --border-radius-lg: 1.33rem;
    --border-radius-xl: 2rem;
    --modal-heading-color: #41207F;

    /* Form-specific variables that will be inherited by the embedded form */
    --primary-colour: var(--primary-pink);
    --primary-colour-dark: var(--primary-pink-hover);
    --secondary-button: var(--primary-blue);
    --secondary-colour: var(--secondary-blue);
    --tertiary-colour: var(--primary-pink-disabled);
    --font-family: 'Greycliff', Arial, sans-serif;
    --border-radius: var(--border-radius-xl);
    
    /* Shadow variables */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(48, 31, 140, 0.25);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Greycliff', Arial, sans-serif;
}

html, body {
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    margin: 0;
    padding: 0;
    scrollbar-width: thin; /* For Firefox */
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

body {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: white;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    margin: 0 auto;
    margin-top: 0;
    overscroll-behavior-y: contain; /* Prevents scroll chaining */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--untouchable-bg) #f1f1f1;
}

/* Custom scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--untouchable-bg);
    border-radius: 4px;
}


/* Layout Components */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 100%;
    overflow-y:hidden;
}

/* Page Layout */
.page {
    width: 100%;
    max-width: 95vw;
    padding: 1rem 0;
    margin: 0 auto;
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    overflow-y:hidden;
}

/* Quotes Page Styles */
.quotes-page {
    width: 100%;
}

.quotes-page h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.finance-form {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--spacing-lg);

}

/* Form Layouts */
.search-form,
.finance-form {
    width: 100%;
    max-width: 100%;
    text-align: left;
    box-sizing: border-box;
}

/* Form Groups */
.form-group,
.vehicle-result {
    margin-bottom: var(--spacing-lg);
    width: 100%;
    position: relative;
}

.finance-input-group {
    margin-bottom: 0.95rem;
    width: 100%;
    position: relative;
}


/* Labels */
.form-group label,
.finance-input-group label {
    display: flex;
    align-items: center;
    color: black;
    font-weight: 500;
    font-size: 1rem;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
}

.form-group label {
    padding: 0px var(--spacing-md) var(--info-tooltip-spacing);
}


/* Form Controls */
input[type="text"],
input[type="number"],
select,
.finance-balance {
    width: 100%;
    padding: 0.6rem var(--spacing-md);
    border: 2px solid var(--primary-pink);
    border-radius: var(--border-radius-base);
    font-size: 1.33rem;
    background-color: white;
    outline: none;
    text-align: start;
}

/* Error and Warning Styles - Higher specificity */
input[type="text"].error-border,
input[type="number"].error-border,
select.error-border,
.form-group input.error-border,
.finance-input-group input.error-border {
    border: 3px solid var(--error-red) !important;
}

input[type="text"].warning-border,
input[type="number"].warning-border,
select.warning-border,
.form-group input.warning-border,
.finance-input-group input.warning-border {
    border: 3px solid var(--warning-yellow) !important;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: 1em;
    padding-right: var(--spacing-xl);
}

select:disabled {
    background-color: var(--light-gray);
    border-color: var(--border-gray);
    cursor: not-allowed;
}

.search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0 var(--spacing-lg);
}

/* Buttons */
.choice-btn,
.edit-btn,
.apply-btn,
.back-btn {
    background-color: white;
    color: black;
    border: 3px solid var(--primary-pink);
    border-radius: var(--border-radius-xl);
    padding: 0.6rem 2.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
    width: 100%;
    white-space: nowrap;
}

.next-btn {
    background-color: var(--primary-pink);
    color: white;
    border: 3px solid var(--primary-pink);
    border-radius: var(--border-radius-xl);
    padding: 0.6rem 2.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
    width: 100%;
    white-space: nowrap;
}

.search-btn {
    background-color: var(--primary-pink);
    color: white;
    border: 3px solid var(--primary-pink);
    border-radius: var(--border-radius-xl);
    padding: 0.6rem var(--spacing-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
    white-space: nowrap;
    width: 50%;
    height: 100%;
}

.choice-btn:hover,
.edit-btn:hover,
.back-btn:hover {
    background-color: var(--primary-pink);
    color: white;
}

.search-btn:hover {
    background-color: var(--primary-pink-hover);
    border-color: var(--primary-pink-hover);
    color: white;
}

.search-btn:active {
    background-color: var(--primary-pink-active);
    border-color: var(--primary-pink-active);
}

.next-btn:hover {
    background-color: var(--primary-pink-hover);
    border-color: var(--primary-pink-hover);
    color: white;
}

.apply-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
}

.edit-btn, .apply-btn {
    padding: 0.6rem 0.25rem;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-xl);
    width: 100%;
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-lg);
}

/* Warning Styles */
.warning-message {
    color: var(--warning-yellow);
    font-weight: 800;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    padding-left: 1rem;
    text-align: start;
}

.warning-border {
    border: 3px solid var(--warning-yellow);
}

/* Error Styles */
.error-message {
    color: var(--error-red);
    font-weight: 800;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    padding-left: 1rem;
    text-align: start;
}

.error-border {
    border: 3px solid var(--error-red);
}


/* Ensure consistent spacing */
.initial-page,
.vehicle-details-page,
.finance-form,
.quotes-page {
    padding: 0 var(--spacing-lg);
}

/* Maintain form visibility transitions */
.search-form {
    opacity: 0;
    transform: translateY(10px);
    will-change: transform, opacity;
}

.search-form.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Steps */
.progress-container {
    width: 90%;
    margin: 0 auto var(--spacing-xl);
    position: relative;
    display: flex;
    justify-content: space-between;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 2px;
    width: 100%;
    background-color: var(--border-gray);
    z-index: 0;
}

.progress {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 2px;
    background-color: var(--primary-pink);
    transition: width 0.35s ease;
    z-index: 1;
}

.progress-step {
    width: 30px;
    height: 30px;
    background-color: white;
    border: 1px solid var(--border-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: all 0.35s ease;
    color: var(--text-gray);
}

.progress-step.active {
    border-color: var(--primary-pink);
    color: black;
    transform: scale(1.1);
}

.progress-step.completed {
    background-color: var(--primary-pink);
    border-color: var(--primary-pink);
    color: white;
    transform: scale(1);
}

/* New styles for application state */
.progress-step.application {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.progress-step.application ~ .progress-step {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.progress.application {
    background-color: var(--primary-blue);
    width: 100% !important;
}

/* Only hide labels in application state */
.progress-container.application .progress-label:not(.application) {
    opacity: 0;
    visibility: hidden;
}

.progress-label {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666666;
    white-space: nowrap;
    opacity: 0.7;
    transition: opacity 0.35s ease;
}

.progress-label.application {
    color: var(--primary-blue);
    letter-spacing: 1px;
    top: 2.813rem;
    width: 100%;
    text-align: center;
}

/* Remove old application label styles */
/* Application state label */
.progress-container.application .application-label {
    display: none;
}

/* Hide the original application page h1 */
.application-page h1 {
    display: none;
}

/* Ensure proper spacing for application state */
.progress-container.application {
    margin-bottom: var(--spacing-xs);
}


/* Ensure all content sections respect container width */
.initial-page,
.vehicle-details-page,
.finance-details-page,
.quotes-page {
    width: 100%;
    max-width: 100%;
}

/* Ensure inputs don't overflow */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.quote-card {
    flex: 1 0;
    min-width: 400px;
    max-width: 100vw;
    width: 100%;
    border: 2px solid var(--primary-pink);
    border-radius: 0.75rem;
    background: white;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: clip;
    box-shadow: var(--shadow-md);
}

/* Add hover effect to quote card */
.quote-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Ensure footer grid doesn't overflow */
.footer-grid {
	word-break: break-word;
	letter-spacing: 1px;
	font-size: 12px;
}

.initial-page {
    text-align: center;
}

h1, h2 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.subtitle {
    color: var(--text-gray);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.button-group {
    display: flex;
    row-gap: 1rem;
    column-gap: 2.5rem;
    justify-content: center;
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
}

/* Vehicle Result Styles */
.vehicle-result {
    background-color: var(--untouchable-bg);
    border: 2px solid var(--primary-pink);
    border-radius: 1rem;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.vehicle-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vehicle-info span {
    color: black;
    text-align: left;
}

.wrong-car-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: 15px;
}

/* Vehicle Details */
.vehicle-details {
    background-color: white;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.detail-value {
    color: black;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Quotes Page Styles */
.quotes-page {
    width: 100%;
}

.quotes-page h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.quotes-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
    overflow-x: visible;
    overflow-y: clip;
}

.quote-header {
    padding: 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-gray);
}

.quote-type-badge {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.badge-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.badge-label {
    background-color: var(--primary-pink);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.2rem;
}

.badge-title {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.quote-amounts {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin: 1.5rem 0;
}

.quote-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.quote-amount .amount,
.quote-amount .deposit-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-blue);
}

.quote-amount .period {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-top: var(--info-tooltip-spacing);
}

.quote-info {
    position: absolute;
    margin: 0;
}

.quote-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vehicle-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-gray);
    text-align: start;
}

.spec-item i {
    color: var(--primary-pink);
}

.quote-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
    margin-top: 1.5rem;
}

.quote-footer {
    background: #333;
    color: white;
    padding: 0.9rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 1.5rem;
    column-gap: 1rem;
    width: 100%;
    height: 100%;
    align-content: space-between;
}

.footer-item {
    font-size: 0.8rem;
    display: flex;
    justify-content: start;
    align-items: center;
    text-align: start;    
}

.footer-item:nth-child(odd) {
    padding-right: 0.6rem;
}

.footer-item:nth-child(even) {
    padding-left: 0.6rem;
}

.input-error {
    margin-top: 0.6rem;
    color: #ff0000;
}

/* Hide the quote saved and expiry messages */
.quote-saved,
.quote-expiry {
    display: none;
}

/* Info Tooltip */
.info-tooltip {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--primary-pink);
    color: white;
    font-size: 0.875rem;
    cursor: help;
    text-decoration: none;
    position: relative;
    margin: 0 0 var(--info-tooltip-spacing) 0; 
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.info-tooltip:hover {
    box-shadow: var(--shadow-md);
}

/* Special styling for quote info buttons */
.info-tooltip.quote-info {
    width: 1.8rem;
    height: 1.8rem;
    background-color: var(--primary-blue);
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.35s ease;
}

.info-tooltip.quote-info:hover {
    transform: scale(1.1);
    background-color: var(--primary-blue-hover);
    box-shadow: var(--shadow-lg);
}

/* Custom Tooltip */
.custom-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
    width: max-content;
    max-width: 60vw;
    z-index: 900;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease-in-out, visibility 0.35s ease-in-out;
    pointer-events: none;
    top: 20%;
    left: 20%;
    transform: translate(-100%, -100%);
    box-shadow: var(--shadow-lg);
}

.info-tooltip:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Removed tooltip arrow */
/* .custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -300%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
} */

/* Ensure parent containers don't clip */
.finance-input-group,
.quote-header,
.quote-details,
.quote-footer {
    overflow: visible !important;
}

/* Ensure parent containers don't clip */
.quote-header,
.quote-details {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.finance-balance {
    background-color: var(--untouchable-bg);
    border: 0pt solid var(--primary-blue);
    border-radius: var(--border-radius-base);
    font-size: 2rem;
    font-weight: 500;
    color: var(--primary-blue);
    overflow-x: auto;
    white-space: nowrap;
    text-align: justify;
    box-shadow: var(--shadow-sm);
}

/* Finance Form Styles */
.finance-form {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--spacing-lg);
    box-sizing: border-box;
}

/* Disabled button states - Higher specificity */
button.next-btn:disabled,
button.next-btn[disabled],
button.search-btn:disabled,
button.search-btn[disabled] {
    background-color: var(--primary-pink-disabled) !important;
    border-color: var(--primary-pink-disabled) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 1 !important;
}

button.apply-btn:disabled,
button.apply-btn[disabled] {
    background-color: var(--primary-blue-disabled) !important;
    border-color: var(--primary-blue-disabled) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 1 !important;
}

/* Ensure hover states don't override disabled state */
.next-btn:hover:not(:disabled):not([disabled]),
.search-btn:hover:not(:disabled):not([disabled]) {
    background-color: var(--primary-pink-hover);
    border-color: var(--primary-pink-hover);
    color: white;
}

.apply-btn:hover:not(:disabled):not([disabled]) {
    background-color: var(--primary-blue-hover);
}

.apply-btn:hover {
    background-color: var(--primary-blue-hover);
    font-size: 1.15rem;
}

/* Active states should also check for not disabled */
.search-btn:active:not(:disabled):not([disabled]) {
    background-color: var(--primary-pink-active);
    border-color: var(--primary-pink-active);
}


/* Active state - Primary interaction */
.apply-btn:active:not(:disabled):not([disabled]) {
    background-color: var(--primary-blue-active);
    border-color: var(--primary-blue-active);
}

/* Disabled state - Comprehensive coverage */
.apply-btn:disabled,
.apply-btn[disabled] {
    background-color: var(--primary-blue-disabled);
    border-color: var(--primary-blue-disabled);
    color: rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 1;
}

/* Application page styles */
.application-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
}

.application-page h1 {
    margin: 2rem 0;
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
}

.application-container {
    width: 100%;
    min-height: 500px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: var(--spacing-xl);
    flex: 1 0 auto;
}

.application-container iframe {
    width: 100%;
    height: auto;
    min-height: 600px;
    border: none;
    flex: 1 0 auto;
}

/* Modal Styles for Quote Info */
.quote-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #FFFFFF;
    color: #333333;
    width: 100%;
    max-width: 90vw;
    padding: 2.2rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    height: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding-bottom: var(--spacing-md);
    padding-top: var(--spacing-xl);
}

.modal-content h2 {
    color: var(--modal-heading-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-align: left;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-content ol {
    padding-left: 1rem;
}

.modal-content li {
    margin-bottom: 15px;
}

.modal-content strong {
    font-weight: 700;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: end;
    justify-content: center;
    background-color: var(--primary-blue);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.35s ease;
    z-index: 1000;
}

.modal-close:hover {
    background-color: var(--primary-blue-hover);
    transform: scale(1.1);
}

/* Disclaimer Box Styles */
.disclaimer-box {
    background-color: var(--untouchable-bg);
    border-radius: var(--border-radius-base);
    padding: 15px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: justify;
    box-shadow: var(--shadow-sm);
}

.disclaimer-box p {
    margin: 0;
    color: #333;
    font-size: 0.95rem;
}

.disclaimer-box .info-tooltip {
    margin-left: 15px;
    flex-shrink: 0;
}

/* Promo Banner Styles */
.promo-banner {
    background-color: #FF5CB8;
    letter-spacing: 0.75px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-md);
    border-width: 0px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    overflow: visible !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin-top: 0;
    width: 100%;
}

.promo-banner:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.promo-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    padding: 0.6rem 0.3rem;
}

.promo-banner p {
    color: white;
    font-size: 1.1rem;
    text-align: center;
    margin: 0;
    width: 100%;
}

/* Hide banner when needed */
.promo-banner.hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Spacer that maintains layout when promo banner is hidden */
.promo-banner-spacer {
    background-color: transparent;
    border: none;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    padding: var(--spacing-xs) var(--spacing-sm);

    margin-top: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    letter-spacing: 0.75px;
    border-radius: var(--border-radius-base);
    overflow: hidden;
    transition: none;
}

.promo-banner-link-spacer {
    display: block;
    visibility: hidden;
    text-decoration: none;
    color: transparent;
    opacity: 0;
    width: 100%;
    height: 100%;
    padding: 0.6rem 0.3rem;
}

.promo-banner-spacer p {
    visibility: hidden;
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
}

/* No Quote Message Styles */
.no-quote-message {
    background-color: var(--untouchable-bg);
    padding: 20px;
    border-radius: var(--border-radius-base);
    margin: 20px 0;
    text-align: left;
}

.no-quote-message h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.no-quote-message p {
    margin-bottom: 10px;
}

.error-reasons {
    padding-left: 20px;
}

.error-reasons li {
    margin-bottom: 5px;
}

/* Part Exchange Button Styles */
.part-ex-buttons {
    display: flex;
    row-gap: 1rem;
    column-gap: 2rem;
    margin-top: 10px;
    flex-direction: row;
}

.part-ex-btn.selected {
    background-color: var(--primary-pink);
    color: white;
}

/* Add focus styles for inputs */
input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-focus);
}

/* Add focus styles for selects */
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-focus);
}

/* Add focus styles for buttons */
.choice-btn:focus,
.next-btn:focus,
.search-btn:focus,
.apply-btn:focus,
.edit-btn:focus,
.part-ex-btn:focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Add focus styles for tooltips */
.info-tooltip:focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Fix transitions for buttons to include both existing and box-shadow transitions */
.choice-btn, 
.next-btn,
.search-btn,
.apply-btn,
.edit-btn,
.part-ex-btn {
    box-shadow: var(--shadow-sm);
    /* Don't override existing transitions, just add box-shadow to them */
}

/* Define hover transitions properly */
.choice-btn:hover:not(:disabled), 
.next-btn:hover:not(:disabled),
.search-btn:hover:not(:disabled),
.apply-btn:hover:not(:disabled),
.edit-btn:hover:not(:disabled),
.part-ex-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    /* Let the existing transition handle this */
}

/* For elements that might not have transitions already */
input[type="text"],
input[type="number"],
select,
.info-tooltip {
    transition: all 0.2s ease-in-out;
}

/* Disabled buttons get no shadow */
.choice-btn:disabled, 
.next-btn:disabled,
.search-btn:disabled,
.apply-btn:disabled,
.edit-btn:disabled,
.part-ex-btn:disabled {
    box-shadow: none;
}

/* Add box-shadow to inputs and selects */
input[type="text"],
input[type="number"],
select {
    box-shadow: var(--shadow-sm);
}

/* Add box-shadow to finance-balance */
.finance-balance {
    box-shadow: var(--shadow-sm);
}

/* Enhanced modal content shadow */
.modal-content {
    box-shadow: var(--shadow-xl);
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Make the skip link visible when focused */
.sr-only-focusable:focus {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: auto;
    height: auto;
    padding: 1rem;
    background-color: var(--primary-blue);
    color: white;
    font-weight: bold;
    clip: auto;
    text-decoration: none;
}

.terms-link {
    color: rgb(251, 251, 255);
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

#part-exchange-label {
    line-height: 1.75rem;
    justify-content: center;
    font-size: 1.25rem;
}

.promo-banner:hover .terms-link {
    color: #301F8C;
    text-decoration: underline;
}

/* When application page is visible, make it absolute */
#application-page {
    position: relative;
    width: 100%;
}

/* Page transition animations */
.page.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.page.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    position: absolute;
    left: 0;
    right: 0;
}

/* Add rules for properly handling flex layout and nested iframes */
html, body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

body {
    flex: 1 0 auto;
}

/* Make application page and its container flex correctly */
#application-page {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    width: 100%;
    height: auto;
    min-height: 600px;
}

/* Enhanced iframe style for nested iframe */
.application-container iframe {
    width: 100%;
    height: auto;
    min-height: 600px;
    border: none;
    flex: 1 0 auto;
}

/* Add this rule to ensure hidden pages don't take space */
.page[style*="display: none"] {
    display: none !important;
}

/* Make visible pages flex properly */
.page:not([style*="display: none"]) {
    display: flex !important;
    flex-direction: column;
    flex: 1 0 auto;
}

/* Add these rules at the top to ensure they take precedence */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
    position: relative;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
    position: relative;
}

/* Fix container width constraints */
.container, 
.page,
.quotes-page,
.search-form,
.finance-form,
#application-page,
.application-container,
.vehicle-specs,
.quotes-grid,
.quote-card {
    max-width: 100vw !important;
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
    transition: opacity 0.2s ease, transform 0.2s ease;   
     
}

.page {
    width: 80%;
    min-width: 70vw;
    overflow-x: visible;
    overflow-y: clip;
}

.quotes-grid {
    overflow-x: visible;
}

/* Fix all form inputs */
input[type="text"],
input[type="number"],
select,
textarea,
.finance-balance {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.choice-btn, .next-btn, .back-btn {
	width: 42.5%;
	min-width: 10vw;
}

.page .button-group:not(.part-ex-buttons) {
    margin-top: 0.75rem;
}

/* Media Queries - Ordered from largest to smallest breakpoint */
@media (max-width: 950px) {
    html {
        font-size: 15px;
    }

    h1, h2 {
        font-size: 2rem;
    }

    .quotes-grid {
        flex-direction: column;
        align-items: center;
        overflow-x: visible;
        overflow-y: clip;
    }
    
    .quote-card {
        width: 100vw;
        margin-bottom: 10px;
        overflow-y: clip;
        overflow-x: visible
    }
}

@media (max-width: 650px) {
    html {
        font-size: 15px;
    }

    .page {
        width: 90%;
        min-width: 80vw;
    }

    .quote-amount,
    .deposit-amount {
        font-size: 1.6rem;
    }

    .application-container,
    .application-container iframe {
        height: 100%;
    }

    .progress-label {
        display: none;
    }
    
    .progress-label.application {
        display: block;
    }
}

@media (max-width: 480px) {
    .promo-banner,
    .promo-banner-spacer {
        padding: var(--spacing-xs) var(--spacing-xs);
        margin-top: 0;
    }
    
    .promo-banner-link,
    .promo-banner-link-spacer {
        padding: 0.4rem 0.2rem;
    }
    
    .promo-banner p,
    .promo-banner-spacer p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding:0 var(--spacing-sm);
    }
    
    .navigation {
        flex-direction: column-reverse;
        row-gap: 1rem;
        column-gap: 2.5rem;
        padding: 0;
    }

    .choice-btn, 
    .edit-btn, 
    .apply-btn, 
    .back-btn {
        max-width: 90vw;
    }

    .quote-actions {
        gap: 1rem;
    }

    .progress-container {
        width: 100%;
        margin: 0 auto var(--spacing-md);
    }
    
    .progress-label {
        font-size: 12px;
        top: 35px;
    }

    .progress-label.application {
        top: 3rem;
    }

    .button-group {
        flex-direction:  column-reverse;
        align-items: center;
    }

    .search-form,
    .finance-form {
        padding: 0 var(--spacing-sm);
    }

    select {
        width: 100%;
        padding: 0.6rem var(--spacing-md);
        border: 2px solid var(--primary-pink);
        border-radius: var(--border-radius-base);
        font-size: 1rem;
        background-color: white;
        outline: none;
    }

    .choice-btn, .next-btn, .back-btn {
        width: 95%;
        min-width: 20vw;
    }

    .finance-balance {
        text-align: left;
        font-size: 2rem;
    }
}

/* Adjust progress steps container for better mobile view */
@media (max-width: 480px) {

    .quote-actions {
        gap: 2rem;
    }

    .progress-container {
        width: 100%;
        margin: 0 auto var(--spacing-md);
    }
    
    .progress-label {
        font-size: 12px;
        top: 35px;
    }

    .progress-label.application {
        top: 3rem;
    }
}

/* Fix container padding on mobile */
@media (max-width: 480px) {
    .container,
    .search-form,
    .finance-form,
    .page {
        padding-left: var(--spacing-sm) !important;
        padding-right: var(--spacing-sm) !important;
        width: 100% !important;
        min-width: 90vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Fix footer grid overflow */
    .footer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        row-gap: 1rem;
        column-gap: 0.66rem;
        font-size: 11px;
    }
}

/* Specific fixes for iOS devices */
@supports (-webkit-touch-callout: none) {
    .search-container {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Critical for preventing zoom */
    }
    
    .search-btn {
        flex: 0 1 auto;
        padding: 0.6rem 1.5rem;
    }


    button {
        font-size: 16px !important;
    }
}

/* Enhanced Modal Styles - Will override existing modal styles */
.quote-modal.enhanced-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vw; /* Position from top of viewbox */
    background-color: rgba(0, 0, 0, 0.5); /* Solid background with opacity instead of gradient */
    overflow-y: auto;
    overflow-x: hidden;
}

.enhanced-modal .modal-content {
	background: #FFFFFF;
	/* color: #333333; */
	width: 50%;
	min-width: 380px;
	max-width: 90vw;
	padding: 2.5rem;
	border: 1px solid #E0E0E0;
	border-radius: 1rem;
	box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.4), 0 1.5rem 3rem rgba(0, 0, 0, 0.3);
	margin-bottom: 10vw;
	overflow: visible;
	height: fit-content;
}

.enhanced-modal .modal-inner-scroll {
	position: relative;
	width: 100%;
	height: auto;
	max-height: 70vh;
	padding-right: 5px;
	overflow-x: visible;
}

.enhanced-modal .modal-content h2 {
    color: var(--modal-heading-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.enhanced-modal .modal-close {
    top: -10px;
    right: -10px;
}

.enhanced-modal .modal-close:hover {
    background-color: var(--primary-blue-hover);
    transform: scale(1.1);
}

/* Ensure the body doesn't scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Media query adjustments for smaller screens */
@media (max-width: 768px) {
    .enhanced-modal .modal-content {
        width: 90%;
        padding: 1.8rem;
        max-width: 500px;
    }
    
    .enhanced-modal {
        padding-top: 5vw; /* Less space at top on mobile */
    }
    
    .enhanced-modal .modal-inner-scroll {
        padding-right: 2px;
        max-height: 65vh;
    }
}

@media (max-width: 480px) {
    .enhanced-modal .modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 8px;
        max-width: none;
    }
    
    .enhanced-modal {
        padding-top: 2vw; /* Even less space at top on small mobile */
        background-color: rgba(0, 0, 0, 0.6); /* Slightly darker background on mobile */
    }
    
    .enhanced-modal .modal-inner-scroll {
        max-height: 80vh;
    }
}

/* Loading spinner styling */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0000FF;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}