:root {
    --bg: #f6f9ff;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-soft: rgba(90, 107, 255, 0.08);
    --panel-border: rgba(112, 129, 255, 0.18);
    --text: #16213f;
    --muted: #66759a;
    --accent: #5a6bff;
    --accent-2: #58c7ff;
    --danger: #ef4444;
    --surface: #ffffff;
    --surface-text: #16213f;
    --radius: 24px;
    --shadow: 0 24px 60px rgba(70, 93, 196, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: radial-gradient(circle at top left, rgba(88, 199, 255, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(90, 107, 255, 0.14), transparent 26%),
        linear-gradient(180deg, #fbfdff 0%, #f3f7ff 46%, #ffffff 100%);
    color: var(--text);
    min-height: 100vh;
}

.site-shell,
.app-page {
    min-height: 100vh;
}

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

img {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.site-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(90, 107, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 107, 255, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.14), transparent);
    pointer-events: none;
}

.site-frame,
.app-frame {
    position: relative;
    z-index: 1;
    max-width: 1420px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.page-wrap,
.app-main {
    padding: 0;
}

.topbar,
.site-footer,
.sidebar,
.card,
.flash,
.stat-card,
.hero-panel {
    backdrop-filter: blur(18px);
}

.topbar {
    position: sticky;
    top: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding: 1.05rem 1.4rem;
    border: 1px solid rgba(112, 129, 255, 0.14);
    border-radius: 24px;
    background: rgba(249, 251, 255, 0.92);
    box-shadow: 0 16px 40px rgba(46, 65, 150, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #4c67ff, #58c7ff);
}

.nav-links,
.sidebar-nav,
.hero-actions,
.button-row,
.footer-links,
.mini-metrics,
.form-row,
.meta-grid,
.section-head {
    display: flex;
    gap: 1rem;
}

.nav-links,
.sidebar-nav {
    align-items: center;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.8rem 1.2rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #4c67ff, #58c7ff);
    transition: transform 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 18px 40px rgba(76, 103, 255, 0.22);
}

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

.button.ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    border: 1px solid rgba(112, 129, 255, 0.18);
}

.button.danger {
    color: white;
    background: rgba(239, 68, 68, 0.92);
    box-shadow: none;
}

.button.full {
    width: 100%;
}

.hero,
.app-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.hero.compact,
.public-shell,
.auth-card {
    grid-template-columns: 1fr;
    max-width: 840px;
}

.hero-copy,
.hero-panel,
.card,
.stat-card,
.flash,
.sidebar {
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.card,
.stat-card,
.auth-card {
    padding: 1.5rem;
}

.hero-copy h1,
.hero.compact h1,
.app-header h1,
.auth-card h1 {
    margin: 0.3rem 0 1rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.1rem, 4vw, 4.6rem);
    line-height: 0.98;
}

.hero.compact h1,
.app-header h1,
.auth-card h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
}

.eyebrow,
.stack-label {
    display: inline-block;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.mini-metrics {
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.mini-metrics span,
.meta-grid span,
.stat-card span {
    color: var(--muted);
}

.glass {
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 12rem;
    height: 12rem;
    background: radial-gradient(circle, rgba(90, 107, 255, 0.18), transparent 65%);
    filter: blur(10px);
}

.panel-grid,
.grid-3,
.stats-grid,
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.panel-grid,
.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.stats-grid.small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: 1.4fr 1fr;
}

.qr-editor-grid,
.qr-detail-grid {
    grid-template-columns: 1.3fr 0.9fr;
}

.section-split {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 1rem;
    align-items: start;
    margin: 2rem 0;
}

.timeline,
.feature-list,
.stack-form,
.prose {
    display: grid;
    gap: 1rem;
}

.timeline > div,
.feature-list li {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(112, 129, 255, 0.12);
    border-radius: 18px;
    background: rgba(246, 249, 255, 0.94);
    list-style: none;
}

.feature-list {
    padding: 0;
    margin: 0;
}

.card h2,
.card h3,
.stat-card strong,
.plan-price {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
}

.plan-price {
    font-size: 2.4rem;
}

.plan-price span {
    font-size: 1rem;
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1.4rem 1.5rem 1.6rem;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    color: var(--muted);
}

.footer-links {
    align-items: center;
    flex-wrap: wrap;
}

.auth-card,
.form-card {
    max-width: 760px;
}

.flash {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.flash-success {
    border-color: rgba(90, 107, 255, 0.28);
}

.flash-error {
    border-color: rgba(239, 68, 68, 0.28);
}

.stack-form label {
    display: grid;
    gap: 0.45rem;
}

.stack-form span {
    color: var(--muted);
    font-size: 0.92rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.9rem 1rem;
    color: var(--text);
    border: 1px solid rgba(112, 129, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    outline: none;
}

input[type="color"] {
    min-height: 3rem;
    padding: 0.35rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(90, 107, 255, 0.66);
    box-shadow: 0 0 0 4px rgba(90, 107, 255, 0.12);
}

.muted,
.card p,
.prose p,
.hero p {
    color: var(--muted);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    align-items: start;
}

.sidebar {
    margin: 0;
    padding: 1.4rem;
    position: sticky;
    top: 1rem;
    align-self: start;
}

.app-main {
    display: grid;
    gap: 1rem;
}

.sidebar-nav {
    flex-direction: column;
    align-items: stretch;
    margin: 1.6rem 0;
}

.sidebar-nav a {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(244, 247, 255, 0.94);
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 0.85rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(112, 129, 255, 0.12);
}

.stat-card strong {
    font-size: 2rem;
}

.preview-card {
    align-self: start;
}

.qr-preview {
    display: grid;
    place-items: center;
    gap: 1rem;
    min-height: 22rem;
    padding: 1.5rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.96));
}

.qr-preview__canvas {
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: 1rem;
    border-radius: 24px;
}

.qr-preview__frame {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    text-align: center;
    font-weight: 700;
}

.qr-preview__actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

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

.meta-grid div {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(244, 247, 255, 0.94);
}

.field-panel {
    display: none;
}

.field-panel.is-visible {
    display: grid;
    gap: 1rem;
}

.public-generator {
    margin: 2rem 0;
}

.generator-shell {
    color: var(--surface-text);
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(112, 129, 255, 0.16);
}

.generator-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.generator-heading h2 {
    margin: 0.35rem 0 0.55rem;
    color: var(--surface-text);
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.8rem, 2vw, 2.5rem);
}

.generator-heading p {
    margin: 0;
    color: var(--muted);
}

.generator-badges {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.generator-badges span {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: #eef3ff;
    color: #4c67ff;
    font-size: 0.9rem;
    font-weight: 700;
}

.generator-tabs {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    border-radius: 24px;
    background: #f4f7ff;
    border: 1px solid #dbe4ff;
}

.generator-tab {
    padding: 0.95rem 1.1rem;
    border: 1px solid #d9e2ff;
    border-radius: 18px;
    background: #ffffff;
    color: #3a4a7a;
    cursor: pointer;
    font-weight: 700;
}

.generator-tab.is-active {
    color: #415af5;
    border-color: #aebeff;
    background: #ebf0ff;
}

.generator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
    gap: 1rem;
    margin-top: 1rem;
}

.generator-main {
    display: grid;
    gap: 1rem;
}

.generator-step.plain,
.generator-preview.plain {
    color: var(--surface-text);
    background: #ffffff;
    border-color: #dbe4ff;
    box-shadow: none;
}

.generator-step.plain input,
.generator-step.plain textarea,
.generator-step.plain select {
    color: var(--surface-text);
    background: #ffffff;
    border-color: #dbe4ff;
}

.generator-step.plain span,
.generator-preview.plain .muted {
    color: var(--muted);
}

.generator-panel {
    display: none;
}

.generator-panel.is-visible {
    display: grid;
    gap: 1rem;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.45rem;
    color: var(--surface-text);
}

.step-title span {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #4c67ff, #58c7ff);
    color: #ffffff;
    font-size: 1rem;
}

.design-toolbar,
.download-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.mini-chip {
    padding: 0.75rem 1rem;
    border: 1px solid #d9e2ff;
    border-radius: 14px;
    background: #ffffff;
    color: #3a4a7a;
    cursor: pointer;
    font-weight: 700;
}

.mini-chip.is-active {
    background: #ebf0ff;
    color: #415af5;
    border-color: #aebeff;
}

.generator-preview {
    align-self: start;
}

.public-preview {
    min-height: 25rem;
    background: linear-gradient(180deg, #ffffff, #f3f7ff);
    border: 1px solid #dbe4ff;
}

.public-preview .qr-preview__canvas {
    min-width: 100%;
}

code {
    padding: 0.18rem 0.45rem;
    border-radius: 8px;
    background: rgba(235, 240, 255, 0.95);
}

@media (max-width: 1024px) {
    .hero,
    .app-header,
    .dashboard-grid,
    .section-split,
    .qr-editor-grid,
    .qr-detail-grid,
    .generator-layout,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .panel-grid,
    .grid-3,
    .stats-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-bottom: 0;
    }
}

@media (max-width: 720px) {
    .topbar,
    .page-wrap,
    .app-main,
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .topbar,
    .site-footer,
    .nav-links,
    .button-row,
    .form-row,
    .generator-heading,
    .download-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .site-frame,
    .app-frame {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
