/* ============================================================
   Momentum — estilo mobile-first, minimalista (Nike-like)
   ============================================================ */

:root {
    --black: #111111;
    --white: #ffffff;
    --grey-50: #f6f6f6;
    --grey-100: #ededed;
    --grey-200: #e2e2e2;
    --grey-400: #b0b0b0;
    --grey-600: #6b6b6b;
    --accent: #d7ff00;          /* volt */
    --accent-ink: #111111;
    --danger: #e63946;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    --maxw: 720px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--black);
    background: var(--white);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- App bar ---------- */
.appbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--black);
    color: var(--white);
}
.appbar__brand {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 20px;
    text-transform: uppercase;
}
.appbar__logout { display: flex; }
.icon-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    line-height: 1;
    padding: 6px;
}

/* ---------- Layout ---------- */
.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 18px calc(40px + var(--safe-bottom));
}

/* ---------- Page head (dashboard) ---------- */
.page-head { margin: 12px 0 26px; }
.page-head__hello { color: var(--grey-600); font-weight: 500; }
.page-head__title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

/* ---------- Menu grid (dashboard) ---------- */
.menu-grid { display: grid; gap: 14px; }
.menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--grey-50);
    border-radius: var(--radius);
    transition: transform .15s ease, background .15s ease;
}
.menu-card:active { transform: scale(.98); }
.menu-card__icon { font-size: 30px; }
.menu-card__text { display: flex; flex-direction: column; flex: 1; }
.menu-card__title { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.menu-card__subtitle { color: var(--grey-600); font-size: 14px; }
.menu-card__arrow { font-size: 22px; font-weight: 700; }
.menu-card--soon { opacity: .55; pointer-events: none; }
.badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--grey-200);
    color: var(--grey-600);
    padding: 4px 8px;
    border-radius: 999px;
}

/* ---------- Toolbar (secciones) ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}
.toolbar__title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    flex: 1;
    text-align: center;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: var(--black);
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 18px;
    border-radius: 999px;
    min-height: 44px;
    transition: transform .12s ease, opacity .12s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--black); border: 1.5px solid var(--grey-200); }
.btn--danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); padding: 10px 16px; min-height: 40px; }
.btn--block { width: 100%; }

/* ---------- Card grid (entrenos) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.wcard {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--grey-50);
    transition: transform .15s ease;
}
.wcard:active { transform: scale(.98); }
.wcard__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--grey-100);
}
.wcard__media img { width: 100%; height: 100%; object-fit: cover; }
.wcard__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px; opacity: .35;
}
.wcard__count {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.wcard__body { padding: 12px 14px 16px; }
.wcard__name { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.wcard__days { color: var(--grey-600); font-size: 13px; font-weight: 600; margin-top: 2px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; }
.empty__icon { font-size: 56px; opacity: .4; }
.empty__text { color: var(--grey-600); margin: 12px 0 20px; font-size: 16px; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 700; font-size: 14px; }
.field input[type="text"],
.field input[type="password"] {
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 16px;
    background: var(--white);
    transition: border-color .15s ease;
}
.field input:focus {
    outline: none;
    border-color: var(--black);
}

/* ---------- Días ---------- */
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.day { position: relative; }
.day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.day span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--grey-200);
    font-weight: 700;
    font-size: 13px;
    transition: all .12s ease;
}
.day input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

/* ---------- Uploader ---------- */
.uploader {
    position: relative;
    border: 2px dashed var(--grey-200);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.uploader input[type="file"] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
}
.uploader__hint {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--grey-600); font-weight: 600;
}
.uploader__icon { font-size: 30px; }
.uploader__preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.uploader__preview:empty { margin-top: 0; }
.uploader__preview img {
    aspect-ratio: 1/1; object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ---------- Galería (edit) ---------- */
.gallery-section { margin-top: 36px; }
.section-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.muted { color: var(--grey-400); font-weight: 600; }
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.gallery__item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--grey-100);
}
.gallery__item.is-cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery__tag {
    position: absolute; top: 6px; left: 6px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    padding: 3px 7px; border-radius: 999px;
}
.gallery__actions {
    position: absolute; bottom: 6px; right: 6px;
    display: flex; gap: 6px;
}
.chip {
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.chip--danger { color: var(--danger); }

/* ---------- Alertas ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 18px;
}
.alert--ok { background: #eafff0; color: #137a3c; }
.alert--err { background: #ffeaea; color: #b3241c; }

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    padding: 24px;
}
.login {
    width: 100%;
    max-width: 360px;
    background: var(--white);
    border-radius: 22px;
    padding: 32px 26px;
    box-shadow: var(--shadow);
}
.login__head { text-align: center; margin-bottom: 26px; }
.login__brand {
    font-size: 32px; font-weight: 900;
    letter-spacing: -0.03em; text-transform: uppercase;
}
.login__tag { color: var(--grey-600); font-weight: 500; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.92);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox__close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,.15); color: #fff;
    border: none; width: 44px; height: 44px;
    border-radius: 50%; font-size: 20px;
}

/* ---------- Escritorio ---------- */
@media (min-width: 640px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery { grid-template-columns: repeat(4, 1fr); }
    .uploader__preview { grid-template-columns: repeat(5, 1fr); }
}
