/* =========================================================================
   Base visual de BarbersClub
   Todo sale de las variables --bc-* que arma Peluqueria.Shared/Apariencia/Tema.cs
   para cada local y que sirve api/tenant/tema.css (se carga antes que Blazor).
   Los valores de acá son los de Platinum Atelier, por si esa hoja no llega;
   van en :where(:root) para que la hoja del local siempre les gane.
   Este archivo se carga después de MudBlazor, así no hacen falta !important.
   ========================================================================= */

:where(:root) {
    --bc-bg: #f6f6f4;
    --bc-surface: #ffffff;
    --bc-surface-2: #ececea;
    --bc-text: #141414;
    --bc-text-muted: #62625f;
    --bc-line: #e2e2de;
    --bc-accent: #111111;
    --bc-on-accent: #ffffff;
    --bc-accent-text: #111111;
    --bc-accent-soft: #ebebea;
    --bc-hero: #141414;
    --bc-on-hero: #ffffff;
    --bc-success: #178048;
    --bc-danger: #c62828;
    --bc-warning: #a35f00;
    --bc-font-display: 'Playfair Display', Georgia, serif;
    --bc-font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bc-display-transform: none;
    --bc-display-weight: 700;
    --bc-display-style: normal;
    --bc-display-tracking: -0.01em;
    --bc-radius: 14px;
    --bc-radius-sm: 10px;
    --bc-radius-btn: 12px;
    --bc-card-bg: var(--bc-surface);
    --bc-card-border: var(--bc-line);
    --bc-card-shadow: none;
    --bc-card-blur: none;
    --bc-page-pattern: none;
    --bc-page-pattern-size: auto;
    --bc-motion-distance: 10px;
    --bc-motion-duration: 480ms;
    --bc-motion-ease: cubic-bezier(.2, .8, .2, 1);
    --bc-press-scale: .97;
    --bc-motion-scale: 1;
    --bc-accent-2: var(--bc-accent);
    --bc-card-border-width: 1px;
    --bc-btn-shadow: 0 12px 28px -14px var(--bc-accent);
    --bc-btn-border: 0 solid transparent;
    --bc-display-shadow: none;
}

/* ---------- Página ---------- */

html,
body {
    color: var(--bc-text);
}

html {
    background-color: var(--bc-bg);
}

/* El color de fondo lo pinta html: así el dibujo de fondo (abajo) queda entre los dos */
body {
    background-color: transparent;
}

body {
    font-family: var(--bc-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* Dibujo de fondo del estilo (rayas, luz, madera...). Va en una capa fija aparte y no con
   background-attachment: fixed, que obliga a repintar toda la pantalla en cada cuadro del scroll:
   con los degradados grandes eso trababa el scroll en el celular. Esta capa se pinta una sola vez
   y el navegador solo la acomoda. */
.mud-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: var(--bc-page-pattern);
    background-size: var(--bc-page-pattern-size);
}

.mud-main-content {
    background-color: transparent;
}

/* En la compu no hay barra de arriba (está el menú lateral): un margen chico en lugar de su alto */
@media (min-width: 960px) {
    .mud-main-content {
        padding-top: 24px;
    }
}

::selection {
    background: var(--bc-accent);
    color: var(--bc-on-accent);
}

:focus-visible {
    outline: 2px solid var(--bc-accent-text);
    outline-offset: 2px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--bc-line) transparent;
}

/* ---------- Tipografía ---------- */

.mud-typography,
.mud-button-root,
.mud-input,
.mud-chip,
.mud-table,
.mud-snackbar {
    font-family: var(--bc-font-body);
}

h1, h2, h3, h4, h5, h6,
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6,
.bc-display {
    text-shadow: var(--bc-display-shadow);
    font-family: var(--bc-font-display);
    font-weight: var(--bc-display-weight);
    font-style: var(--bc-display-style);
    text-transform: var(--bc-display-transform);
    letter-spacing: var(--bc-display-tracking);
    /* Algunas letras de título traen números antiguos (el 1 parece una I): se fuerzan los de altura pareja */
    font-variant-numeric: lining-nums;
    text-wrap: balance;
}

.bc-muted { color: var(--bc-text-muted); }
.bc-accent-text { color: var(--bc-accent-text); }
.bc-num { font-variant-numeric: lining-nums tabular-nums; }

/* En el celular los campos van a 16 px: así iOS no hace zoom al tocarlos */
@media (max-width: 959.98px) {
    input, select, textarea,
    .mud-input > input.mud-input-root,
    .mud-input > textarea.mud-input-root {
        font-size: 16px;
    }
}

