html {
  font-size: 14px;
}

:root {
  --ct-empty-favourite-color: #8a6500;
}

[data-bs-theme="dark"] {
  --ct-empty-favourite-color: #ffc107;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn-outline-warning {
  --bs-btn-color: var(--ct-empty-favourite-color);
  --bs-btn-border-color: var(--ct-empty-favourite-color);
  --bs-btn-hover-bg: #ffc107;
  --bs-btn-hover-border-color: #ffc107;
  --bs-btn-hover-color: #212529;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.content-page {
    max-width: 52rem;
}

.content-page h2 {
    margin-top: 2rem;
    font-size: 1.4rem;
}

.page-eyebrow {
    margin-bottom: .35rem;
    color: var(--bs-primary);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.content-card,
.faq-list details {
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-tertiary-bg);
}

.content-card h2 {
    margin-top: 0;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 700;
}

.faq-list details p {
    margin: 1rem 0 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.navbar-nav .nav-item {
    margin-right: 1.0rem;
}

.navbar-brand-mark {
    width: 2rem;
    height: 2rem;
    max-width: 2rem;
    max-height: 2rem;
    flex: 0 0 auto;
    object-fit: contain;
}

.navbar-nav .dropdown-toggle,
.navbar-nav .dropdown-toggle:hover,
.navbar-nav .dropdown-toggle:focus {
    color: var(--bs-navbar-color) !important;
}

    .navbar-nav .dropdown-toggle:hover,
    .navbar-nav .dropdown-toggle:focus {
        color: var(--bs-navbar-hover-color) !important;
    }

.food-actions-button {
    min-width: 2.25rem;
    font-weight: 700;
}

.capy-avatar {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.capy-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

    .capy-layer img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* =========================
   CAPY CUSTOMISATION
   ========================= */

.capy-customisation-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(500px, 1.6fr);
    gap: 3rem;
    align-items: start;
}

.capy-preview-panel {
    text-align: center;
    position: sticky;
    top: 2rem;
}

.capy-preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.capy-preview {
    width: min(100%, 380px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 24px;
    border: 2px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}


/* Inventory */

.capy-inventory {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.capy-inventory-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.75rem;
    min-height: 90px;
}

.capy-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bs-border-color);
    border-radius: 16px;
    background: var(--bs-tertiary-bg);
    padding: 0.75rem;
}

    .capy-category-icon img {
        width: 100%;
        height: 100%;
        max-width: 65px;
        max-height: 65px;
        object-fit: contain;
    }


/* Item row */

.capy-item-list {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    overflow-x: auto;
    padding: 0.6rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 16px;
    background: var(--bs-tertiary-bg);
}


/* Individual inventory item */

.capy-item-tile {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--bs-body-bg);
    overflow: hidden;
    cursor: default;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

    .capy-item-tile:hover {
        transform: translateY(-2px);
        border-color: var(--bs-primary);
    }

    .capy-item-tile img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.capy-empty-category {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    padding: 0 0.5rem;
}


/* Responsive */

@media (max-width: 900px) {

    .capy-customisation-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .capy-preview-panel {
        position: static;
    }

    .capy-preview {
        width: min(100%, 300px);
    }
}

@media (max-width: 600px) {

    .capy-inventory-row {
        grid-template-columns: 70px 1fr;
        min-height: 70px;
    }

    .capy-category-icon {
        border-radius: 12px;
        padding: 0.5rem;
    }

        .capy-category-icon img {
            max-width: 50px;
            max-height: 50px;
        }

    .capy-item-tile {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
        border-radius: 10px;
    }
}

.capy-item-tile {
    padding: 0;
    color: inherit;
}

    .capy-item-tile.is-equipped {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25), 0 3px 8px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }

    .capy-item-tile:disabled {
        opacity: 0.7;
    }

.capy-customisation-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.capy-secret-crown {
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

    .capy-secret-crown:hover {
        transform: scale(1.15) rotate(-5deg);
        filter: brightness(1.1);
    }

    .capy-secret-crown:last-child:hover {
        transform: scale(1.15) rotate(5deg);
    }

    .capy-secret-crown:active {
        transform: scale(0.9);
    }

.capy-unlock-message {
    width: fit-content;
    margin: 0.75rem auto 0;
}

.capy-item-locked {
    position: relative;
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.65);
}

    .capy-item-locked:hover {
        transform: none;
        border-color: var(--bs-border-color);
        box-shadow: none;
    }

.capy-lock-icon {
    position: absolute;
    right: 4px;
    bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
}

.capy-none-tile {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--bs-secondary-color);
}

    .capy-none-tile span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

/* =========================
   NAVBAR CAPY
   ========================= */

.navbar-capy {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .navbar-capy:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .navbar-capy .capy-avatar {
        width: 100%;
        height: 100%;
    }

    .navbar-capy .capy-layer {
        width: 100%;
        height: 100%;
    }

/* =========================
   THEME CUSTOMISATION
   ========================= */

.capy-theme-section {
    max-width: 840px;
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--bs-border-color);
}

.capy-theme-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.capy-theme-options {
    display: flex;
    gap: 0.75rem;
}

.capy-theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem;
    text-align: left;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .capy-theme-option:hover {
        transform: translateY(-2px);
        border-color: var(--bs-secondary-color);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

.capy-theme-option-title {
    font-weight: 700;
}

.capy-theme-option-description {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.capy-theme-option.is-selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.2);
}

    .capy-item-tile {
        cursor: pointer;
    }

    .capy-item-tile:hover:not(.is-equipped) {
        transform: translateY(-2px);
        border-color: var(--bs-secondary-color);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

/* =========================
   HOME DASHBOARD
   ========================= */

.dashboard-page {
    max-width: 980px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.dashboard-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-date {
    margin: 0.2rem 0 0;
    color: var(--bs-secondary-color);
}

.dashboard-setup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.35);
    border-radius: 20px;
    background: rgba(var(--bs-primary-rgb), 0.06);
}

    .dashboard-setup-card h2 {
        margin-bottom: 0.25rem;
        font-size: 1.15rem;
        font-weight: 700;
    }

    .dashboard-setup-card p {
        margin: 0;
        color: var(--bs-secondary-color);
    }

