* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

html {
    overflow-y: scroll;
}

/* Header styles */
.header {
    background-color: #003049;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-content {
    height: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    gap: 0.25rem;
}

.logo-icon {
    font-size: 2rem;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
}

.beta-badge {
    background-color: #3b82f6;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #bfdbfe;
}

/* Body Styling */
body {
    background-color: #f5f5f5;
    min-height: 100vh;
    padding-top: 0px;
    margin: 0;
}

/* Main container */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Calculator wrapper */
.calculator-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
    position: relative;
    margin-top: 20px;
}

h1 {
    background-color: #fcbf49;
    margin: -24px -24px 24px -24px;
    padding: 16px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

/* Form groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* Input containers */
.input-container {
    display: flex;
    gap: 8px;
}

/* Form controls */
.input-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.input-control:hover {
    border-color: #003049;
    box-shadow: 0 0 0 3px rgba(0, 48, 73, 0.1);
}

.input-control:focus {
    outline: none;
    border-color: #003049;
    box-shadow: 0 0 0 3px rgba(0, 48, 73, 0.1);
}

/* Select styles */
select.input-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    background: white url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}

/* Error states */
.input-control.error {
    border-color: #dc2626;
	background-color: #fff;
}

.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #003049;
    color: white;
    border: 1px solid #003049;
}

.btn-primary:hover {
    background: #00436b;
    border-color: #00436b;
}

.btn-secondary {
    background: white;
    border: 1px solid #ddd;
    color: #333;
    margin-top: 16px;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #003049;
}

/* Checkbox */
.checkbox-group {
    margin: 20px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Results section */
.results {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(to bottom right, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 4px;
}

.results-header {
    margin-bottom: 16px;
}

.results-title {
    font-size: 18px;
    color: #003049;
    margin: 0;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #bae6fd;
}

.results-content {
    border: none;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.summary-item {
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease-in-out;
}

.summary-label {
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 8px;
}

.summary-value {
    color: #003049;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

/* Amortization Schedule Table Styling */
#schedule {
    margin-top: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

#schedule table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#schedule th, #schedule td {
    padding: 12px;
    text-align: right;
	text-align: center;
    border: 1px solid #bae6fd;
}

#schedule th {
    background-color: #f0f9ff;
    font-weight: 600;
    text-align: center;
    color: #003049;
}

#schedule tr:nth-child(even) {
    background-color: #f8f9fa;
}

#schedule tr:hover {
    background-color: #e0f2fe;
}

/* Emphasizing Monthly Payment */
.payment-highlight {
    background: linear-gradient(to bottom right, #003049, #00436b);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 16px;
}

.payment-highlight span {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-top: 8px;
    color: #bae6fd;
}

/* FAQ Section */
.faq-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
}

.faq-title {
    color: #003049;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.faq-grid {
    display: grid;
    gap: 24px;
}

.faq-item {
    background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.faq-question {
    color: #003049;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.faq-answer {
    color: #334155;
    font-size: 16px;
    line-height: 1.5;
}

.faq-answer p {
    margin-bottom: 12px;
}

.faq-answer ul {
    list-style-type: none;
    padding-left: 0;
}

.faq-answer ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.faq-answer ul li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #003049;
}

.hidden {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .header-container {
        padding: 0 1rem;
    }
   
    .logo-text {
        font-size: 1rem;
    }
	
	.beta-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
	
	.header-content {
        height: 3.5rem;
    }
   
    .calculator-wrapper {
        padding: 16px;
    }
   
    h1 {
        margin: -16px -16px 16px -16px;
        font-size: 20px;
    }
	
	.faq-container {
        margin: 10px auto;
        padding: 16px;
    }

    .faq-title {
        font-size: 20px;
    }

    .faq-grid {
        gap: 16px;
    }

    .faq-question {
        font-size: 16px;
    }

    .faq-answer {
        font-size: 14px;
    }
	
	schedule {
        padding: 12px;
        border-radius: 6px;
    }

    #schedule table {
        min-width: 100%;
        font-size: 14px; /* Reduce font size for tablets */
    }

    #schedule th, #schedule td {
        padding: 8px;
        font-size: 13px; /* Slightly smaller text */
    }
	
	.results-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-item {
        padding: 12px;
    }
    
    .summary-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header {
        position: fixed;
    }
   
    body {
        padding-top: 3.5rem;
    }
	
	.logo-icon {
        font-size: 1.5rem;
    }
	
	#schedule {
        overflow-x: auto; /* Enables scrolling for smaller screens */
        white-space: nowrap;
    }

    #schedule table {
        min-width: 500px; /* Keeps columns readable */
        font-size: 12px; /* Reduce font size for small screens */
    }

    #schedule th, #schedule td {
        font-size: 11px;
        padding: 6px; /* Reduce padding for smaller rows */
    }
}