/* ---------- Tarjetas ---------- */

.bc-card,
.mud-card,
.mud-main-content .mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-popover):not(.mud-table):not(.mud-elevation-0) {
    background: var(--bc-card-bg);
    border: var(--bc-card-border-width) solid var(--bc-card-border);
    box-shadow: var(--bc-card-shadow);
    -webkit-backdrop-filter: var(--bc-card-blur);
    backdrop-filter: var(--bc-card-blur);
    border-radius: var(--bc-radius);
}

/* ---------- Botones y toques ---------- */

.mud-button-root:not(.mud-icon-button) {
    border-radius: var(--bc-radius-btn);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
}

.mud-button-root,
.bc-press {
    transition: transform 160ms var(--bc-motion-ease), background-color .2s, color .2s, box-shadow .2s;
}

.mud-button-root:active,
.bc-press:active {
    transform: scale(var(--bc-press-scale));
}

.mud-button-filled.mud-button-filled-primary {
    background-color: var(--bc-accent);
    color: var(--bc-on-accent);
    box-shadow: var(--bc-btn-shadow);
    border: var(--bc-btn-border);
}

.mud-chip {
    border-radius: var(--bc-radius-btn);
}

.mud-input-outlined-border,
.mud-input.mud-input-outlined {
    border-radius: var(--bc-radius-sm);
}

/* ---------- Movimiento ---------- */

/* Entrada: el contenido sube un poco y aparece. La distancia y la curva las define el local. */
@keyframes bc-rise {
    from {
        opacity: 0;
        transform: translateY(var(--bc-motion-distance)) scale(var(--bc-motion-scale));
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes bc-pop {
    0% { transform: scale(.88); }
    100% { transform: scale(1); }
}

@keyframes bc-shimmer {
    from { background-position: 150% 0; }
    to { background-position: -50% 0; }
}

.bc-rise {
    animation: bc-rise var(--bc-motion-duration) var(--bc-motion-ease) both;
}

/* Entrada escalonada de los hijos directos */
.bc-stagger > * {
    animation: bc-rise var(--bc-motion-duration) var(--bc-motion-ease) both;
}
.bc-stagger > *:nth-child(2) { animation-delay: 40ms; }
.bc-stagger > *:nth-child(3) { animation-delay: 80ms; }
.bc-stagger > *:nth-child(4) { animation-delay: 120ms; }
.bc-stagger > *:nth-child(5) { animation-delay: 160ms; }
.bc-stagger > *:nth-child(6) { animation-delay: 200ms; }
.bc-stagger > *:nth-child(7) { animation-delay: 240ms; }
.bc-stagger > *:nth-child(n+8) { animation-delay: 280ms; }

.bc-pop {
    animation: bc-pop 320ms var(--bc-motion-ease);
}

/* Silueta gris mientras algo carga */
.bc-skeleton {
    display: block;
    border-radius: var(--bc-radius-sm);
    background: linear-gradient(90deg, var(--bc-surface-2) 25%, var(--bc-line) 50%, var(--bc-surface-2) 75%);
    background-size: 200% 100%;
    animation: bc-shimmer 1.4s linear infinite;
}

/* Imágenes de fábrica (ImagenBase): dibujos de línea con los colores, el fondo y el efecto del estilo.
   Las variables --bc-art-* salen de Tema.cs, así cambian solas con la apariencia (y en la vista previa). */
.bc-arte {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    place-items: center;
}

.bc-arte::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--bc-page-pattern);
    background-size: var(--bc-page-pattern-size);
}

.bc-arte svg {
    fill: none;
    stroke: var(--bc-art-ink);
    stroke-width: var(--bc-art-stroke, 3.2);
    stroke-linecap: var(--bc-art-cap, round);
    stroke-linejoin: var(--bc-art-join, round);
}

.bc-arte svg .a { stroke: var(--bc-art-ink-2); }
.bc-arte svg .f { fill: var(--bc-art-ink); stroke: none; }
.bc-arte svg .a.f { fill: var(--bc-art-ink-2); }

.bc-arte-servicio {
    background:
        radial-gradient(90% 80% at 85% 10%, var(--bc-art-bg-2), transparent 70%),
        linear-gradient(150deg, var(--bc-art-bg), color-mix(in srgb, var(--bc-art-bg) 80%, var(--bc-bg)));
}

.bc-arte-servicio .bc-arte-dibujo {
    position: relative;
    height: 64%;
    width: auto;
    max-width: 120px;
    filter: var(--bc-art-fx);
}

