* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    font-size: 14px;
    width: 100%;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.auth-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-panel {
    width: min(420px, 100%);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

.auth-panel p {
    margin: 0 0 18px;
    color: #374151;
    line-height: 1.5;
}

.page {
    display: flex;
    gap: 16px;
    padding: 16px;
    align-items: flex-start;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.left-panel {
    flex: 0 0 clamp(300px, 25vw, 420px);
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
    max-width: 100%;
}

.right-panel {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - 32px);
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

h2 {
    margin: 0 0 18px;
    font-size: 24px;
}

h4 {
    margin: 0 0 14px;
    font-size: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

input,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
    width: 100%;
    border: none;
    background: #2563eb;
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#result {
    min-height: calc(100vh - 110px);
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    line-height: 1.5;
    max-width: 100%;
    overflow-x: hidden;
}

/* =========================
   COMPANY FILTERS
========================= */

.company-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.company-filter {
    border: 1px solid #ddd;
    border-radius: 14px;
    overflow: hidden;
    background: white;
}

.company-filter summary {
    cursor: pointer;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    list-style: none;
    transition: 0.2s ease;
}

.company-filter summary::-webkit-details-marker {
    display: none;
}

.company-filter[open] summary {
    border-bottom: 1px solid #eee;
}

.jf-filter summary {
    background: #1565c0;
    color: white;
}

.manulife-filter summary {
    background: #2e7d32;
    color: white;
}

.allianz-filter summary {
    background: #ef6c00;
    color: white;
}

.tugo-filter summary {
    background: #6a1b9a;
    color: white;
}

/* =========================
   FILTER OPTIONS
========================= */

.filter-section {
    padding: 20px;
}

.filter-section h4 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
}

.filter-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 14px 16px;

    border: 1px solid #d1d5db;
    border-radius: 12px;

    background: #fafafa;

    font-size: 16px;
    font-weight: 500;

    cursor: pointer;
    transition: 0.2s ease;
}

.filter-option:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.filter-option:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
}

.jf-filter .filter-option:has(input:checked) {
    background: #e3f2fd;
    border-color: #1565c0;
}

.manulife-filter .filter-option:has(input:checked) {
    background: #e8f5e9;
    border-color: #2e7d32;
}

.allianz-filter .filter-option:has(input:checked) {
    background: #fff3e0;
    border-color: #ef6c00;
}

.tugo-filter .filter-option:has(input:checked) {
    background: #f3e5f5;
    border-color: #6a1b9a;
}

.coming-soon {
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* =========================
   QUOTE TABLE
========================= */

.quote-header {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 14px;
    text-align: left;
    color: #111827;
}

.quote-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: clamp(11px, 0.82vw, 14px);
    background: white;
}

.quote-table th,
.quote-table td {
    border: 2px solid #111;
    padding: 8px 6px;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    vertical-align: middle;
}

.quote-table th {
    font-weight: 700;
    text-align: center;
}

.quote-table td {
    text-align: center;
}

.quote-table .premium-cell,
.quote-table .premium-header,
.quote-table .date-cell {
    background: #ffffff;
    font-weight: 700;
    text-align: left;
    width: 18%;
}

.jf-header {
    color: white;
    background: #1565c0;
}

.manulife-header {
    color: white;
    background: #2e7d32;
}

.allianz-header {
    color: white;
    background: #ef6c00;
}

.tugo-header {
    color: white;
    background: #6a1b9a;
}

/* =========================
   RESULT CARDS
========================= */

.quote-card {
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.quote-price {
    font-size: 26px;
    font-weight: bold;
    color: #1d4ed8;
}

.quote-file {
    margin-top: 8px;
    font-size: 13px;
}

/* =========================
   ERRORS
========================= */

.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px;
}

.error ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    .page {
        flex-direction: column;
    }

    .left-panel {
        flex-basis: auto;
        width: 100%;
    }
}

@media (max-width: 700px) {

    .filter-options {
        grid-template-columns: 1fr;
    }

    .quote-table {
        font-size: 12px;
    }

    .quote-table th,
    .quote-table td {
        padding: 8px;
    }
}
