:root {
    --bg: #07111f;
    --bg-soft: #0d1b30;
    --panel: rgba(11, 26, 46, 0.82);
    --panel-strong: rgba(14, 32, 57, 0.96);
    --line: rgba(255,255,255,0.08);
    --text: #edf4ff;
    --muted: #9eb2d1;
    --primary: #7c5cff;
    --primary-strong: #5d3bff;
    --accent: #3dd9b4;
    --danger: #ff6f91;
    --warning: #ffc75f;
    --success: #42d392;
    --shadow: 0 24px 70px rgba(0,0,0,0.35);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max: 1180px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(124,92,255,0.22), transparent 32%),
        radial-gradient(circle at top right, rgba(61,217,180,0.16), transparent 28%),
        linear-gradient(180deg, #07111f 0%, #0a1730 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100%;
}

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

body.app-shell {
    position: relative;
    overflow-x: hidden;
}

.mobile-glow {
    position: fixed;
    border-radius: 999px;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}

.mobile-glow--1 {
    width: 280px;
    height: 280px;
    background: rgba(124, 92, 255, 0.3);
    top: -60px;
    left: -60px;
}

.mobile-glow--2 {
    width: 300px;
    height: 300px;
    background: rgba(61, 217, 180, 0.18);
    right: -80px;
    top: 25%;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(6, 15, 29, 0.65);
    border-bottom: 1px solid var(--line);
}

.topbar__inner,
.page-wrap {
    position: relative;
    z-index: 1;
}

.topbar__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #9e84ff);
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}

.brand__text {
    font-size: 0.95rem;
}

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

.nav-links a {
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 12px;
    transition: 0.2s ease;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}

.nav-links__cta {
    background: rgba(124,92,255,0.18);
    color: var(--text) !important;
}

.page-wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 20px 112px;
}

.hero-card,
.panel,
.auth-card,
.stat-card,
.recipe-card,
.inventory-card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card,
.panel,
.auth-card,
.stat-card {
    background: var(--panel);
    backdrop-filter: blur(20px);
}

.hero-card {
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel {
    border-radius: var(--radius-xl);
    padding: 22px;
}

.panel--nested {
    background: var(--panel-strong);
    box-shadow: none;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel__head--stack {
    align-items: stretch;
    flex-direction: column;
}

.auth-wrap {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    border-radius: 32px;
    padding: 30px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.02;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.lead {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 720px;
}

.auth-foot {
    margin-top: 18px;
    color: var(--muted);
}

.auth-foot a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.3);
}

.stack-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    padding: 14px 16px;
    border-radius: 14px;
    outline: none;
    transition: 0.2s ease;
}

input::placeholder {
    color: rgba(255,255,255,0.35);
}

input:focus {
    border-color: rgba(124, 92, 255, 0.75);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
}

.btn--block { width: 100%; }

.btn--ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.08);
}

.btn--small {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.stats-grid,
.content-grid,
.inventory-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.content-grid {
    grid-template-columns: 1.1fr 0.9fr;
}

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

.stat-card {
    border-radius: 24px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.stat-card__label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.card-list {
    display: grid;
    gap: 12px;
}

.recipe-card,
.inventory-card {
    border-radius: 20px;
    padding: 18px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recipe-card--soft {
    background: rgba(255, 199, 95, 0.08);
}

.recipe-card__title,
.inventory-card__title {
    font-weight: 700;
    font-size: 1rem;
}

.recipe-card__meta,
.inventory-card__meta {
    color: var(--muted);
    margin-top: 6px;
    font-size: 0.92rem;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-form input {
    flex: 1;
}

.empty-state {
    background: rgba(255,255,255,0.03);
    border-radius: 22px;
    border: 1px dashed rgba(255,255,255,0.10);
    padding: 24px;
    text-align: center;
}

.empty-state--large {
    padding: 42px 24px;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.alert--error {
    background: rgba(255,111,145,0.12);
    border-color: rgba(255,111,145,0.32);
}

.alert--success {
    background: rgba(66,211,146,0.12);
    border-color: rgba(66,211,146,0.32);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(92vw, 620px);
    background: rgba(8, 19, 36, 0.88);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 24px;
    display: none;
    justify-content: space-around;
    padding: 10px;
    z-index: 40;
    box-shadow: var(--shadow);
}

.bottom-nav a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 14px;
}

.bottom-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}

.recipe-detail__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
}

.pill--success { background: rgba(66,211,146,0.14); color: #90f1bf; }
.pill--warning { background: rgba(255,199,95,0.15); color: #ffd78d; }

.ingredient-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.ingredient-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.recipe-instructions {
    color: var(--muted);
    line-height: 1.8;
}

.missing-box {
    margin-top: 18px;
    background: rgba(255,199,95,0.07);
    border: 1px solid rgba(255,199,95,0.18);
    border-radius: 18px;
    padding: 16px;
}

.missing-box ul {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 980px) {
    .content-grid,
    .stats-grid,
    .inventory-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        flex-direction: column;
        align-items: start;
    }

    .nav-links {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }
}
