/* =========================================================================
   Vitafit Training — sistemi vizual
   Mobile-first. Identiteti: lugëza e proteinës mbi errësirë palestre,
   me gëlqere elektrike si ngjyrë veprimi.
   ========================================================================= */

@font-face {
    font-family: Outfit;
    src: url('../fonts/outfit-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Outfit;
    src: url('../fonts/outfit-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Outfit;
    src: url('../fonts/outfit-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Outfit;
    src: url('../fonts/outfit-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Outfit;
    src: url('../fonts/outfit-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg:            #060807;
    --surface:       #121614;
    --surface-2:     #1A201C;
    --surface-solid: #101412;
    --border:        rgba(255, 255, 255, .09);
    --text:          #F3F6F0;
    --muted:         #A7AFA8;
    --accent:        #9BE500;
    --accent-ink:    #08100A;
    --accent-dim:    rgba(155, 229, 0, .14);
    --danger:        #FF6B70;
    --warn:          #FFB020;
    --info:          #6BB8E0;

    --radius:    18px;
    --radius-sm: 12px;
    --radius-lg: 26px;

    --shadow: 0 18px 40px rgba(0, 0, 0, .4);
    --glow:   0 8px 24px rgba(155, 229, 0, .22);
    --nav-height: 78px;
    --max-width: 560px;

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --font: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.006em;
    font-kerning: normal;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(820px 380px at 50% -12%, rgba(155, 229, 0, .11), transparent 62%),
        radial-gradient(480px 240px at 108% 12%, rgba(107, 184, 224, .06), transparent 70%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------- struktura */
#app {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--safe-top) + 16px) 18px calc(var(--nav-height) + var(--safe-bottom) + 18px);
    min-height: 100vh;
}

.app--fullscreen #app { padding-bottom: calc(var(--safe-bottom) + 24px); }

.stack   { display: grid; gap: 10px; }
.stack-l { display: grid; gap: 18px; }
.row     { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow    { flex: 1; min-width: 0; }
.center  { text-align: center; }

/* -------------------------------------------------------------------- logo */
.brand-mark {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, .4),
        0 0 0 1px rgba(255, 255, 255, .08),
        0 0 36px rgba(155, 229, 0, .22);
}
.brand-mark--lg { width: 96px; height: 96px; border-radius: 26px; margin: 0 auto; }
.brand-mark--sm {
    width: 40px; height: 40px; border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255,255,255,.08);
}

.wordmark {
    margin: 12px 0 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ------------------------------------------------------------------ tipografi */
h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.018em;
    text-wrap: balance;
}
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.022em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
p  { margin: 0; line-height: 1.62; letter-spacing: 0.008em; text-wrap: pretty; overflow-wrap: break-word; }

.muted     { color: var(--muted); }
.small     { font-size: 0.875rem; line-height: 1.5; letter-spacing: 0.008em; overflow-wrap: break-word; }
.tiny      { font-size: 0.78rem; line-height: 1.45; letter-spacing: 0.015em; }
.strong    { font-weight: 600; }
.accent    { color: var(--accent); }

.eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.page-title { margin-bottom: 2px; }
.page-head  { margin-bottom: 18px; }

/* ---------------------------------------------------------------- elementet */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 16px 15px;
}

.card--flat {
    background: var(--surface-2);
    border-color: transparent;
}

.card--hero {
    background:
        radial-gradient(120% 90% at 100% -20%, rgba(155, 229, 0, .16), transparent 52%),
        var(--surface);
    border-color: rgba(155, 229, 0, .2);
}

.card--action {
    width: 100%;
    text-align: left;
    transition: transform .12s ease, border-color .12s ease;
}
.card--action:active { transform: scale(.985); border-color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
    width: 100%;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    box-shadow: var(--glow);
    font-weight: 700;
    letter-spacing: 0.015em;
}
.btn--ghost   { background: transparent; }
.btn--danger  { color: var(--danger); }
.btn--sm      { padding: 9px 13px; font-size: 13px; width: auto; border-radius: 12px; }
.btn--inline  { width: auto; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.chip--on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--surface-2);
    color: var(--muted);
}
.badge--accent { background: var(--accent-dim); color: var(--accent); }
.badge--warn   { background: rgba(255, 176, 32, .14); color: var(--warn); }
.badge--info   { background: rgba(78, 168, 222, .14); color: var(--info); }

.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------------------------------------------------------------- formularet */
.field { display: grid; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }

.input {
    width: 100%;
    padding: 14px 15px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.option-grid { display: grid; gap: 10px; }
.option-grid--2 { grid-template-columns: 1fr 1fr; }

.option {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 15px 16px;
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.option:active { transform: scale(.985); }
.option--on {
    border-color: var(--opt-accent, var(--accent));
    background: color-mix(in srgb, var(--opt-accent, var(--accent)) 10%, var(--surface));
}
.option__swatch {
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 3px;
    border-radius: 99px;
    background: var(--opt-accent, var(--accent));
}
.option--has-swatch { padding-left: 18px; }
.option__title { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.option__sub   { font-size: 0.8rem; color: var(--muted); line-height: 1.45; letter-spacing: 0.01em; }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper__btn {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 22px;
    display: grid; place-items: center;
}
.stepper__value { flex: 1; text-align: center; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stepper__unit  { font-size: 0.9rem; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }

/* ------------------------------------------------------------- onboarding */
.welcome { padding-top: 5vh; }
.welcome__hero { text-align: center; display: grid; gap: 0; }
.welcome__hero h1 { margin-top: 10px; line-height: 1.25; }
.welcome__lead {
    max-width: 100%;
    margin: 10px auto 0;
    padding: 0 6px;
    font-size: 0.92rem;
    line-height: 1.6;
    letter-spacing: 0.008em;
    color: var(--muted);
}
.welcome__features { margin-top: 4px; }

.feature-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--accent-dim);
    color: var(--accent);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.feature-icon svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.progress-track {
    height: 4px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 22px;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width .3s ease;
    box-shadow: 0 0 12px rgba(155, 229, 0, .55);
}

.wizard-actions {
    position: sticky;
    bottom: calc(var(--safe-bottom) + 12px);
    display: flex;
    gap: 10px;
    padding-top: 16px;
}

/* ------------------------------------------------------------------- makro */
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.macro {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
}
.macro__value { font-size: 1.15rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.macro__label { font-size: 0.65rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.ring-wrap { display: grid; place-items: center; gap: 10px; }
.ring { transform: rotate(-90deg); }
.ring__bg   { stroke: rgba(255,255,255,.08); }
.ring__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; display: grid; place-items: center; text-align: center; }

/* ------------------------------------------------------------- lista vaktesh */
.meal { display: grid; gap: 8px; }
.meal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.meal__macros { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }

.ingredients { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ingredients li { font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------ dita e stervitjes */
.day-card { display: grid; gap: 10px; }
.day-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.day-card--rest { opacity: .62; }

.exercise-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.exercise-row:last-child { border-bottom: none; }

.swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 18px;
    flex-shrink: 0;
}
.swap-btn:active { color: var(--accent); border-color: var(--accent); }

.exercise-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--accent-dim);
    color: var(--accent);
    display: grid; place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}

.week {
    display: flex;
    gap: 6px;
}
.week__day { flex: 1; text-align: center; }
.week__dot {
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
}
.week__dot--today { border-color: var(--accent); color: var(--accent); }
.week__dot--done {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
.week__dot--rest { background: transparent; }

/* ------------------------------------------------------------ player i stervitjes */
.player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.set-row {
    display: grid;
    grid-template-columns: 34px 1fr 1fr 46px;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.set-row--done .set-row__index { background: var(--accent); color: var(--accent-ink); }

.set-row__index {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--surface-2);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700;
}

.set-input {
    padding: 11px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 16px;
    text-align: center;
    width: 100%;
    outline: none;
}
.set-input:focus { border-color: var(--accent); }

.set-check {
    width: 42px; height: 40px;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: grid; place-items: center;
    font-size: 15px;
}
.set-check--on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.rest-timer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--safe-bottom) + 16px);
    width: calc(min(100vw, var(--max-width)) - 32px);
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--glow);
    z-index: 60;
}
.rest-timer__time { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.done-mark {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto;
}
.done-mark .brand-mark { width: 96px; height: 96px; border-radius: 26px; }
.done-mark__check {
    position: absolute;
    right: -6px; bottom: -6px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid; place-items: center;
    font-weight: 800;
    box-shadow: 0 0 0 4px var(--bg);
}

/* ------------------------------------------------------------- suplementet */
.supp-card {
    background: linear-gradient(160deg, rgba(155, 229, 0, .12), rgba(155, 229, 0, .03));
    border: 1px solid rgba(155, 229, 0, .22);
    border-radius: var(--radius);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.product-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 4px;
}
.product-scroll::-webkit-scrollbar { display: none; }

.product {
    width: 138px;
    flex-shrink: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: grid;
    grid-template-rows: 100px auto;
}
.product__img {
    width: 100%; height: 100px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
}
.product__body { padding: 9px 10px 11px; display: grid; gap: 4px; }
.product__name {
    font-size: 0.75rem; line-height: 1.4; font-weight: 500; letter-spacing: 0.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product__price { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.01em; color: var(--accent); }
.product__was   { font-size: 0.7rem; color: var(--muted); text-decoration: line-through; }

/* -------------------------------------------------------------- navigimi */
.nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(10px + var(--safe-bottom));
    width: min(calc(100vw - 24px), calc(var(--max-width) - 24px));
    height: 64px;
    padding: 0;
    background: rgba(8, 12, 10, .88);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 22px;
    display: flex;
    z-index: 50;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.nav__inner {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 100%;
}
.nav__item {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.nav__item--on { color: var(--accent); }
.nav__icon { font-size: 19px; line-height: 1; }
.nav__svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav__item--on .nav__svg { filter: drop-shadow(0 0 6px rgba(155, 229, 0, .55)); }

.nav[hidden] { display: none !important; }
.app--fullscreen .nav { display: none !important; }

@media (max-width: 380px) {
    .nav { width: calc(100vw - 16px); border-radius: 18px; }
    .nav__svg { width: 20px; height: 20px; }
    .nav__item { font-size: 9px; }
}

/* ------------------------------------------------------------------ tjera */
.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .62);
    z-index: 70;
    display: grid;
    align-items: end;
    animation: fade .2s ease;
}
.sheet {
    background: var(--surface-solid);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--border);
    padding: 20px 16px calc(20px + var(--safe-bottom));
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    animation: slide-up .25s cubic-bezier(.2, .8, .2, 1);
    max-height: 88vh;
    overflow-y: auto;
}
.sheet__handle {
    width: 38px; height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: 0 auto 16px;
}
.howto {
    list-style: none;
    margin: 20px 0 8px;
    padding: 0;
    display: grid;
    gap: 14px;
}
.howto__step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
}
.howto__n {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 800;
    font-size: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
    background: #1A1F24;
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 11px 20px;
    font-size: 13.5px;
    font-weight: 600;
    z-index: 90;
    box-shadow: var(--shadow);
    animation: fade .2s ease;
}

.empty { text-align: center; padding: 40px 20px; display: grid; gap: 8px; }
.empty__icon { font-size: 34px; }

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius-sm);
    height: 72px;
}

.legal {
    font-size: 0.75rem;
    line-height: 1.55;
    letter-spacing: 0.015em;
    color: var(--muted);
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (min-width: 720px) {
    body { background: #040506; }
    #app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        background: transparent;
    }
}
