:root {
    --paper: #f4efe6;
    --ink: #2a2318;
    --muted: #6d6458;
    --terracotta: #c45c26;
    --terracotta-dark: #9e4318;
    --sage: #4f6d57;
    --card: #fffdf8;
    --line: rgba(42, 35, 24, 0.12);
    --shadow: 0 18px 40px rgba(42, 35, 24, 0.08);
}

html,
body {
    min-height: 100%;
    color: var(--ink);
    font-family: "Source Sans 3", sans-serif;
}

body {
    background-color: #d7cbb8;
    background-image:
        linear-gradient(180deg, rgba(244, 239, 230, 0.72), rgba(244, 239, 230, 0.86)),
        url("../bakgrund.png");
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.is-auth {
    background-image:
        linear-gradient(180deg, rgba(244, 239, 230, 0.38), rgba(244, 239, 230, 0.58)),
        url("../bakgrund.png");
}

.is-auth .app-footer {
    display: none;
}

h1, h2, h3, h4, .navbar-brand, .recipe-card-title, .recipe-hero-title {
    font-family: Fraunces, serif;
}

a {
    color: var(--terracotta-dark);
}

.app-header {
    background: rgba(255, 253, 248, 0.88);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--ink);
}

.brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 1px 0 rgba(42, 35, 24, 0.08);
}

.brand-mark--lg {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
}

.brand-text {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.auth-brand {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: min(440px, 100%);
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    box-shadow: var(--shadow);
    padding: 2.2rem;
}

.nav-link {
    color: var(--ink) !important;
    font-weight: 500;
}

.kitchen-name,
.user-chip {
    font-size: 0.9rem;
    color: var(--muted);
}

.user-chip {
    background: #efe6d6;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    color: var(--ink);
}

.btn-primary,
.btn-primary:focus {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: #fff;
}

.btn-primary:hover {
    background: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
}

.btn-outline-dark {
    border-color: var(--line);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.is-auth .app-main > .alert {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, calc(100% - 2rem));
    z-index: 30;
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

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

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.2rem;
}

.filter-bar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.recipe-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease;
}

.recipe-card:hover {
    transform: translateY(-3px);
}

.recipe-card-link {
    color: inherit;
    text-decoration: none;
    display: block;
    height: 100%;
}

.recipe-card-image {
    height: 170px;
    background:
        linear-gradient(160deg, #e7d3b8, #d9c4a3 40%, #c9b496);
    position: relative;
    overflow: hidden;
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-cat {
    position: absolute;
    left: 0.8rem;
    bottom: 0.8rem;
    background: rgba(255, 253, 248, 0.92);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.recipe-card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.recipe-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.recipe-card-text {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: 1.2rem;
    padding: 3rem 1.5rem;
}

.recipe-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .recipe-layout,
    .page-hero {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

.recipe-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.3rem;
    padding: 1.4rem;
    box-shadow: var(--shadow);
}

.recipe-hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.1;
}

.recipe-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 1rem;
    background: #e7d3b8;
}

.meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
}

.meta-pills span {
    background: #efe6d6;
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font-size: 0.88rem;
}

.ingredient-list,
.step-list {
    padding-left: 1.1rem;
    margin: 0;
}

.ingredient-list li,
.step-list li {
    margin-bottom: 0.45rem;
}

.step-list li {
    padding-left: 0.2rem;
    margin-bottom: 0.8rem;
}

.form-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.3rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dynamic-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.dynamic-row .form-control {
    flex: 1;
}

.app-footer {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0 0 2rem;
}

.share-box,
.invite-box {
    background: #efe6d6;
    border-radius: 0.9rem;
    padding: 0.9rem;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.member-row:last-child {
    border-bottom: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: #d9a07a;
    box-shadow: 0 0 0 0.2rem rgba(196, 92, 38, 0.15);
}

.kitchen-switch .form-select {
    min-width: 10rem;
    background-color: #fffdf8;
}

.admin-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
}

.admin-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.admin-table td:last-child {
    white-space: nowrap;
    min-width: 15rem;
}

.recipe-panel,
.form-panel,
.filter-bar,
.empty-state,
.recipe-card {
    background: rgba(255, 253, 248, 0.94);
}

@media (max-width: 768px) {
    body,
    body.is-auth {
        background-attachment: scroll;
    }
}
