/* CSS custom properties */
:root {
    /* Palette */
    --blue-spruce: #136f63;
    --blue-spruce-dark: #0d4a42;
    --golden-glow: #e0ca3c;
    --blazing-flame: #f34213;
    --blazing-flame-dark: #a82d0d;

    /* Semantic colors */
    --color-bg: #f5f5f0;
    --color-surface: #fffef9;
    --color-text: #1a1a18;
    --color-text-muted: #5a5a55;
    --color-border: #8a9a90;
    --color-primary: var(--blue-spruce);
    --color-primary-dark: var(--blue-spruce-dark);
    --color-primary-hover: #0f5c52;
    --color-success: var(--blue-spruce);
    --color-warning: var(--golden-glow);
    --color-danger: var(--blazing-flame);
    --color-danger-dark: var(--blazing-flame-dark);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Other */
    --radius: 0.375rem;
    --shadow: 3px 3px 0 var(--color-border);

    /* Typography */
    --font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-family-heading: "Urbanist", system-ui, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
}

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

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}

h1, h2, h3, h4 {
    margin: 0 0 var(--space-md);
    line-height: 1.2;
    font-family: var(--font-family-heading);
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Sticky header container */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 0 var(--color-primary-dark);
}

/* Header and navigation */
.site-header {
    background-color: var(--color-danger);
    padding: var(--space-md) 0;
    box-shadow: 0 3px 0 var(--color-danger-dark);
    position: relative;
    z-index: 1;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.nav-brand {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: white;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-links a {
    color: white;
    padding: var(--space-xs) 0;
    opacity: 0.9;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: none;
}

.nav-links a[aria-current="page"] {
    opacity: 1;
    border-bottom: 2px solid white;
}

.nav-links {
    flex: 1;
}

.nav-goal {
    font-weight: 600;
    color: white;
    opacity: 0.9;
}

.nav-goal:hover {
    opacity: 1;
    text-decoration: none;
}

.nav-profile {
    color: white;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.nav-profile:hover {
    opacity: 1;
}

.nav-profile[aria-current="page"] {
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    padding-bottom: calc(var(--space-xl) + 70px);
    background-color: var(--color-bg);
    min-height: 100vh;
}

/* Alerts */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.alert-success {
    background-color: rgba(19, 111, 99, 0.1);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-success);
}

.alert-error {
    background-color: rgba(243, 66, 19, 0.1);
    color: var(--color-danger-dark);
    border: 1px solid var(--color-danger);
}

.alert ul {
    padding-left: var(--space-lg);
    list-style: disc;
}

.alert-undo {
    flex-shrink: 0;
}

.alert-undo__btn {
    background: none;
    border: none;
    color: var(--color-primary-dark);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: var(--font-size-base);
    padding: 0;
}

.alert-undo__btn:hover {
    color: var(--color-primary);
}

/* Cards */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    padding: clamp(1rem, 4vw, var(--space-lg));
    margin-bottom: var(--space-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--color-primary);
}

/* Grid layouts */
.grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.grid .card {
    margin-bottom: 0;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

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

.btn-secondary {
    background-color: #5a6a60;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a5a50;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #d63510;
}

.btn-small {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
}

.btn-icon {
    padding: var(--space-xs);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--color-text);
}

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-primary);
    padding: var(--space-sm);
    display: flex;
    gap: var(--space-sm);
    z-index: 100;
}

@media (min-width: 640px) {
    .bottom-nav {
        padding: var(--space-sm) var(--space-lg);
    }
}

.bottom-nav .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: var(--space-sm) var(--space-xs);
    font-size: var(--font-size-sm);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.bottom-nav .btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.bottom-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}


/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    background-color: #fff;
    color: var(--color-text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.4);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Radio group for category selection */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.radio-option {
    position: relative;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-option label {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background-color: #fff;
}

.radio-option label:hover {
    border-color: var(--color-primary);
}

.radio-option input:checked + label {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.radio-option input:focus + label {
    box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.4);
}

/* Radio label for profile form */
.radio-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-xs) 0;
}

