/* CrimptFit web — sistema de color "Carbón & Lima" (DEVELOPMENT.md §2).
   Los valores por defecto son los tokens del tema; al arrancar, la app aplica el tema
   elegido por el usuario (ColorThemes) sobre estas mismas variables. */
:root {
    --bg: #15171A;          /* CarbonBg */
    --surface: #1E2125;     /* Surface */
    --accent: #C6F432;      /* LimeAccent */
    --accent-dark: #7CB518; /* LimeDark */
    --on-accent: #15171A;   /* OnAccent */
    --text: #F4F6F7;        /* TextPrimary */
    --muted: #8A9099;       /* TextMuted */
    --border: #23262B;      /* Border */
    --tabbar-h: 62px;
    color-scheme: dark;
}

@font-face { font-family: Barlow; font-weight: 400; src: url('../fonts/BarlowRegular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 600; src: url('../fonts/BarlowSemiBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: Barlow; font-weight: 700; src: url('../fonts/BarlowBold.ttf') format('truetype'); font-display: swap; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-family: Barlow, system-ui, sans-serif; font-size: 15px; overscroll-behavior: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- Estructura ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.content { flex: 1; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.page { max-width: 640px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; }
.greeting { display: flex; flex-direction: column; gap: 1px; }

/* ---------- Barra de pestañas ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; justify-content: space-around;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tab.active { color: var(--accent); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card-lg { border-radius: 18px; gap: 10px; }
.card.nested { background: var(--bg); border-radius: 13px; padding: 13px; margin-top: 4px; }
.card.center { align-items: center; text-align: center; }
.card-title { margin: 0; font-size: 17px; font-weight: 700; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { align-items: center; text-align: center; gap: 4px; border-radius: 13px; font-size: 11px; font-weight: 600; }
.tile:active { border-color: var(--accent); }

/* ---------- Texto ---------- */
.label { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
span.label.muted { font-size: 11px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.small { font-size: 12px; }
.semibold { font-weight: 600; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }

/* ---------- Controles ---------- */
.btn-primary {
    width: 100%; margin-top: 6px; padding: 14px 28px; border: 0; border-radius: 14px;
    background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { filter: brightness(.92); }
.progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }

/* Icono SVG de línea coloreado con currentColor (máscara). */
.icon {
    display: inline-block; width: var(--size, 22px); height: var(--size, 22px); flex: none;
    background-color: currentColor;
    -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* ---------- Arranque y errores ---------- */
.splash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.splash svg { width: 96px; height: 96px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

#blazor-error-ui {
    display: none; position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px); z-index: 1000;
    padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid #E5484D; color: var(--text);
}
#blazor-error-ui .reload { color: var(--accent); font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; color: var(--muted); }
