:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --border: #e2e8f0;
    --dark: #0b1020;
    --green: #16a34a;
    --green-light: #dcfce7;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: min(1160px, calc(100% - 36px));
    margin: 0 auto;
}

/* NAVBAR */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.6px;
    white-space: nowrap;
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .25);
    font-size: 16px;
}

.brand-name {
    color: #0f172a;
}

.brand-name span {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: #334155;
    border-radius: 8px;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a.nav-item {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    transition: color .2s ease;
}

.nav-links a.nav-item:hover,
.nav-links a.nav-item.active {
    color: var(--primary);
}

.nav-auth-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
}

.btn-nav-login {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all .2s ease;
}

.btn-nav-login:hover {
    color: var(--primary);
    background: #f1f5f9;
}

.btn-nav-register {
    font-size: 13.5px;
    font-weight: 700;
    background: var(--primary);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .2);
    transition: all .2s ease;
}

.btn-nav-register:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.nav-cta {
    background: #f1f5f9;
    color: #334155 !important;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid var(--border);
    transition: all .2s ease;
}

.nav-cta:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}

/* ACCOUNT MENU DROPDOWN */
.account-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #475569;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-icon:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: #cbd5e1;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 100;
    width: min(340px, calc(100vw - 32px));
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    color: var(--text);
    text-align: left;
}

.account-dropdown[hidden] {
    display: none !important;
}

.account-dropdown h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #0f172a;
}

.account-dropdown p {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.account-dropdown p span {
    color: var(--muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

.account-dropdown p strong {
    overflow-wrap: anywhere;
    font-size: 14px;
    color: #1e293b;
}

.account-logout {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #e11d48;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.account-logout:hover {
    background: #fff1f2;
    border-color: #fecdd3;
}

/* HERO */
.hero {
    position: relative;
    overflow: hidden;
    padding: 80px 0 45px;
    text-align: center;
    background:
        radial-gradient(ellipse at 15% 15%, rgba(129, 140, 248, .12), transparent 45%),
        radial-gradient(ellipse at 85% 20%, rgba(56, 189, 248, .1), transparent 38%),
        linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #e0e7ff;
    background: rgba(255, 255, 255, .9);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px #dcfce7;
}

.hero h1 {
    max-width: 820px;
    margin: 0 auto 16px;
    font-size: clamp(34px, 4.6vw, 56px);
    line-height: 1.15;
    letter-spacing: -1.8px;
    color: #0f172a;
}

.gradient-text {
    background: linear-gradient(100deg, #4f46e5, #7c3aed 60%, #0284c7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    max-width: 640px;
    font-size: 17px;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 auto 14px;
}

.billing-note {
    color: #94a3b8;
    font-size: 13px;
}

/* ACCOUNT USAGE CARD */
.account-plan {
    display: none;
    max-width: 760px;
    margin: 28px auto 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.account-plan h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #0f172a;
}

.account-plan p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 14px;
}

.account-plan strong {
    color: #0f172a;
}

.usage-track {
    width: 100%;
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    background: #f1f5f9;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.usage-progress {
    width: 0%;
    height: 100%;
    background: var(--green);
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* PRICING PLANS GRID */
.plans-section {
    padding: 40px 0 76px;
}

.plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.plan {
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.plan:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: var(--shadow);
}

.plan.popular {
    border: 2px solid var(--primary);
    box-shadow: 0 14px 40px rgba(79, 70, 229, .1);
}

.popular-label {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 14px;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    white-space: nowrap;
}

.current-plan-badge {
    display: inline-block;
    align-self: flex-start;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--green-light);
    color: #166534;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .3px;
}

.current-plan-badge[hidden] {
    display: none;
}

.plan h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #0f172a;
    letter-spacing: -.4px;
}

.description {
    min-height: 48px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.price {
    margin: 20px 0 2px;
    font-size: 38px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: -1px;
    color: #0f172a;
}

.price small {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0;
}

.billing {
    margin: 0 0 20px;
    min-height: 20px;
    color: var(--muted);
    font-size: 12.5px;
}

.plan hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0 0 18px;
}

/* ENHANCED FEATURES SECTION */
.features-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.feature-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #334155;
    margin: 0;
}

.feature-count-pill {
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
}

.plan-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #334155;
    font-size: 13.5px;
    line-height: 1.45;
}

.feature-item.highlight {
    font-weight: 600;
    color: #0f172a;
}

.feature-text {
    flex: 1;
}

.check-icon-wrap {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.check-icon-wrap svg {
    width: 12px;
    height: 12px;
}

.plan.popular .check-icon-wrap {
    background: var(--primary-light);
    color: var(--primary);
}

.feature-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef2ff;
    color: var(--primary);
    align-self: center;
}

/* EXPANDABLE ACCORDION (NO JS REQUIRED FOR TOGGLE TEXT) */
.feature-expander {
    margin-top: 14px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}

.feature-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.feature-summary::-webkit-details-marker,
.feature-summary::marker {
    display: none;
}

.feature-summary:hover {
    color: var(--primary-dark);
}

.feature-summary .show-less-label {
    display: none;
}

.chevron-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-expander[open] .chevron-icon {
    transform: rotate(180deg);
}

.feature-expander[open] .show-more-label {
    display: none;
}

.feature-expander[open] .show-less-label {
    display: inline;
}

.feature-expander .extra-features {
    margin-top: 12px;
    padding-top: 4px;
}

.feature-summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* PLAN ACTION BUTTONS & FOOTER */
.plan-footer {
    margin-top: auto;
    padding-top: 24px;
}

.plan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: #1e293b;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-button:not(.primary):hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
}

.plan-button.primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}

.plan-button.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.plan-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.plan-button.current-plan-button {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: var(--border);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* FINAL CTA */
.cta-section {
    padding: 72px 0;
    background: var(--dark);
    color: #fff;
    text-align: center;
}

.cta-section h2 {
    max-width: 620px;
    margin: 0 auto 12px;
    font-size: clamp(26px, 3.5vw, 36px);
    letter-spacing: -.8px;
}

.cta-section p {
    max-width: 560px;
    margin: 0 auto 24px;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1.7;
}

.cta-section .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    font-weight: 700;
    transition: background 0.15s ease, transform 0.15s ease;
}

.cta-section .btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* FOOTER */
.site-footer {
    padding: 28px 0;
    background: #fff;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
}

.footer-brand {
    max-width: 320px;
}

.footer-brand p {
    color: var(--muted);
    font-size: 13px;
    margin: 8px 0 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--muted);
    transition: color .15s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: #94a3b8;
    font-size: 12px;
}

.no-plans-message {
    text-align: center;
    grid-column: 1 / -1;
    color: #64748b;
    padding: 40px 0;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
    .plans {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .description {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: -18px;
        right: -18px;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px 24px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
        gap: 12px;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a.nav-item {
        padding: 10px 0;
        font-size: 15px;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-auth-group {
        margin: 8px 0 0 0;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-nav-login,
    .btn-nav-register,
    .nav-cta {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .footer-top {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .container {
        width: calc(100% - 28px);
    }

    .hero {
        padding: 56px 0 32px;
    }

    .plan {
        padding: 24px 20px;
    }

    .footer-bottom {
        flex-direction: column;
    }
}