/* =========================
   Reset
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #172033;
    line-height: 1.6;
}

/* =========================
   Layout
========================= */

.container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

/* =========================
   Header
========================= */

.site-header {
    padding: 70px 0 45px;
    background: linear-gradient(135deg, #172554, #3730a3);
    color: white;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

h1 {
    max-width: 700px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
}

.intro {
    max-width: 650px;
    margin-top: 16px;
    font-size: 1.05rem;
    opacity: 0.9;
}

/* =========================
   Comparison Section
========================= */

.comparison-section {
    margin: 45px 0;
}

.comparison-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.comparison-header h2 {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.comparison-header p {
    color: #526075;
}

/* =========================
   Button
========================= */

.difference-button {
    border: 2px solid #3730a3;
    background: white;
    color: #3730a3;
    padding: 12px 18px;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.difference-button:hover {
    background: #eef2ff;
}

.difference-button[aria-pressed="true"] {
    background: #3730a3;
    color: white;
}

.difference-button:active {
    transform: translateY(1px);
}

/* =========================
   Keyboard Focus
========================= */

button:focus-visible,
a:focus-visible {
    outline: 4px solid #f59e0b;
    outline-offset: 4px;
}

/* =========================
   Table
========================= */

.comparison-table-wrapper {
    background: white;
    border: 1px solid #d9e0ea;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(23, 32, 51, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: #172554;
    color: white;
}

th,
td {
    padding: 17px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

thead th:first-child {
    width: 28%;
    text-align: left;
}

tbody th {
    text-align: left;
    font-weight: 700;
    background: #f8fafc;
}

tbody td {
    color: #344054;
}

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

tbody tr:hover th,
tbody tr:hover td {
    background: #f8faff;
}

.plan-price {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.8;
}

/* =========================
   Difference Mode
========================= */

#comparisonTable.differences-only tbody tr.same-feature {
    display: none;
}

#comparisonTable.differences-only tbody tr.different-feature th,
#comparisonTable.differences-only tbody tr.different-feature td {
    background: #fff7ed;
}

.difference-status {
    margin-top: 14px;
    color: #526075;
    font-size: 0.9rem;
}

/* =========================
   Screen Reader Utility
========================= */

.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;
}

/* =========================
   Footer
========================= */

.site-footer {
    padding: 25px 0;
    border-top: 1px solid #d9e0ea;
    background: white;
    color: #667085;
    text-align: center;
    font-size: 0.9rem;
}

/* =========================
   Tablet
========================= */

@media (max-width: 850px) {

    .comparison-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .difference-button {
        width: 100%;
    }

    th,
    td {
        padding: 14px 10px;
        font-size: 0.9rem;
    }

    thead th:first-child {
        width: 25%;
    }
}

/* =========================
   Mobile
========================= */

@media (max-width: 600px) {

    .container {
        width: min(100% - 24px, 1180px);
    }

    .site-header {
        padding: 45px 0 35px;
    }

    .comparison-section {
        margin: 30px 0;
    }

    .comparison-table-wrapper {
        border: none;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    /*
       On narrow screens the table becomes
       a stacked comparison layout.
       Each plan gets its own card.
    */

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    tbody {
        display: grid;
        gap: 16px;
    }

    tbody tr {
        background: white;
        border: 1px solid #d9e0ea;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
    }

    tbody th {
        width: 100%;
        padding: 14px;
        background: #172554;
        color: white;
        font-size: 1rem;
    }

    tbody td {
        width: 100%;
        padding: 12px 14px;
        text-align: left;
        border-bottom: 1px solid #e2e8f0;
        display: grid;
        grid-template-columns: 45% 55%;
        gap: 8px;
    }

    tbody td::before {
        font-weight: 700;
        color: #526075;
    }

    tbody td:nth-child(2)::before {
        content: "Starter";
    }

    tbody td:nth-child(3)::before {
        content: "Professional";
    }

    tbody td:nth-child(4)::before {
        content: "Enterprise";
    }

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

    #comparisonTable.differences-only tbody tr.same-feature {
        display: none;
    }

    .difference-status {
        margin-bottom: 10px;
    }
}

/* =========================
   Very Narrow Screens
========================= */

@media (max-width: 360px) {

    .container {
        width: calc(100% - 20px);
    }

    h1 {
        font-size: 2rem;
    }

    .comparison-header h2 {
        font-size: 1.45rem;
    }

    tbody td {
        grid-template-columns: 42% 58%;
        padding: 11px;
        font-size: 0.88rem;
    }

    .difference-button {
        padding: 11px 14px;
    }
}