/* BMEN — reset y variables globales */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #0f172a;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}
input, button, textarea, select {
    font: inherit;
}
button {
    cursor: pointer;
    border: none;
    background: none;
}
a {
    color: inherit;
    text-decoration: none;
}
ul, ol {
    list-style: none;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
}
::selection {
    background: #0EA5E9;
    color: white;
}
:focus-visible {
    outline: 2px solid #0EA5E9;
    outline-offset: 2px;
}
/* ===== Variables de color ===== */
:root {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-alt: #f1f5f9;
    --color-primary: #0EA5E9;
    --color-primary-dark: #0284C7;
    --color-accent: #14B8A6;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;
    --color-success: #10B981;
    --color-success-bg: #D1FAE5;
    --color-warning: #F59E0B;
    --color-warning-bg: #FEF3C7;
    --color-danger: #EF4444;
    --color-danger-bg: #FEE2E2;
    --color-muted: #94A3B8;
    --color-muted-bg: #F1F5F9;
    --color-info: #3B82F6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
    --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -2px rgba(15,23,42,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.05);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}
/* ===== Utilidades ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
/* ===== Botones ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14,165,233,0.35);
}
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}
.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}
.btn-full {
    width: 100%;
}
.btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: #DC2626;
    border-color: #DC2626;
}
.btn-success-outline {
    background: transparent;
    color: var(--color-success);
    border: 1px solid var(--color-success);
}
.btn-success-outline:hover {
    background: var(--color-success-bg);
}
.btn-warning-outline {
    background: transparent;
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
}
.btn-warning-outline:hover {
    background: var(--color-warning-bg);
}
.btn-danger-outline {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}
.btn-danger-outline:hover {
    background: var(--color-danger-bg);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
/* ===== Formularios ===== */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
}
.form-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.form-input::placeholder {
    color: var(--color-text-light);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
}
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}
.form-input.error {
    border-color: var(--color-danger);
}
/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    line-height: 1.4;
}
.badge-success {
    background: var(--color-success-bg);
    color: #065F46;
}
.badge-warning {
    background: var(--color-warning-bg);
    color: #92400E;
}
.badge-danger {
    background: var(--color-danger-bg);
    color: #991B1B;
}
.badge-muted {
    background: var(--color-muted-bg);
    color: var(--color-text-muted);
}
.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}
/* ===== Alertas ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}
.alert-error {
    background: var(--color-danger-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}
.alert-success {
    background: var(--color-success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}
.alert-warning {
    background: var(--color-warning-bg);
    color: #92400E;
    border: 1px solid #FDE68A;
}
.alert-icon {
    font-size: 16px;
}
/* ===== Toast ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: toast-in 0.3s ease;
}
.toast-success {
    border-left: 3px solid var(--color-success);
}
.toast-error {
    border-left: 3px solid var(--color-danger);
}
.toast-warning {
    border-left: 3px solid var(--color-warning);
}
.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ===== Animaciones de entrada ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.fade-in-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}
.fade-in-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}
.animate-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    animation: stagger-in 0.5s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.4s; }
@keyframes stagger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
/* ===== Grid genérico ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .grid-4, .grid-3 {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
/* ===== Section genérico ===== */
.section {
    padding: 60px 0;
}
.section-alt {
    background: var(--color-surface-alt);
}
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    text-align: center;
}
.section-subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 40px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state-text {
    font-size: 14px;
}
/* ===== Loading ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .container {
        padding: 0 16px;
    }
    .section {
        padding: 40px 0;
    }
    .section-title {
        font-size: 22px;
    }
}
