/* Modern professional styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 14px;
    color: #333;
}

.form-container {
    width: 100%;
}

.input-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.input-section > summary {
    cursor: pointer;
    padding: 18px 20px;
    color: white;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.input-section > summary:hover {
    filter: brightness(1.02);
}

.input-section > summary:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.35);
    outline-offset: 2px;
}

.input-section > summary::-webkit-details-marker {
    display: none;
}

.input-section > summary::after {
    content: '▾';
    font-size: 1.25rem;
    opacity: 0.9;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

.input-section[open] > summary::after {
    transform: rotate(180deg);
}

.input-section-body {
    padding: 0;
}

.input-section table {
    border: none;
    border-radius: 0;
}

.input-section td:first-child {
    width: 62%;
}

.input-section td:last-child {
    width: 38%;
}

.page-shell {
    max-width: 1400px;
    margin: 0 auto;
}

.header-row {
    margin-bottom: 14px;
}

/* Intro Text Styling */
.intro-text {
    background: white;
    padding: 28px 32px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin: 0;
    position: relative;
    --intro-badge-width: clamp(170px, 18vw, 260px);
    padding-right: calc(32px + var(--intro-badge-width) + 18px);
}

.hero-home-button {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2d3748;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hero-home-button:hover {
    transform: translateY(-1px);
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.intro-badge {
    position: absolute;
    top: 12px;
    bottom: 12px;
    right: 12px;
    width: var(--intro-badge-width);
    height: auto;
    opacity: 0.95;
    pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.15));
}

.intro-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.intro-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 14px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-paragraph {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
}

.intro-divider {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 18px 0;
}

.intro-paragraph.highlight {
    font-size: 1.15rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
}

.intro-paragraph.privacy-note {
    font-size: 0.95rem;
    color: #2d3748;
    text-align: center;
    padding: 10px 16px;
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
    border-radius: 6px;
    margin-top: 12px;
}

.intro-paragraph.privacy-note strong {
    color: #234e52;
}

/* Two-column layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.input-panel,
.output-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
}

/* Input panel: visually narrower + easier scanning */
.input-panel {
    max-width: 100%;
}

.output-panel {
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.input-panel table {
    /* make input section feel narrower without squishing fields too much */
    max-width: 100%;
}

.yealrySummaryTable {
    width: 100%;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border: none;
}

thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    padding: 20px;
}

tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f7fafc;
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    word-wrap: break-word;
    vertical-align: middle;
}

td:first-child {
    font-weight: 500;
    color: #2d3748;
    width: 60%;
}

td:last-child {
    width: 40%;
}

.insurance-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.insurance-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.insurance-input:hover {
    border-color: #cbd5e0;
}

.calculate-button,
.secondary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-family: inherit;
}

.calculate-button:hover,
.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.calculate-button:active,
.secondary-button:active {
    transform: translateY(0);
}

.input-actions {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}

.forecast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.forecast-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #2d3748;
    font-weight: 700;
}

.forecast-subtitle {
    margin: 0 0 14px;
    color: #4a5568;
    font-size: 0.95rem;
}

.table-wrap {
    overflow: auto;
}

label {
    color: #2d3748;
    font-size: 1rem;
    margin-left: 5px;
}

.notification-banner {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.notification {
    padding: 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.notification .close-btn {
    margin-left: 15px;
    color: white;
    font-weight: bold;
    float: right;
    font-size: 24px;
    line-height: 20px;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0.8;
}

.notification .close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#children_details {
    padding: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .intro-text {
        padding: 20px;
    }

    .hero-home-button {
        top: 10px;
        left: 10px;
        padding: 7px 11px;
        font-size: 0.9rem;
    }
    
    .intro-heading {
        font-size: 1.8rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 12px 10px;
    }
    
    .calculate-button,
    .secondary-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .contact-card {
        top: 10px;
        margin-bottom: 14px;
    }

    .contact-card-header {
        align-items: center;
        flex-wrap: wrap;
    }

    .contact-card-actions {
        width: 100%;
        align-items: center;
    }

    .contact-card-text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        flex: 1 1 100%;
    }
}

/* Contact card - sticky top right */
.contact-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #667eea;
    position: sticky;
    top: 16px;
    z-index: 50;
    margin: 0 0 14px;
}

.contact-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.contact-card-header h4 {
    margin: 0;
}


.contact-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.contact-card h4 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
}

.contact-card-text {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-card button {
    width: auto;
    padding: 10px 16px;
    font-size: 0.95rem;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.contact-card-links {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.info-link {
    display: block;
    text-align: center;
    padding: 12px 16px;
    background: #f7fafc;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.info-link:hover {
    background: #edf2f7;
    color: #764ba2;
    transform: translateY(-1px);
}

.service-area {
    margin: 10px 0 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #4a5568;
}

.service-area--contact {
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    white-space: normal;
}

/* Footer */
.page-footer {
    max-width: 1400px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Service Towns Section */
.service-towns {
    margin-top: 48px;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-towns h3 {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    text-align: center;
}

.service-towns > p {
    text-align: center;
    color: #4a5568;
    margin-bottom: 24px;
    font-size: 1rem;
}

.towns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.towns-grid span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.towns-grid span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Free Tools Section */
.free-tools-section {
    margin-top: 48px;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.free-tools-section h3 {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    text-align: center;
}

.free-tools-section > p {
    text-align: center;
    color: #4a5568;
    margin-bottom: 32px;
    font-size: 1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.tool-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tool-card:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    transform: translateY(-4px);
}

.tool-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.tool-card p {
    color: #718096;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.tool-coming-soon {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
}

.tool-coming-soon:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-color: #e2e8f0;
}