/* ============================================
   Bed Explorer — Styles
   Career Plan B brand system · Light mode
   Matches MBBS Bond Explorer design DNA
   ============================================ */

/* ─── Reset ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── Design Tokens ─── */
:root {
    /* Career Plan B Brand — matches bond explorer exactly */
    --brand:            #3DB55E;
    --brand-dark:       #2A9444;
    --brand-dim:        #EBF7EF;

    /* Surfaces */
    --surface:          #F2F4F8;
    --white:            #FFFFFF;
    --surface-alt:      #E8EBF3;

    /* Ink scale */
    --ink:              #111827;
    --ink-2:            #374151;
    --ink-3:            #6B7280;
    --ink-4:            #9CA3AF;
    --ink-light:        #F9FAFB;

    /* Borders */
    --hairline:         #DDE1EA;
    --hairline-2:       #C7CDD8;

    /* Semantic */
    --danger:           #991B1B;
    --danger-light:     #FEF2F2;
    --success:          #166534;
    --warning:          #92400E;
    --warning-light:    #FFFBEB;

    /* Layout */
    --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container-max:    1080px;
    --radius-sm:        5px;
    --radius-md:        8px;
    --radius-lg:        12px;

    /* Dark bg for selector / advisory */
    --brand-dark-bg:    #1D4F45;
    --footer-bg:        #0F1210;
}

/* ─── Base ─── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--surface);
    color: var(--ink-2);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 28px;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Header / Nav ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ink);
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo:hover {
    text-decoration: none;
    color: var(--white);
}

.header-tools {
    display: flex;
    gap: 24px;
}

.header-tool-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-4);
    text-decoration: none;
    transition: color 0.15s;
}

.header-tool-link:hover {
    color: var(--white);
    text-decoration: none;
}

/* ─── Page Header ─── */
.page-header {
    background: var(--white);
    border-bottom: 1px solid var(--hairline);
    padding: 80px 0 64px;
    text-align: center;
}

.eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-dark);
    margin-bottom: 18px;
}

.page-header h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 22px;
}

.header-sub {
    font-size: 1.05rem;
    color: var(--ink-3);
    max-width: 600px;
    margin: 0 auto 12px;
    line-height: 1.65;
}

.header-note {
    font-size: 0.75rem;
    color: var(--ink-4);
    letter-spacing: 0.01em;
}

/* ─── Trust Bar (page header) ─── */
.trust-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 8px;
    margin: 16px auto 0;
    padding: 0;
    font-size: 0;
    width: 100%;
}

.trust-item,
.trust-separator {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    color: var(--ink-3);
}

.trust-item strong {
    color: var(--ink);
    font-weight: 700;
    font-size: inherit;
}

.trust-separator {
    color: var(--hairline-2);
    font-weight: 300;
    margin: 0 16px;
}

/* ─── Header CTA ─── */
.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    margin-bottom: 0;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    background: var(--brand);
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    text-decoration: none;
}

.header-cta:hover {
    background: var(--brand-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

.header-cta:active {
    transform: translateY(1px);
}

.header-cta svg {
    flex-shrink: 0;
}

/* ─── State Selector Section ─── */
.selector-section {
    padding: 80px 0;
    background: var(--brand-dark-bg);
}

.selector-section h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--white);
    margin-bottom: 8px;
    text-align: center;
}

.selector-sub {
    font-size: 0.95rem;
    color: var(--brand);
    margin-bottom: 48px;
    text-align: center;
}

.selector-wrap {
    max-width: 460px;
    margin: 0 auto;
    background: var(--white);
    padding: 36px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.selector-wrap label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: block;
}

.selector-wrap select {
    width: 100%;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.selector-wrap select:focus {
    outline: none;
    background: var(--white);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-dim);
}

.selector-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.selector-input-group select {
    width: 100%;
}

.pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    background: var(--brand);
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.pill-btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

.pill-btn:active {
    transform: translateY(1px);
}

