:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #f3f4f6;
    --text-main: #111827;
    --text-muted: #4b5563;
    --bg-main: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body[data-route="login"],
body[data-route="membership-status"] {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

body.legal-modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s ease;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-main);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: -2rem;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    color: white;
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.logo-img {
    height: 1.5rem;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

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

.github-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--secondary);
    white-space: nowrap;
}

.github-btn:hover {
    background: var(--border);
}

/* Hero Section */
.hero {
    padding: 10rem 2rem 5rem;
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-main-title {
    font-size: 2.8rem;
}

.gradient-text {
    background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-badges a {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hero-badges a:hover {
    color: var(--primary);
}

.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    perspective: 1000px;
}

.hero-image-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #3b82f6, #ec4899);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: -1;
    animation: flow 10s infinite alternate;
}

@keyframes flow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, -50px);
    }
}

.glass-mockup {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: 8px;
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 850px;
    aspect-ratio: 16 / 10;
    height: auto;
    transform: rotateY(-8deg) rotateX(4deg);
    transition: transform 0.5s ease;
    padding: 0;
    background-color: transparent;
    /* better blend for contained images */
}

.glass-mockup:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.carousel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 10;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.carousel-slide img:hover {
    transform: scale(1.02);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.indicator.active {
    background-color: var(--primary);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Features */
.features {
    padding: 5rem 2rem;
    background-color: var(--bg-alt);
}

.feature-showcase {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12rem;
}

.feature-block {
    display: flex;
    align-items: center;
    gap: 6rem;
    justify-content: space-between;
}

.feature-block.text-right {
    flex-direction: row-reverse;
}

.feature-text {
    flex: 1;
}

.feature-text h3 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.feature-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.feature-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag i {
    color: var(--primary);
    font-size: 1.1rem;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.feature-visual {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.showcase-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 750px;
}

.showcase-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: zoom-in;
}

/* LLM Infinite Marquee Grid */
.llm-marquee {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    -webkit-mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent);
    mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent);
}

.marquee-track {
    display: flex;
    gap: 1.2rem;
    width: max-content;
}

/* Three different speeds and offsets to create parallax feel */
.marquee-track.forward {
    animation: marquee-scroll 25s linear infinite;
}

.marquee-track.reverse {
    animation: marquee-scroll 32s linear infinite reverse;
    animation-delay: -5s;
    /* Offset start */
}

.marquee-track.slow {
    animation: marquee-scroll 40s linear infinite;
    animation-delay: -12s;
    /* Offset start */
}

.marquee-content {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.marquee-content img {
    height: 100px;
    width: 100px;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: 20px;
    background: var(--bg-main);
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    /* slight depth */
    border: 1px solid var(--border);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.marquee-content img:hover {
    transform: scale(1.15) rotate(5deg);
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-50% - 0.6rem));
    }
}

.showcase-img {
    width: 100%;
    max-width: 750px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: block;
}

.showcase-video-wrapper:hover .showcase-img,
.showcase-img:hover {
    transform: scale(1.02);
}