.radio-label input[type="radio"] {
    margin-top: 0.25em;
    accent-color: var(--color-primary);
}

.radio-label span {
    display: flex;
    flex-direction: column;
}

.radio-label .form-hint {
    margin-top: 0;
}

.radio-group-vertical {
    flex-direction: column;
    gap: var(--space-xs);
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Food search */
.food-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: var(--space-xs);
    background: white;
    display: none;
}

.food-search-results.active {
    display: block;
}

.food-search-results:empty {
    display: none;
}

.food-search-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    border-bottom: 1px solid var(--color-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.food-search-item:last-child {
    border-bottom: none;
}

.food-search-item:hover,
.food-search-item:focus {
    background-color: var(--color-bg);
}

.food-search-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.food-search-item-kcal {
    font-weight: 600;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

/* Food quantity selector */
.food-quantity-row {
    display: flex;
    gap: var(--space-sm);
}

.food-amount-input {
    width: 80px;
    flex-shrink: 0;
}

.food-unit-select {
    flex: 1;
    min-width: 0;
}

.food-kcal-hint {
    margin-top: var(--space-xs);
}

/* Food macros */
.food-macros-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.food-macro-input {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.food-macro-input .form-input {
    text-align: center;
}

.food-macro-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Manual macro input toggle */
.food-macros-manual {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0;
}

.food-macros-toggle {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    list-style: none;
}

.food-macros-toggle::-webkit-details-marker {
    display: none;
}

.food-macros-toggle::before {
    content: "+ ";
}

.food-macros-manual[open] .food-macros-toggle::before {
    content: "− ";
}

.food-macros-manual[open] .food-macros-toggle {
    border-bottom: 1px solid var(--color-border);
}

.food-macros-manual .food-macros-inputs {
    padding: var(--space-md);
}

.food-macros-manual .food-macro-input {
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
}

.food-macros-manual .food-macro-label {
    font-weight: 500;
    white-space: nowrap;
}

.food-macros-manual .form-input {
    flex: 1;
}

.food-macro-unit {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Macros summary on dashboard */
.macros-summary {
    margin-top: var(--space-md);
}

.macros-bar {
    height: 0.5rem;
    background-color: var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
}

.macros-bar__protein {
    background-color: #4a90d9;
    height: 100%;
}

.macros-bar__carbs {
    background-color: #e0ca3c;
    height: 100%;
}

.macros-bar__fat {
    background-color: #e07070;
    height: 100%;
}

.macros-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    justify-content: center;
}

.macros-legend__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.macros-legend__dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.macros-legend__item--protein .macros-legend__dot {
    background-color: #4a90d9;
}

.macros-legend__item--carbs .macros-legend__dot {
    background-color: #e0ca3c;
}

.macros-legend__item--fat .macros-legend__dot {
    background-color: #e07070;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-md);
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
}

.lightbox__close:hover {
    opacity: 0.7;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1000;
}

.modal {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-lg);
}

/* Fullscreen modal on small screens */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 0;
        background-color: var(--color-surface);
    }

    .modal {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        flex-shrink: 0;
        padding: var(--space-sm) var(--space-lg);
        position: sticky;
        top: 0;
        background-color: var(--color-surface);
        z-index: 1;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: calc(var(--space-lg) + 60px);
    }

    .modal-body .form-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--color-surface);
        padding: var(--space-md) var(--space-lg);
        border-top: 1px solid var(--color-border);
        margin: 0;
    }
}

/* Stats display */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.stat-positive {
    color: var(--color-primary-dark);
}

.stat-negative {
    color: var(--color-danger-dark);
}

/* Progress bar */
.progress {
    height: 1rem;
    background-color: var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--color-primary);
    transition: width 0.3s;
}

.progress-bar.over {
    background-color: var(--color-danger);
}