.pill-btn svg {
    flex-shrink: 0;
}

.counselling-link {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.15s;
}

.counselling-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

/* ─── Results Section ─── */
.results-section {
    padding: 64px 0 80px;
    background: var(--white);
    border-top: 1px solid var(--hairline);
    display: none;
}

.results-section.visible {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.results-header {
    margin-bottom: 40px;
}

.results-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.results-state-name {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0;
}

/* ─── Summary Stats ─── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 48px;
}

.summary-stat {
    background: var(--white);
    padding: 28px 24px;
}

.summary-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-4);
    margin-bottom: 6px;
}

.summary-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.summary-stat-value.highlight {
    color: var(--brand);
}

/* ─── Filter Pills ─── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.filter-pill {
    font-family: var(--font);
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--ink-3);
    background: var(--white);
    border: 1px solid var(--hairline);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1.4;
}

.filter-pill:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.filter-pill.active {
    background: var(--brand-dim);
    border-color: var(--brand);
    color: var(--brand-dark);
    font-weight: 600;
}

/* ─── Search Bar ─── */
.search-bar {
    margin-bottom: 24px;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    max-width: 380px;
    transition: border-color 0.15s;
}

.search-input-wrap:focus-within {
    border-color: var(--brand);
}

.search-input-wrap svg {
    flex-shrink: 0;
    color: var(--ink-4);
}

.search-input {
    width: 100%;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: none;
    padding: 10px 0 10px 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--ink-4);
}

/* ─── Results Count ─── */
.results-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

/* ─── College Table ─── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.college-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.college-table thead {
    background: var(--surface);
}

.college-table th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
    padding: 14px 18px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    border-bottom: 1px solid var(--hairline);
}

.college-table th:hover {
    color: var(--ink);
}

.college-table th .sort-icon {
    font-size: 0.55rem;
    margin-left: 4px;
    opacity: 0.4;
}

.college-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--brand);
}

.college-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
}

.college-table tr:last-child td {
    border-bottom: none;
}

.college-table tr:hover td {
    background: var(--surface);
}

.college-name {
    font-weight: 600;
    color: var(--ink);
}

.college-city {
    color: var(--ink-3);
    font-size: 0.78rem;
    margin-top: 2px;
}

.college-type {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--brand);
    color: var(--white);
    display: inline-block;
}

.college-type.private {
    background: #6366F1;
}

.college-type.deemed {
    background: #8B5CF6;
}

.college-type.central {
    background: #0EA5E9;
}

.bed-count {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.data-pending {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-4);
    font-style: italic;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--ink-4);
    font-size: 0.875rem;
}

/* No results */
.no-results-row td {
    text-align: center;
    padding: 48px 24px;
    color: var(--ink-4);
    font-size: 0.875rem;
}

/* ─── Accordion Section (dark green cards — matches MBBS True Cost Calculator) ─── */
.accordion-section {
    padding: 80px 0;
    background: var(--white);
    border-top: none;
}

.accordion-section h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 28px;
    text-align: center;
}

.accordion {
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.accordion-item {
    background: var(--brand-dark-bg);
    border-radius: 12px;
    overflow: hidden;
}

.accordion-item.open {
    background: var(--white);
    border: 1px solid var(--hairline);
}

.accordion-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--brand-dark-bg);
    border: none;
    color: var(--white);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    gap: 16px;
}

.accordion-icon {
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.accordion-item.open .accordion-icon {
    transform: rotate(180deg);
    color: var(--ink-4);
}

.accordion-content {
    display: none;
    padding: 24px;
    background: var(--white);
    color: var(--ink-2);
    font-size: 0.95rem;
    line-height: 1.6;
}

.accordion-item.open .accordion-content {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.accordion-content p {
    margin-bottom: 12px;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

.accordion-content strong {
    color: var(--ink);
    font-weight: 600;
}

/* ─── Understanding / Why Beds Mislead ─── */
.understanding-section {
    padding: 80px 0;
    background: var(--brand-dark-bg);
    border-top: none;
}

.understanding-section h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 8px;
}

.understanding-sub {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 44px;
}

.understanding-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.understanding-stat {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
}

.understanding-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--brand);
    margin-bottom: 16px;
}