/* El mismo dibujo, grande y tenue, cortado en una esquina: le da profundidad */
.bc-arte-servicio .bc-arte-eco {
    position: absolute;
    right: -30%;
    bottom: -42%;
    height: 150%;
    width: auto;
    opacity: .07;
    stroke-width: 2;
    transform: rotate(-12deg);
}

.bc-arte-portada {
    background:
        radial-gradient(60% 85% at 78% 30%, var(--bc-art-hero-glow), transparent 70%),
        linear-gradient(160deg, color-mix(in srgb, var(--bc-hero) 90%, #fff), color-mix(in srgb, var(--bc-hero) 72%, #000));
}

.bc-arte-portada .bc-arte-dibujo {
    position: absolute;
    top: 0;
    right: -6%;
    height: 110%;
    width: auto;
    stroke: var(--bc-art-hero-ink);
    stroke-width: calc(var(--bc-art-stroke, 3.2) * .75);
    filter: var(--bc-art-hero-fx);
    opacity: .92;
}

.bc-arte-portada svg .a { stroke: var(--bc-art-hero-ink-2); }
.bc-arte-portada svg .f { fill: var(--bc-art-hero-ink); }
.bc-arte-portada svg .a.f { fill: var(--bc-art-hero-ink-2); }

/* Portada angosta (celular, o la tarjeta de la portada en la PC): el dibujo se corre y se apaga para que el título se lea */
.bc-arte-portada { container-type: size; }

@container (max-width: 600px) {
    .bc-arte-portada .bc-arte-dibujo { right: -14%; opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

/* ---------- Utilidades que ya usaban las páginas ---------- */

@keyframes highlight-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.highlight-pulse {
    animation: highlight-pulse 0.6s ease-out;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

/* ---------- Barra de arriba y menú flotante (celular) ---------- */

.mud-appbar.bc-barra {
    background: color-mix(in srgb, var(--bc-bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    color: var(--bc-text);
    border-bottom: 1px solid color-mix(in srgb, var(--bc-line) 70%, transparent);
    padding-top: env(safe-area-inset-top);
}

.bc-barra .mud-toolbar {
    gap: 6px;
    padding-inline: 16px 8px;
}

.bc-barra-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}

.bc-barra-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    font-size: 13px;
}

.bc-drawer-logo {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    font-size: 17px;
}

.bc-barra-nombre {
    min-width: 0;
    font-size: 1.1rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-demo {
    flex: 0 0 auto;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bc-warning) 22%, transparent);
    color: var(--bc-warning);
}

.bc-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1300;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 7px;
    border-radius: calc(var(--bc-radius-btn) + 7px);
    background: color-mix(in srgb, var(--bc-surface) 86%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border: var(--bc-card-border-width) solid var(--bc-line);
    box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .45);
    animation: bc-rise var(--bc-motion-duration) var(--bc-motion-ease) both;
}

.bc-menu-item {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    border-radius: var(--bc-radius-btn);
    color: var(--bc-text-muted);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: flex-grow var(--bc-motion-duration) var(--bc-motion-ease), background-color .25s, color .25s;
}

.bc-menu-item:active {
    transform: scale(var(--bc-press-scale));
}

.bc-menu-activo {
    flex-grow: 2.2;
    background: var(--bc-accent);
    color: var(--bc-on-accent);
}

.bc-menu-activo span {
    animation: bc-pop var(--bc-motion-duration) var(--bc-motion-ease) both;
}

/* ---------- Errores de Blazor ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzg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------- Logo del local ---------- */

.bc-logo {
    object-fit: cover;
    border-radius: 50%;
}

.bc-logo-iniciales {
    display: inline-grid;
    place-items: center;
    background: var(--bc-accent);
    color: var(--bc-on-accent);
    font-family: var(--bc-font-body);
    font-weight: 800;
    letter-spacing: .02em;
}

/* Botones del menú lateral: siguen las esquinas del estilo */
.bc-cajon-boton {
    border-radius: var(--bc-radius-btn) !important;
}

/* Al pasar de día a noche (o al guardar un estilo) los colores cambian con un fundido corto */
.bc-cambiando-tema,
.bc-cambiando-tema *,
.bc-cambiando-tema *::before,
.bc-cambiando-tema *::after {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important;
}

/* ---------- Botón día / noche ---------- */

.bc-modo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--bc-radius-btn);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bc-modo:hover {
    background: color-mix(in srgb, var(--bc-text) 7%, transparent);
}

.bc-modo-icono {
    display: inline-grid;
    place-items: center;
    transition: transform var(--bc-motion-duration) var(--bc-motion-ease);
}

.bc-modo-noche {
    transform: rotate(180deg);
}
