/* ========================================
   CM PLATFORM - RESET.CSS
   ======================================== */

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

html {
    font-family: var(--cm-font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--cm-text-primary);
    background-color: var(--cm-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--cm-font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--cm-text-primary);
}

h1 { font-size: var(--cm-text-5xl); }
h2 { font-size: var(--cm-text-4xl); }
h3 { font-size: var(--cm-text-3xl); }
h4 { font-size: var(--cm-text-2xl); }
h5 { font-size: var(--cm-text-xl); }
h6 { font-size: var(--cm-text-lg); }

p {
    color: var(--cm-text-secondary);
    line-height: 1.6;
}

code, pre {
    font-family: var(--cm-font-mono);
    font-size: var(--cm-text-sm);
}

::selection {
    background: var(--cm-accent-muted);
    color: var(--cm-text-primary);
}

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

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cm-bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--cm-text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cm-text-secondary);
}

/* ========================================
   BLAZOR ERROR UI OVERRIDES
   ======================================== */
#blazor-error-ui {
    background: var(--cm-error);
    color: var(--cm-text-inverse);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none; /* Oculto por defecto, Blazor le pondrá block si falla */
    left: 0;
    padding: var(--cm-space-md) var(--cm-space-lg);
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: var(--cm-font-body);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--cm-space-md);
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

#blazor-error-ui .reload {
    color: var(--cm-text-inverse);
    text-decoration: underline;
    margin-left: var(--cm-space-sm);
}