/* Testimonials */
.testimonials {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.badge {
    background: var(--bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stars {
    color: #fbbf24;
    margin-bottom: 1rem;
}

.testimonial-card p {
    font-style: italic;
    color: var(--text-muted);
    position: relative;
}

.testimonial-card p::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    top: -20px;
    left: -15px;
    color: rgba(0, 0, 0, 0.05);
    font-family: serif;
    z-index: 0;
}

/* Pricing Section */
.pricing {
    padding: 5rem 2rem;
    background-color: var(--bg-alt);
}

.pricing-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.pricing-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.pricing-card.popular {
    border: 2px solid var(--primary);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.plan-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    min-height: 40px;
}

.plan-features {
    list-style: none;
    margin-bottom: 3rem;
    flex: 1;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.plan-features li i {
    color: #10b981;
    margin-top: 3px;
}

.pricing-card .btn {
    width: 100%;
}

.app-pricing-notice {
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin: 3rem auto 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Download Section */
.download {
    padding: 5rem 2rem;
    max-width: 1250px;
    margin: 0 auto;
}

.download-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.download-card {
    background: var(--bg-alt);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.download-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.download-card i {
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.download-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.download-card .btn {
    width: 100%;
    margin-bottom: 1rem;
}

.sub-link {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sub-link:hover {
    color: var(--primary);
}

.dual-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dual-buttons .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* FAQ */
.faq {
    padding: 5rem 2rem;
    background: var(--bg-alt);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--secondary);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    color: var(--text-muted);
    transition: all 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 500px;
    opacity: 1;
}

/* Footer */
.footer {
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--border);
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.footer-content .logo {
    justify-content: center;
    margin-bottom: 0;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-record {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.footer-record a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

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

/* Membership Portal */
.auth-view {
    display: none;
}

body[data-route="login"] .home-only,
body[data-route="membership-status"] .home-only {
    display: none !important;
}

body[data-route="login"] .nav-links,
body[data-route="login"] .nav-actions,
body[data-route="membership-status"] .nav-links,
body[data-route="membership-status"] .nav-actions {
    display: none;
}

body[data-route="login"] .auth-view-login,
body[data-route="membership-status"] .auth-view-status {
    display: block;
}

.auth-view-login,
.auth-view-status {
    padding: 7.5rem 2rem 4rem;
}

.portal-shell {
    max-width: 1250px;
    margin: 0 auto;
}

.auth-page-shell {
    min-height: calc(100vh - 11rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 28px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
    padding: 1.75rem;
    text-align: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.auth-page-topline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    vertical-align: middle;
}

.auth-page-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: #0f172a;
    font-weight: 800;
    font-size: 1.1rem;
}

.auth-page-brand-text {
    line-height: 1;
}

.auth-page-title {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.auth-page-subtitle {
    color: #475569;
    margin-bottom: 1.4rem;
}

.auth-login-qr {
    min-height: 300px;
}

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.auth-code-input {
    width: 100%;
}

.auth-login-button {
    width: 100%;
}

.auth-login-feedback {
    min-height: 1.8rem;
}

.auth-login-legal {
    color: #64748b;
    font-size: 0.92rem;
    margin-top: 0.8rem;
}

.auth-login-legal a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
}

.portal-status-page-card {
    max-width: 1080px;
    margin: 0 auto;
}

.portal-status-layout {
    grid-template-columns: minmax(0, 1.14fr) minmax(340px, 0.86fr);
    gap: 1.4rem;
}

.portal-status-card,
.portal-purchase-card {
    height: 100%;
}

.portal-status-card .portal-card-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-status-card .portal-card-head h3 {
    white-space: nowrap;
}

.portal-head {
    margin-bottom: 2rem;
}

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.portal-title,
.portal-subtitle {
    text-align: left;
}

.portal-subtitle {
    max-width: 860px;
    margin: 0;
}

.portal-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.portal-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.portal-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.portal-card-head h3 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.portal-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.portal-card-kicker {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.portal-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-action-btn,
.portal-submit-btn {
    white-space: nowrap;
}

.portal-login-qr {
    min-height: 280px;
    border-radius: 20px;
    border: 1px dashed rgba(59, 130, 246, 0.3);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.9)),
        repeating-linear-gradient(
            45deg,
            rgba(59, 130, 246, 0.03),
            rgba(59, 130, 246, 0.03) 10px,
            transparent 10px,
            transparent 20px
        );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

.portal-login-qr-image {
    width: min(100%, 260px);
    max-height: 260px;
    object-fit: contain;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.portal-login-qr-placeholder {
    max-width: 260px;
    text-align: center;
    color: #475569;
    font-weight: 600;
}

.portal-steps,
.portal-security-note ul {
    padding-left: 1.2rem;
}

.portal-steps {
    color: #475569;
    margin-bottom: 1.2rem;
}

.portal-steps li + li,
.portal-security-note li + li {
    margin-top: 0.45rem;
}

.portal-login-form {
    margin-bottom: 0.75rem;
}

.portal-input-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.55rem;
}

.portal-input-row {
    display: flex;
    gap: 0.75rem;
}

.portal-code-input {
    flex: 1;
    min-width: 0;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #ffffff;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-code-input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.7);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.portal-feedback {
    min-height: 1.5rem;
    font-size: 0.95rem;
    color: #0f172a;
}

.portal-feedback.is-error {
    color: #b91c1c;
}

.portal-feedback.is-success {
    color: #047857;
}

.portal-feedback.is-info,
.portal-feedback-muted {
    color: #475569;
}

.portal-security-note {
    margin-top: 1rem;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.portal-security-note h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 1rem;
}

.portal-status-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    color: #e2e8f0;
    margin-bottom: 1.1rem;
}

.portal-status-card .portal-status-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.portal-status-main {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-status-main h4 {
    font-size: 1.35rem;
    margin: 0.7rem 0 0.35rem;
}

.portal-status-summary {
    color: #cbd5e1;
    margin: 0;
    white-space: nowrap;
    font-size: 0.98rem;
}

.portal-status-meta {
    flex: 0 0 auto;
    min-width: 96px;
    text-align: right;
}

.portal-status-card .portal-status-meta {
    min-width: 0;
    justify-self: end;
}

.portal-meta-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.3rem;
}

.portal-meta-value {
    font-size: 0.92rem;
    color: #f8fafc;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.portal-chip-neutral {
    background: rgba(148, 163, 184, 0.16);
    color: #334155;
}

.portal-chip-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.portal-chip-success {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.portal-chip-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.portal-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.portal-status-item {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.portal-status-item-wide {
    grid-column: 1 / -1;
}

.portal-status-label {
    display: block;
    font-size: 0.86rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.portal-status-value {
    display: block;
    font-size: 1.05rem;
    color: #0f172a;
    line-height: 1.4;
    word-break: break-word;
}

.portal-state-flags {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0.8rem;
}

.portal-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    color: #1e3a8a;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
}

.portal-purchase-section {
    margin: 0;
}

.portal-order-panel {
    margin-top: 1.4rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.portal-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.portal-section-head h4,
.portal-purchase-group-head h5 {
    margin: 0;
    color: #0f172a;
}

.portal-purchase-note {
    margin: 0 0 1rem;
    color: #475569;
    line-height: 1.8;
}

.portal-purchase-group + .portal-purchase-group {
    margin-top: 1rem;
}

.portal-purchase-group-head {
    margin-bottom: 0.8rem;
}

.portal-purchase-group-head p {
    margin: 0.35rem 0 0;
    color: #64748b;
    line-height: 1.7;
}

.portal-plan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.portal-plan-card {
    position: relative;
    width: 100%;
    padding: 1rem 0.95rem;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-plan-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.10);
}

.portal-plan-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.16);
}

.portal-plan-card.is-disabled {
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
    box-shadow: none;
    transform: none;
}

.portal-plan-card.is-disabled:hover {
    transform: none;
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: none;
}

.portal-plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
}

.portal-plan-title {
    display: block;
    margin-top: 0.85rem;
    color: #475569;
    font-size: 0.92rem;
    font-weight: 700;
}

.portal-plan-price {
    display: flex;
    align-items: flex-end;
    gap: 0.2rem;
    margin-top: 0.55rem;
    color: #0f172a;
    font-weight: 800;
}

.portal-plan-currency {
    font-size: 0.92rem;
    line-height: 1.2;
}

.portal-plan-amount {
    font-size: 1.85rem;
    line-height: 1;
}

.portal-plan-divider {
    width: 72px;
    height: 1px;
    margin: 0.9rem 0 0.8rem;
    background: rgba(226, 232, 240, 0.95);
}

.portal-plan-desc {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
    white-space: pre-line;
}

.portal-plan-empty {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    color: #64748b;
    line-height: 1.7;
}

.portal-purchase-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.03));
    border: 1px solid rgba(191, 219, 254, 0.95);
}

.portal-purchase-summary-copy {
    min-width: 0;
}

.portal-summary-label {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}

.portal-summary-value {
    display: block;
    color: #0f172a;
    font-size: 1.08rem;
}

.portal-summary-desc {
    margin: 0.45rem 0 0;
    color: #475569;
    line-height: 1.7;
}

.portal-purchase-btn {
    min-width: 168px;
    white-space: nowrap;
}

.portal-order-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.15rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.portal-order-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.legal-modal[hidden] {
    display: none;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.legal-modal-dialog {
    position: relative;
    width: min(1180px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.legal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.legal-modal-close {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 1.1rem;
    cursor: pointer;
}

.legal-modal-content {
    padding: 1.5rem 1.75rem;
    overflow: auto;
    color: #334155;
    line-height: 1.75;
}

.legal-modal-content h1,
.legal-modal-content h2,
.legal-modal-content h3 {
    color: #0f172a;
    margin: 1rem 0 0.6rem;
}

.legal-modal-content p,
.legal-modal-content li {
    margin-bottom: 0.7rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
    }

    .hero-subtitle {
        margin: 0 auto 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-badges {
        justify-content: center;
    }

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

    .legal-modal-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-actions {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .feature-block,
    .feature-block.text-right {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .feature-tags {
        justify-content: center;
    }

    .membership-portal {
        padding: 1rem 1rem 3.5rem;
    }

    .auth-view-login,
    .auth-view-status {
        padding: 6.5rem 1rem 3rem;
    }

    .auth-page-shell {
        min-height: auto;
    }

    .auth-page-card {
        padding: 1.2rem;
        border-radius: 22px;
    }

    .auth-page-title {
        font-size: 1.6rem;
    }

    .auth-page-topline {
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .portal-card {
        padding: 1.1rem;
        border-radius: 20px;
    }

    .portal-card-head,
    .portal-status-banner,
    .portal-order-banner,
    .portal-purchase-summary,
    .portal-section-head,
    .portal-page-actions {
        flex-direction: column;
    }

    .portal-status-card .portal-card-head h3,
    .portal-status-summary {
        white-space: normal;
    }

    .portal-status-meta {
        text-align: left;
        min-width: 0;
    }

    .portal-plan-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portal-input-row {
        flex-direction: column;
    }

    .portal-status-grid {
        grid-template-columns: 1fr;
    }

    .portal-state-flags {
        grid-template-columns: 1fr;
    }

    .portal-purchase-btn,
    .portal-order-actions .portal-action-btn {
        width: 100%;
        justify-content: center;
    }

    .portal-page-actions .portal-action-btn {
        width: 100%;
        justify-content: center;
    }

    .legal-modal-head,
    .legal-modal-content {
        padding: 1rem;
    }
}

@media (max-width: 560px) {
    .portal-plan-grid {
        grid-template-columns: 1fr;
    }
}