.understanding-item p {
    font-size: 0.875rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.7);
}

.understanding-item p strong {
    color: var(--white);
}

/* ─── Advisory / CTA ─── */
.advisory-section {
    padding: 88px 0;
    background: var(--surface);
    border-top: 1px solid var(--hairline);
}

.advisory-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}

.advisory-text .eyebrow {
    color: var(--brand-dark);
}

.advisory-text h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 20px;
    line-height: 1.3;
}

.advisory-text p {
    font-size: 0.95rem;
    color: var(--ink-3);
    line-height: 1.7;
    margin-bottom: 24px;
}

.advisory-specifics {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.advisory-specifics li {
    font-size: 0.875rem;
    color: var(--ink-3);
    line-height: 1.7;
    padding-left: 16px;
    border-left: 2px solid var(--brand);
}

.advisory-specifics li strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

/* ─── Consultation Form ─── */
.advisory-form-wrap {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    border: 1px solid var(--hairline);
}

.consultation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.req {
    color: var(--danger);
}

.form-group input,
.consultation-form select {
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: border-color 0.15s;
}

.form-group input:focus,
.consultation-form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-dim);
}

.consultation-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.cta-primary {
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--white);
    background: var(--brand);
    border: none;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.cta-primary:hover:not(:disabled) {
    background: var(--brand-dark);
}

.cta-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trust-copy {
    font-size: 0.68rem;
    color: var(--ink-4);
    text-align: center;
    margin-top: 6px;
}

.form-success-message {
    text-align: center;
    padding: 36px 24px;
}

.success-icon {
    font-size: 2rem;
    color: var(--brand);
    margin-bottom: 12px;
}

.form-success-message h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.form-success-message p {
    font-size: 0.85rem;
    color: var(--ink-3);
    margin: 0;
    line-height: 1.6;
}

/* ─── Footer ─── */
.site-footer {
    border-top: none;
    padding: 64px 0;
    background: var(--footer-bg);
    color: #6B7280;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 48px;
}

.footer-brand p {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 4px;
}

.footer-logo {
    pointer-events: auto;
    text-decoration: none;
    color: var(--white);
}

.footer-logo:hover {
    color: var(--white);
    text-decoration: none;
}

.footer-disclaimer {
    max-width: 560px;
}

.footer-disclaimer p {
    font-size: 0.7rem;
    color: #6B7280;
    line-height: 1.65;
    margin-bottom: 6px;
}

.footer-disclaimer p:last-child {
    margin-bottom: 0;
}

/* ─── Cross Links ─── */
.cross-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-dark);
    text-decoration: none;
    width: fit-content;
}

.cross-link:hover {
    color: var(--brand);
    text-decoration: none;
}

.cross-link svg {
    flex-shrink: 0;
}

/* ─── Utilities ─── */
.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;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .trust-bar {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .trust-separator {
        display: none;
    }
    .trust-item {
        font-size: 0.82rem;
        line-height: 1.35;
        text-align: center;
        white-space: nowrap;
    }
    .understanding-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 48px 0 36px;
    }

    .accordion-item {
        border-radius: var(--radius-lg);
    }

    .accordion-trigger {
        padding: 14px 20px;
        font-size: 0.82rem;
    }

    .accordion-content {
        padding: 0 20px 18px;
    }

    .advisory-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .header-tools {
        gap: 12px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .college-table th,
    .college-table td {
        padding: 12px 12px;
    }

    .filter-pill {
        font-size: 0.72rem;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .header-tools {
        display: none;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .understanding-grid {
        grid-template-columns: 1fr;
    }

    .selector-input-group {
        flex-direction: column;
    }
}
