/* ============================================
   MIBOT NEXT — Light Theme (Magno-inspired)
   ============================================ */

/* --- Reset y variables --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Sidebar (oscuro) */
    --sidebar-bg: #0f172a;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #f0f0f5;
    --sidebar-text-muted: rgba(240, 240, 245, 0.45);

    /* Contenido (claro) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-glass: #ffffff;
    --border-glass: #e2e8f0;
    --border-glass-hover: rgba(59, 130, 246, 0.3);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Accent — amarillo */
    --accent: #facc15;
    --accent-hover: #ca8a04;
    --accent-light: #fef3c7;
    --accent-glow: rgba(250, 204, 21, 0.1);
    --accent-glow-strong: rgba(250, 204, 21, 0.2);

    /* Colores secundarios Magno */
    --emerald: #10b981;
    --emerald-light: #d1fae5;
    --cyan: #06b6d4;
    --cyan-light: #cffafe;
    --yellow: #facc15;
    --yellow-light: #fef9c3;

    /* Estados */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

/* --- Canvas de particulas (solo auth) --- */
#bg-particulas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: all;
}

.contenido-sobre-canvas {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.contenido-sobre-canvas * {
    pointer-events: auto;
}

/* --- Header --- */
.header-principal {
    background: #ffffff;
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Paginas de auth (login, registro, organizacion) --- */
.pagina-auth {
    background: #0f172a;
    color: #f0f0f5;
}

.auth-contenedor {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 100vh;
}

/* --- Cards con glassmorphism (auth pages - dark) --- */
.glass-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: fadeSlideUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.4), transparent);
}

.glass-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
    color: #f0f0f5;
}

.glass-card > p {
    color: rgba(240, 240, 245, 0.55);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Logo animado --- */
.logo-auth {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #fde047 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* --- Formularios --- */
.form-auth,
.form-organizacion {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.campo label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Auth forms (dark background) */
.pagina-auth .campo label {
    color: rgba(240, 240, 245, 0.55);
}

.campo input {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    font-family: var(--font);
}

.pagina-auth .campo input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f0f0f5;
}

.campo input::placeholder {
    color: var(--text-muted);
}

.pagina-auth .campo input::placeholder {
    color: rgba(240, 240, 245, 0.35);
}

.campo input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #ffffff;
}

.pagina-auth .campo input:focus {
    background: rgba(255, 255, 255, 0.08);
}

/* --- Botones --- */
.btn-principal {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: #facc15;
    color: #1e3a5f;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
    margin-top: 0.25rem;
}

.btn-principal::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.1) 50%, transparent 60%);
    background-size: 300% 100%;
    animation: btnShine 3s ease infinite;
}

@keyframes btnShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn-principal:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.35);
}

.btn-principal:active {
    transform: translateY(0);
}

.btn-principal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    color: #f0f0f5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* --- Separador --- */
.separador {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: rgba(240, 240, 245, 0.35);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.separador::before,
.separador::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Link alterno --- */
.link-alterno {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(240, 240, 245, 0.55);
}

.link-alterno a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.link-alterno a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* --- Mensajes de error --- */
.error-mensaje {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(248, 113, 113, 0.15);
    text-align: left;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- Dashboard --- */
.dashboard {
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 240px);
    box-sizing: border-box;
}

.dashboard-bienvenida {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.bienvenida-card {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    padding: 2.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.5s ease-out;
    box-shadow: var(--shadow);
}

.bienvenida-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #facc15, #fde047, #facc15);
}

.bienvenida-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.bienvenida-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Info de usuario --- */
.usuario-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    padding: 2rem;
    border-radius: var(--radius);
    transition: var(--transition);
    animation: fadeSlideUp 0.6s ease-out 0.1s both;
    box-shadow: var(--shadow);
}

.usuario-info:hover {
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-md);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    transition: var(--transition);
}

.avatar:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.usuario-info h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
}

.usuario-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.4rem;
    margin-right: 0.35rem;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(100, 180, 255, 0.15);
}

.badge-org {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.15);
}

/* --- Avatar placeholder para usuarios sin foto --- */
.avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* --- Botones de logout --- */
.btn-logout {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 1.5rem;
    font-family: var(--font);
    animation: fadeSlideUp 0.7s ease-out 0.2s both;
}

.btn-logout:hover {
    background: var(--danger-bg);
    border-color: rgba(248, 113, 113, 0.5);
    transform: translateY(-1px);
}

.btn-logout-sm {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-logout-sm:hover {
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
    background: var(--danger-bg);
}

/* --- Footer --- */
.footer-principal {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border-glass);
    letter-spacing: 0.02em;
}

/* --- Animaciones --- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Scrollbar custom --- */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Selection --- */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .glass-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .usuario-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .dashboard {
        padding: 1rem;
    }

    .header-principal {
        padding: 0.75rem 1rem;
    }
}