/* Category breakdown */
.category-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.category-row:last-child {
    border-bottom: none;
}

.category-name {
    font-weight: 500;
}

.category-entries {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.category-total {
    font-weight: 600;
}

/* Entry list */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-left: var(--space-lg);
    font-size: var(--font-size-sm);
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.entry-note {
    color: var(--color-text-muted);
    flex: 1;
}

.entry-amount {
    opacity: 0.7;
    font-size: var(--font-size-sm);
}

.entry-calories {
    font-weight: 500;
}

/* History table */
.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.history-day {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.history-day-header {
    display: grid;
    grid-template-columns: 120px 1fr 1fr 1fr 80px;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    align-items: center;
    cursor: pointer;
}

.history-day-header:hover {
    background-color: var(--color-bg);
}

.history-day-date {
    font-weight: 600;
}

.history-day-details {
    padding: var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: none;
}

.history-day.expanded .history-day-details {
    display: block;
}

/* Weight chart container */
.chart-container {
    height: 250px;
    position: relative;
}

/* Daily note */
.daily-note {
    background-color: rgba(224, 202, 60, 0.15);
    border: 1px solid var(--color-warning);
    padding: var(--space-md);
    border-radius: var(--radius);
    margin-top: var(--space-md);
}

.daily-note-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

/* Date navigation */
.date-nav-wrapper {
    background-color: var(--color-primary);
}

.date-nav {
    display: flex;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

.date-nav-btn {
    background: none;
    border: none;
    font-size: var(--font-size-base);
    color: white;
    cursor: pointer;
    padding: var(--space-sm) var(--space-lg);
    text-decoration: none;
    flex: 1;
    display: flex;
    align-items: center;
}

.date-nav-btn:first-child {
    justify-content: flex-start;
}

.date-nav-btn:last-child {
    justify-content: flex-end;
}

.date-nav-btn:hover {
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
}

.date-nav-current {
    font-size: var(--font-size-base);
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    white-space: nowrap;
    color: white;
}

/* Keyboard hints */
.kbd {
    display: inline-block;
    padding: 0.125em 0.5em;
    font-family: monospace;
    font-size: 0.75em;
    font-weight: 400;
    line-height: inherit;
    color: inherit;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.25em;
    box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.3), 0 0.15em 0.2em rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    margin-left: 0.5em;
    transform: translateY(-0.05em);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    background-color: var(--color-success);
    color: white;
    border-radius: var(--radius);
    vertical-align: middle;
    margin-left: var(--space-sm);
}

/* Goal active state */
.goal-active {
    /* border-left: 4px solid var(--color-success); */
}

/* Goal list */
.goal-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav {
        gap: var(--space-md);
    }

    .nav-links {
        gap: var(--space-md);
    }

    .history-day-header {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .bottom-nav .kbd {
        display: none;
    }
}

/* ==========================================================================
   Components - Landing page
   ========================================================================== */

.c-landing {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    min-height: 100vh;
}

/* Hero */
.c-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 4rem 1.5rem;
    text-align: center;
}

.c-hero__content {
    max-width: 540px;
}

.c-hero__title {
    font-size: 5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 1.5rem;
    line-height: 1;
    font-family: var(--font-family-heading);
    text-shadow: 3px 3px 0 var(--color-primary-dark);
}

.c-hero__tagline {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 2.5rem;
    line-height: 1.5;
}

.c-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.c-hero .btn-primary {
    background-color: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
    box-shadow: 3px 3px 0 var(--color-danger-dark);
}

.c-hero .btn-primary:hover {
    background-color: var(--color-danger-dark);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

.c-hero__login-link {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.c-hero__login-link:hover {
    color: white;
    text-decoration: underline;
}

/* Features */
.c-features {
    background-color: var(--color-bg);
    padding: 5rem 1.5rem;
}

.c-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.c-feature {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.c-feature__icon {
    width: 48px;
    height: 48px;
    background-color: var(--color-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.c-feature__icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.c-feature__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.75rem;
    font-family: var(--font-family-heading);
}

.c-feature__desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* CTA section */
.c-cta {
    background-color: var(--color-primary);
    padding: 5rem 1.5rem;
    text-align: center;
}

.c-cta__title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 1rem;
    font-family: var(--font-family-heading);
}

.c-cta__desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem;
}

.c-cta .btn-primary {
    background-color: white;
    color: var(--color-primary);
    border-color: white;
    box-shadow: 3px 3px 0 var(--color-primary-dark);
}

.c-cta .btn-primary:hover {
    background-color: var(--color-bg);
}

/* Landing Footer */
.c-landing-footer {
    background-color: var(--color-text);
    padding: 3rem 1.5rem 2rem;
    color: var(--color-bg);
}

.c-landing-footer__content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.c-landing-footer__brand p {
    margin: 0.5rem 0 0;
    color: rgba(245, 245, 240, 0.7);
    font-size: 0.9rem;
}

.c-landing-footer__logo {
    font-family: var(--font-family-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-bg);
}

.c-landing-footer__links {
    display: flex;
    gap: 2rem;
}

.c-landing-footer__links a {
    color: rgba(245, 245, 240, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
}

.c-landing-footer__links a:hover {
    color: var(--color-bg);
}

.c-landing-footer__bottom {
    max-width: 1000px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(245, 245, 240, 0.15);
    text-align: center;
}

.c-landing-footer__bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(245, 245, 240, 0.5);
}

.c-landing-footer__bottom a {
    color: rgba(245, 245, 240, 0.7);
    text-decoration: none;
}

.c-landing-footer__bottom a:hover {
    color: var(--color-bg);
}

@media (min-width: 640px) {
    .c-landing-footer__content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .c-hero__title {
        font-size: 6rem;
    }
}

/* ==========================================================================
   Components - Login/Register
   ========================================================================== */

.c-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.c-login__card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.c-login__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 1.5rem;
    font-family: var(--font-family-heading);
}

.c-login__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.c-login__field {
    text-align: left;
}

.c-login__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.c-login__input {
    width: 100%;
}

.c-login__submit {
    width: 100%;
}

.c-login__error {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.c-login__success {
    color: var(--color-success);
    font-size: 0.875rem;
    padding: 0.75rem;
    background-color: rgba(19, 111, 99, 0.1);
    border: 1px solid var(--color-success);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.c-login__welcome {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.c-login__back {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.c-login__back:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.c-login__cta {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-bg);
    border-radius: var(--radius);
}

.c-login__cta p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

.c-login__cta-btn {
    width: 100%;
}

.c-login__options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.c-login__remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.c-login__remember input[type="checkbox"] {
    accent-color: var(--color-primary);
}

.c-login__divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.c-login__divider::before,
.c-login__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
}

/* Password strength indicator */
.c-password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.c-password-strength__bar {
    flex: 1;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.c-password-strength__fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.c-password-strength__label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* ==========================================================================
   Components - Error Pages (404, 403)
   ========================================================================== */

.c-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    text-align: center;
}

.c-error__logo {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    font-family: var(--font-family-heading);
}

.c-error__logo:hover {
    text-decoration: none;
}

.c-error__content {
    max-width: 400px;
}

.c-error__illustration {
    width: 150px;
    height: auto;
    margin-bottom: 1.5rem;
}

.c-error__code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 0.5rem;
    line-height: 1;
    font-family: var(--font-family-heading);
}

.c-error__message {
    font-size: 1.25rem;
    color: var(--color-text);
    margin: 0 0 0.5rem;
}

.c-error__hint {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 2rem;
}

@media (min-width: 768px) {
    .c-error__illustration {
        width: 180px;
    }

    .c-error__code {
        font-size: 6rem;
    }

    .c-error__message {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   Components - Progress Photos
   ========================================================================== */

.progress-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.progress-photos--single {
    grid-template-columns: 1fr;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.progress-photo {
    margin: 0;
    text-align: center;
}

.progress-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--color-border);
}

.progress-photo figcaption {
    margin-top: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.progress-photo__delete {
    display: inline;
}

/* ==========================================================================
   Components - Profile Layout
   ========================================================================== */

.profile-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.profile-sidebar {
    align-self: flex-start;
}

@media (min-width: 900px) {
    .profile-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .profile-layout > .card:first-child {
        flex: 1;
    }

    .profile-sidebar {
        width: 320px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   Admin - Monokrom theme
   ========================================================================== */

body.is-admin {
    --color-bg: #2e3138;
    --color-surface: #3d414a;
    --color-surface-hover: #4d515c;
    --color-primary: #ccc9e7;
    --color-primary-dark: #a8a5c7;
    --color-primary-hover: #e0def5;
    --color-text: #e8e6f0;
    --color-text-muted: #9a98a8;
    --color-success: #a0c4a0;
    --color-border: #6c6f7d;
    --color-focus: #ccc9e7;
    --color-danger: #e07070;
    --color-danger-dark: #b85555;
}

body.is-admin .site-header {
    background-color: #252830;
    box-shadow: 0 3px 0 #1a1c22;
}

body.is-admin .date-nav-wrapper {
    background-color: #3d414a;
    box-shadow: 0 2px 0 #2e3138;
}

body.is-admin .bottom-nav {
    background-color: #252830;
}

/* ==========================================================================
   Admin components
   ========================================================================== */

.c-admin__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.c-admin__stat {
    background-color: var(--color-surface);
    border-radius: var(--radius);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid var(--color-border);
}

.c-admin__stat-value {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    font-family: var(--font-family-heading);
    color: var(--color-primary);
}

.c-admin__stat-label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.c-admin__search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.c-admin__search .form-input {
    flex: 1;
}

.c-admin__user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.c-admin__user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-md);
}

.c-admin__user-item:last-child {
    border-bottom: none;
}

.c-admin__user-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
}

.c-admin__user-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.c-admin__user-email {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.c-admin__user-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.c-admin__user-goals {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.c-admin__user-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.c-admin__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--color-border);
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.c-admin__badge--admin {
    background-color: var(--color-primary);
    color: #1a1c22;
}

.c-admin__pagination {
    margin-top: var(--space-lg);
    display: flex;
    justify-content: center;
}

.c-admin__pagination nav {
    display: flex;
    gap: var(--space-xs);
}

.c-admin__pagination a,
.c-admin__pagination span {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
}

.c-admin__pagination a {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
}

.c-admin__pagination a:hover {
    background-color: var(--color-surface-hover);
    text-decoration: none;
}

/* ==========================================================================
   Onboarding notices
   ========================================================================== */

/* Dashboard header */
.text-accent {
    color: var(--color-danger);
}

.dashboard-header {
    margin-bottom: var(--space-lg);
}

.dashboard-header h1 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
}

.onboarding-notices {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.onboarding-notice {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background-color: rgba(243, 66, 19, 0.1);
    border: 2px solid var(--color-danger);
    border-radius: var(--radius);
    color: var(--color-text);
}

.onboarding-notice__content {
    flex: 1;
}

.onboarding-notice__content strong {
    display: block;
    margin-bottom: var(--space-xs);
}

.onboarding-notice__content p {
    margin: 0;
    font-size: var(--font-size-sm);
    opacity: 0.85;
}

.onboarding-notice .btn {
    align-self: flex-start;
    white-space: nowrap;
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

.onboarding-notice .btn:hover {
    background-color: var(--color-danger-dark);
    border-color: var(--color-danger-dark);
}

@media (min-width: 640px) {
    .onboarding-notice {
        flex-direction: row;
        align-items: center;
    }

    .onboarding-notice .btn {
        align-self: center;
    }
}
