:root {
    --brand: #4CAF50;
    --brand-dark: #2f8f35;
    --brand-accent: #2dd4bf;
    --bg: #f6f7fb;
    --text: #0f172a;
    --muted: #64748b;
    --card: #ffffff;
    --border: rgba(15, 23, 42, 0.12);
    --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
    --shadow-soft: 0 3px 10px rgba(2, 6, 23, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background:
        radial-gradient(1200px 500px at 15% 0%, rgba(45, 212, 191, 0.18), transparent 60%),
        radial-gradient(900px 450px at 85% 10%, rgba(76, 175, 80, 0.18), transparent 50%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--brand), var(--brand-accent));
    color: white;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.28);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-image {
    height: 48px;
    width: auto;
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.18s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    font-weight: 700;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    padding-inline: 12px;
}

.auth-btn:hover {
    background: #fff;
}

.auth-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.38);
}

.auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.page-back {
    padding-top: 0;
    padding-bottom: 26px;
    display: flex;
    justify-content: center;
}

.bottom-back-btn {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text);
    border-color: rgba(15, 23, 42, 0.16);
}

.bottom-back-btn:hover {
    background: rgba(15, 23, 42, 0.14);
}

.hero-header {
    text-align: center;
    padding: 16px 16px 8px;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3.2vw, 2.2rem);
    letter-spacing: -0.02em;
}

.hero-logo {
    width: min(700px, 100%);
    height: auto;
    display: block;
    margin: 0 auto;
}

.hero-header p {
    margin: 10px 0 0;
    opacity: 0.95;
}

.center-text {
    text-align: center;
}

.team-section {
    margin-top: 18px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
    align-items: stretch;
}

.team-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-soft);
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 220px;
}

.team-card h3 {
    margin: 6px 0 0;
    font-size: 1.02rem;
}

.team-card p {
    margin: 0;
}

.team-photo {
    width: 96px;
    height: 96px;
    margin: 0 auto;
    border-radius: 999px;
    border: 1px dashed rgba(15, 23, 42, 0.28);
    background: rgba(15, 23, 42, 0.06);
    display: grid;
    place-items: center;
    color: rgba(15, 23, 42, 0.65);
    font-weight: 600;
    user-select: none;
    flex: 0 0 auto;
    overflow: hidden;
}

.team-photo img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 900px) {
    /* With 5 team cards, center the last row (2 cards) */
    .team-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .team-card {
        grid-column: span 2;
    }

    .team-card:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .team-card:nth-child(5) {
        grid-column: 4 / span 2;
    }
}

.muted {
    color: var(--muted);
}

.flash {
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    text-align: left;
}

.flash p {
    margin: 0;
}

.flash p + p {
    margin-top: 6px;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.flash-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #15803d;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    background: #fff;
}

.form-group input:focus {
    border-color: rgba(45, 212, 191, 0.6);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18);
}

.password-rules {
    list-style: none;
    padding: 8px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    font-size: 0.85rem;
}

.password-rules li {
    color: var(--muted);
}

.password-rules li::before {
    content: '✗ ';
}

.password-rules li.rule-pass {
    color: #15803d;
}

.password-rules li.rule-pass::before {
    content: '✓ ';
}

.password-rules li.rule-fail {
    color: #b91c1c;
}

.confirm-msg {
    font-size: 0.85rem;
    margin: 4px 0 0;
}

.confirm-ok {
    color: #15803d;
}

.confirm-err {
    color: #b91c1c;
}

.avatar-wrap {
    position: relative;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #fff;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 1rem;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,0.8);
    user-select: none;
}

.avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 120px;
    z-index: 100;
}

.avatar-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
}

.avatar-dropdown a:hover {
    background: rgba(15, 23, 42, 0.05);
}

.avatar-wrap:hover .avatar-dropdown {
    display: block;
}

.avatar-large {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    margin: 0 auto;
    border: 3px solid var(--border);
    color: #fff;
    background: var(--brand);
}

.avatar-dropdown-name {
    display: block;
    padding: 10px 16px 6px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

.center {
    text-align: center;
}

.hero {
    padding-top: 38px;
}

.card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-card {
    max-width: 720px;
    margin: 0 auto;
}

/* Home: four full-width PNGs stacked; CTA card sits on first image */
.home-page-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.home-svg-banner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
}

.home-graphic-hero {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.home-graphic-hero-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    flex-shrink: 0;
}

.home-graphic-hero-panel {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 36px);
    pointer-events: none;
}

.home-graphic-hero-panel .card {
    pointer-events: auto;
}

/* Third banner: CTA on notepad (left half), below baked-in copy */
.home-graphic-planner {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.home-graphic-planner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    flex-shrink: 0;
}

.home-graphic-planner-panel {
    position: absolute;
    left: calc(3% + 6px);
    width: 48%;
    top: 64%;
    bottom: 4%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 clamp(12px, 3vw, 22px);
    box-sizing: border-box;
    pointer-events: none;
}

.home-graphic-planner-panel .btn {
    pointer-events: auto;
    text-align: center;
    max-width: 100%;
}

/* flex-shrink: 0 — avoid flex column squishing tall graphics */
.home-svg-banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    flex-shrink: 0;
}

a.btn,
button {
    font-family: inherit;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

button {
    background: var(--brand);
    color: #fff;
    margin: 0;
}

button:hover {
    background: var(--brand-dark);
}

button:active {
    transform: translateY(1px);
}

button:focus-visible,
a.btn:focus-visible {
    outline: 3px solid rgba(45, 212, 191, 0.35);
    outline-offset: 2px;
}

a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--brand);
    color: #fff;
    border-color: rgba(0, 0, 0, 0.05);
}

a.btn:hover {
    background: var(--brand-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
}

.field-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

#ingredientInput {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1rem;
    outline: none;
}

#ingredientInput:focus {
    border-color: rgba(45, 212, 191, 0.6);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18);
}

.actions {
    margin-top: 16px;
}

#ingredientList {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.16);
}

.ingredient-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-btn {
    opacity: 0;
    cursor: pointer;
    color: #3f3f46;
    font-size: 12px;
    transition: opacity 0.2s ease;
    user-select: none;
}

.ingredient-item:hover .delete-btn {
    opacity: 1;
}

#recipeDetail {
    padding: 24px 16px;
}

.recipe-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

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

.recipe-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin-top: 10px;
}

.recipe-card h3 {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.3;
}

.recipe-detail-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    max-width: 860px;
    margin: 0 auto;
}

.recipe-detail-card img {
    border-radius: 14px;
    display: block;
    margin-bottom: 18px;
    width: 100%;
    max-width: 640px;
}

.recipe-detail-card h2 {
    margin: 18px 0 10px;
    font-size: 1.25rem;
}

.recipe-detail-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recipe-detail-card li {
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
}

.recipe-detail-card p {
    line-height: 1.8;
    white-space: pre-line;
    margin: 0;
}

.results-sections {
    /*display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;*/
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

.results-column {
    /*display: flex;
    flex-direction: column;
    gap: 16px;*/
    width: 100%
}

.results-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 20px;
    justify-content: start;
}

@media (max-width: 900px) {
    .recipe-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 600px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .nav-actions {
        width: 100%;
        margin-left: 0;
    }

    .field-row {
        flex-direction: column;
        align-items: stretch;
    }

    a.btn,
    button {
        width: 100%;
    }

    #recipeResults {
        padding: 16px;
    }
}