.dashboard-main-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 24px;
    background: var(--bs-tertiary-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.dashboard-calorie-section {
    min-width: 0;
}

.dashboard-eyebrow {
    margin-bottom: 0.35rem;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.dashboard-calorie-total {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.dashboard-calorie-current {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.dashboard-calorie-target {
    color: var(--bs-secondary-color);
    font-size: 1.15rem;
    font-weight: 600;
}

.dashboard-progress {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bs-secondary-bg);
}

.dashboard-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--bs-primary);
    transition: width 0.3s ease;
}

.dashboard-progress-details {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.65rem;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}

    .dashboard-progress-details strong {
        color: var(--bs-body-color);
    }

.dashboard-capy-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.dashboard-capy-frame {
    display: block;
    width: 170px;
    height: 170px;
    overflow: hidden;
    border: 2px solid var(--bs-border-color);
    border-radius: 24px;
    background: var(--bs-body-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .dashboard-capy-frame:hover {
        transform: translateY(-3px);
        border-color: var(--bs-primary);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }

    .dashboard-capy-frame .capy-avatar {
        width: 100%;
        height: 100%;
    }

.dashboard-capy-link {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

    .dashboard-capy-link:hover {
        color: var(--bs-primary);
    }

.dashboard-macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.dashboard-macro-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 18px;
    background: var(--bs-body-bg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .dashboard-macro-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 14px rgba(0, 0, 0, 0.07);
    }

.dashboard-macro-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 14px;
    background: var(--bs-tertiary-bg);
    font-weight: 800;
    color: #212529;
}

.dashboard-macro-card:nth-child(1) .dashboard-macro-icon {
    background: #f8cdd8;
}

.dashboard-macro-card:nth-child(2) .dashboard-macro-icon {
    background: #f8e3ad;
}

.dashboard-macro-card:nth-child(3) .dashboard-macro-icon {
    background: #cce8e3;
}

.dashboard-macro-label {
    display: block;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

.dashboard-macro-value {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.35rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.dashboard-action-primary {
    font-weight: 600;
}

@media (max-width: 700px) {

    .dashboard-main-card {
        grid-template-columns: 1fr;
    }

    .dashboard-capy-section {
        order: -1;
    }

    .dashboard-capy-frame {
        width: min(100%, 180px);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .dashboard-macro-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-progress-details {
        flex-direction: column;
        gap: 0.2rem;
    }

    .dashboard-setup-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-actions {
        flex-direction: column;
    }

        .dashboard-actions .btn {
            width: 100%;
        }
}

/* =========================
   LOGGED-OUT HOME
   ========================= */

.home-landing {
    max-width: 980px;
    margin: 2rem auto 0;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 3rem;
    align-items: center;
    padding: 3rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 28px;
    background: var(--bs-tertiary-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.home-hero-content {
    max-width: 600px;
}

.home-hero-eyebrow {
    margin-bottom: 0.65rem;
    color: var(--bs-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.home-hero-title {
    max-width: 580px;
    margin-bottom: 1rem;
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.home-hero-description {
    max-width: 560px;
    margin-bottom: 1.5rem;
    color: var(--bs-secondary-color);
    font-size: 1.05rem;
    line-height: 1.6;
}

.home-hero-actions {
    display: flex;
    gap: 0.75rem;
}

    .home-hero-actions .btn {
        padding-inline: 1.25rem;
        font-weight: 600;
    }

.home-hero-capy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.home-hero-capy-frame {
    position: relative;
    width: 230px;
    height: 230px;
    overflow: hidden;
    border: 2px solid var(--bs-border-color);
    border-radius: 28px;
    background: var(--bs-body-bg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .home-hero-capy-frame:hover {
        transform: translateY(-4px) rotate(1deg);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    }

.home-hero-capy-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-hero-capy-caption {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.home-feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.home-feature {
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 18px;
    background: var(--bs-body-bg);
}

    .home-feature strong {
        display: block;
        margin-bottom: 0.3rem;
        font-size: 0.95rem;
    }

    .home-feature span {
        color: var(--bs-secondary-color);
        font-size: 0.85rem;
        line-height: 1.45;
    }

@media (max-width: 700px) {

    .home-landing {
        margin-top: 1rem;
    }

    .home-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .home-hero-capy {
        order: -1;
    }

    .home-hero-capy-frame {
        width: min(100%, 200px);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .home-hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .home-feature-strip {
        grid-template-columns: 1fr;
    }

    .home-hero-actions {
        flex-direction: column;
    }

        .home-hero-actions .btn {
            width: 100%;
        }
}

/* Shared form treatment follows the existing card and theme palette. */
.form-shell {
    width: 100%;
    max-width: 48rem;
}

.account-form-shell {
    max-width: 30rem;
}

.form-section {
    position: relative;
    min-width: 0;
    margin-top: 2.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-tertiary-bg);
}

.form-section > legend {
    position: absolute;
    top: -2rem;
    left: 0;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bs-emphasis-color);
}

.form-section > .mb-3:last-child {
    margin-bottom: 0 !important;
}

.validation-summary-valid {
    display: none;
}

.validation-summary ul {
    margin-bottom: 0;
}
